fix(journal): decouple broker from session

The broker connection now persists across session changes. Joining or switching a session swaps subscriptions instead of reconnecting, and a lobby lets sessions be listed and created before joining one.

Fixes session switching being a no-op (the store only updated local state) and session creation being unreachable before connecting. Also removes the dead ConnectionBar and the no-op hydrateFromServer/setSessionId store calls.
This commit is contained in:
2026-09-13 13:23:50 +08:00
parent 59f87bffda
commit 30ec8a43cf
9 changed files with 350 additions and 293 deletions
+4 -4
View File
@@ -4,8 +4,7 @@
import { Component, createSignal, For, Show } from "solid-js";
import {
sessions,
setSessionId,
hydrateFromServer,
joinSession,
useJournalStream,
} from "../stores/journalStream";
@@ -25,8 +24,9 @@ export const SessionDropdown: Component<SessionDropdownProps> = (props) => {
return;
}
setDropdownOpen(false);
setSessionId(id);
hydrateFromServer(id).catch(() => {});
joinSession(id).catch((e) => {
console.error("[journal] failed to switch session:", e);
});
};
// Close dropdown on outside click