feat: publish initial manifest on startup and improve UI focus

- Publish the existing session manifest via the broker on startup
- Automatically focus the new session input field when it is shown
- Prevent event propagation when clicking to create a new session
This commit is contained in:
2026-07-08 00:08:12 +08:00
parent 3eba8b3279
commit 57ffb35f2b
2 changed files with 35 additions and 3 deletions
+14
View File
@@ -150,6 +150,20 @@ export async function createJournalServer(
() => {},
);
// Publish the initial manifest on startup so clients see existing sessions
const initialManifest = loadManifest(root);
broker.publish(
{
topic: $SESSIONS,
payload: Buffer.from(JSON.stringify(initialManifest)),
qos: 1,
retain: true,
cmd: "publish" as const,
dup: false,
},
() => {},
);
console.log("[journal] persistence listener active");
console.log("[journal] broker available at ws://<host>:<port>");