Files
archie/ui/src/chat/channel.ts
T
sam 0eecc95aac feat(ui): one chat panel on every page; the workflow editor syncs its draft around a turn
Replaces the separate Build with Archie bar and its per-workflow channel, so
every conversation belongs to the account and is listed on every device, and
the command palette is the same everywhere.
2026-10-19 02:56:23 +11:00

18 lines
502 B
TypeScript

import { randomUUID } from "@/lib/uuid";
const CHANNEL_KEY = "archie.web.chat.channel";
/**
* The browser's chat identity. The server keys a conversation on the channel
* alone (the browser has no threading), so this is persisted: a reload rejoins
* the conversation instead of starting a second one beside it.
*/
export function channelID(): string {
let id = localStorage.getItem(CHANNEL_KEY);
if (!id) {
id = randomUUID();
localStorage.setItem(CHANNEL_KEY, id);
}
return id;
}