summaryrefslogtreecommitdiffhomepage
path: root/src/app
diff options
context:
space:
mode:
authorAdam Malczewski <[email protected]>2026-06-07 18:41:27 +0900
committerAdam Malczewski <[email protected]>2026-06-07 18:41:27 +0900
commit9a4fc0aa0b56e7bb083ecc615647ed8f6b2ef4c2 (patch)
tree1fd5b4081736cf48c7b916abcdbeab267b4322d6 /src/app
parentdcf5a2993c9cbeb266f2629cf33fbc43f52c7ca8 (diff)
downloaddispatch-web-9a4fc0aa0b56e7bb083ecc615647ed8f6b2ef4c2.tar.gz
dispatch-web-9a4fc0aa0b56e7bb083ecc615647ed8f6b2ef4c2.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.svelte12
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>