From 94da06025d4edd23cb7eda1deb2738070e08cd30 Mon Sep 17 00:00:00 2001 From: Adam Malczewski Date: Fri, 12 Jun 2026 15:08:24 +0900 Subject: feat(chat): multi-client live view — watch in-flight turns + user prompt on stream MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - subscribe every open conversation on load + WS reconnect (resync), unsubscribe on tab close - derive a stream-based 'generating' state for watchers (Composer running indicator) - fold the user-message turn event so watchers render the prompt mid-turn (de-dup vs sender's optimistic echo) - re-pin wire@0.6.0 / transport-contract@0.8.0; re-mirror contracts; add user-message to the exhaustiveness guard --- src/core/chunks/selectors.ts | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/core/chunks/selectors.ts') diff --git a/src/core/chunks/selectors.ts b/src/core/chunks/selectors.ts index 839ba65..6929de2 100644 --- a/src/core/chunks/selectors.ts +++ b/src/core/chunks/selectors.ts @@ -23,6 +23,15 @@ export function selectChunks(state: TranscriptState): readonly RenderedChunk[] { return result; } +/** + * Whether a turn is currently generating (for a "generating…" indicator). True + * for ANY client watching the conversation — the sender, a second device, or a + * reconnected client whose in-flight turn was replayed. + */ +export function selectGenerating(state: TranscriptState): boolean { + return state.generating; +} + /** * Group consecutive same-role rendered chunks into ChatMessages. */ -- cgit v1.2.3