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:
@@ -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>");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user