diff options
| author | Adam Malczewski <[email protected]> | 2026-06-07 18:41:27 +0900 |
|---|---|---|
| committer | Adam Malczewski <[email protected]> | 2026-06-07 18:41:27 +0900 |
| commit | 48c6d85c3cc5a57a729f14068e2346b17ed62088 (patch) | |
| tree | ec56590653f399f4a5feae0245652eba8f352ad5 /src/app | |
| parent | 2e79dd122e5664353e02e0d33715ae8c1041a379 (diff) | |
| download | dispatch-web-48c6d85c3cc5a57a729f14068e2346b17ed62088.tar.gz dispatch-web-48c6d85c3cc5a57a729f14068e2346b17ed62088.zip | |
feat(chat): live turn metrics — telemetry reducer + rendering
Consume wire/transport-contract 0.3.0 (step-complete event + timing
fields on usage/tool-result/done). Pure core/telemetry module:
foldMetricEvent (reducer) + derived selectors (stepTps, turnTps, etc).
TelemetryState is pure data, no active-turn tracking — consumers pass
turnId to selectors. ChatStore wires foldMetricEvent into handleDelta
and exposes telemetry + currentTurnId. ChatView shows step-metrics
footer (time/TPS/tokens) on assistant text bubbles and durationMs badge
on tool cards. New TurnSummary component renders turn-level stats
(wall-clock, tokens, steps, TPS) in a DaisyUI stats block. Extended
live-probe to verify telemetry events against bin/up (pending backend
restart). 336 tests, typecheck 0, biome clean, build ok.
Diffstat (limited to 'src/app')
| -rw-r--r-- | src/app/App.svelte | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/app/App.svelte b/src/app/App.svelte index 61b4cb9..e1d59f9 100644 --- a/src/app/App.svelte +++ b/src/app/App.svelte @@ -1,6 +1,6 @@ <script lang="ts"> import type { InvokeMessage } from "@dispatch/ui-contract"; - import { ChatView, Composer, ModelSelector } from "../features/chat"; + import { ChatView, Composer, ModelSelector, TurnSummary } from "../features/chat"; import { TabBar } from "../features/tabs"; import { SurfaceView } from "../features/surface-host"; import type { AppStore } from "./store.svelte"; @@ -62,7 +62,15 @@ <div class="flex-1 overflow-y-auto"> {#key store.activeConversationId} - <ChatView chunks={store.activeChat.chunks} /> + <ChatView + chunks={store.activeChat.chunks} + telemetry={store.activeChat.telemetry} + currentTurnId={store.activeChat.currentTurnId} + /> + <TurnSummary + telemetry={store.activeChat.telemetry} + turnId={store.activeChat.currentTurnId} + /> {/key} </div> |
