diff options
| author | Adam Malczewski <[email protected]> | 2026-06-28 15:26:40 +0900 |
|---|---|---|
| committer | Adam Malczewski <[email protected]> | 2026-06-28 15:26:40 +0900 |
| commit | c48b8739fbb66b34d0b882a6d39cdd4fb4aaf2e2 (patch) | |
| tree | a4dbfda1ed278c2c59360da292a502481fa4fb6d /src/features/chat/ui | |
| parent | 85a4e3f022397cdfb6221151e1b4f843d41ff360 (diff) | |
| parent | 69655416908768c4805ad20de8a3fdd8b2ed8291 (diff) | |
| download | dispatch-web-c48b8739fbb66b34d0b882a6d39cdd4fb4aaf2e2.tar.gz dispatch-web-c48b8739fbb66b34d0b882a6d39cdd4fb4aaf2e2.zip | |
Merge branch 'feature/step-context-update' into predev
Diffstat (limited to 'src/features/chat/ui')
| -rw-r--r-- | src/features/chat/ui/Composer.svelte | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/features/chat/ui/Composer.svelte b/src/features/chat/ui/Composer.svelte index afe1e3c..04c28cd 100644 --- a/src/features/chat/ui/Composer.svelte +++ b/src/features/chat/ui/Composer.svelte @@ -39,8 +39,10 @@ onQueue?: (text: string) => void; /** Stop the in-flight generation (`POST /conversations/:id/stop`). */ onStop?: () => void; - // Current context occupancy (latest turn's contextSize), or `undefined` - // when unknown — the status bar then shows "— tokens", never 0%. + // Current context occupancy — updated progressively during a turn (the + // latest step's input+output) and finalized to the turn's `contextSize` on + // seal, or `undefined` when unknown — the status bar then shows + // "— tokens", never 0%. contextSize?: number | undefined; /** Per-model context window (max tokens) from `GET /models` modelInfo. */ contextWindow?: number | undefined; @@ -66,7 +68,6 @@ const canSend = $derived(hasText || hasImages); const effectiveMax = $derived(contextWindow ?? FALLBACK_CONTEXT_WINDOW); const usage = $derived(computeContextUsage(contextSize, effectiveMax)); - const hasUsage = $derived(contextSize !== undefined); // One button, three modes: // - idle → "Send" (starts a turn via chat.send) @@ -395,7 +396,7 @@ {/if} <span class="shrink-0 whitespace-nowrap font-mono"> - {#if hasUsage} + {#if usage.current !== null} {formatCompactTokens(usage.current)}{#if usage.max !== null}<span class="text-base-content/40" > |
