fix a few multisync issues

This commit is contained in:
Ross
2026-06-28 21:51:39 +01:00
parent d32e2a5231
commit d07d88bdbf
5 changed files with 291 additions and 183 deletions
@@ -58,7 +58,7 @@
<span class="input-group-text bg-secondary text-white border-secondary">
<i class="bi bi-search"></i>
</span>
<input type="text" id="multiuserCaseSearch" class="form-control bg-dark text-white border-secondary"
<input type="text" id="multiuserCaseSearch" name="q" class="form-control bg-dark text-white border-secondary"
placeholder="Search cases to load..."
hx-get="{% url 'atlas:multiuser_search_cases' session_id=session.id %}"
hx-trigger="input delay:300ms, focus"
@@ -161,6 +161,7 @@
container.scrollTop = container.scrollHeight;
}
}
window.logDebug = logDebug;
function clearDebugLogs() {
const container = document.getElementById("syncDebugLogsContainer");
@@ -264,12 +265,16 @@
logDebug("Session WS event received (type=" + data.type + ")", data);
if (data.type === 'change_case') {
{% if not is_manager %}
logDebug("Session host changed case to " + data.case_id + ". Fetching new case via HTMX...");
// Fetch new case content via HTMX
htmx.ajax('GET', "{% url 'atlas:multiuser_case_content_partial' session_id=session.id %}", {
target: "#multiuser-case-container",
swap: "innerHTML"
});
{% else %}
logDebug("Host ignored change_case broadcast to avoid double-swap");
{% endif %}
} else if (data.type === 'room_status') {
// Update user count
const userCount = Object.keys(data.users || {}).length;