summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAdam Malczewski <[email protected]>2026-06-02 14:40:21 +0900
committerAdam Malczewski <[email protected]>2026-06-02 14:40:21 +0900
commita9097498b0e90f45a0eaf1ce2d43275dc9ac8fa4 (patch)
treeae17b706b2d46aaf8fcbe1433cece01814535d53
parentf0207a7f000257e6c459db7053edbae4d68fcf3f (diff)
downloaddispatch-a9097498b0e90f45a0eaf1ce2d43275dc9ac8fa4.tar.gz
dispatch-a9097498b0e90f45a0eaf1ce2d43275dc9ac8fa4.zip
Add HANDOFF.md for sb/status-bar
-rw-r--r--HANDOFF.md75
1 files changed, 50 insertions, 25 deletions
diff --git a/HANDOFF.md b/HANDOFF.md
index 8d6960b..5755279 100644
--- a/HANDOFF.md
+++ b/HANDOFF.md
@@ -1,38 +1,63 @@
-# Handoff — m1/minor-fixes
+# Handoff — sb/status-bar
-Three small, independent UI fixes in the Dispatch frontend.
+Add a status bar beneath the chat input that houses the send button and shows
+generation status + context-window usage.
## Files changed
-- `packages/frontend/src/lib/components/CacheRatePanel.svelte`
- - **Fix 1:** Added `whitespace-nowrap` to the requests-count badge (`{cacheStats.requests} req`) so it no longer wraps to a second line.
- - **Fix 2:** Removed the trailing explanatory paragraph ("Cache reads cost ~10% of fresh input; writes cost ~25% more…").
-- `packages/frontend/src/lib/components/KeyUsage.svelte`
- - **Fix 3:** Added `pacedProgressClass(percentUsed, elapsedPct)` and applied it to the 5 bars that render a "time dot" (Claude 5-Hour/Weekly, opencode-go 5-Hour/Weekly/Monthly).
+- `packages/frontend/src/lib/components/ChatInput.svelte` — restructured into
+ **two stacked bars** (wrapped in `flex flex-col`):
+ - **Top bar:** the existing auto-resizing textarea + a single, fixed-width
+ (`w-20`) send/stop button that morphs in place so the layout never shifts.
+ Three states:
+ - not generating → `btn-primary` **Send**, disabled when the box is empty
+ (unchanged look).
+ - generating + empty box → **Stop** (`btn-error btn-outline`, spinner +
+ "Stop"), calls `tabStore.stopGeneration(tabId)`.
+ - generating + text in box → enabled **Send** (queues the message via
+ `tabStore.sendMessage`).
+ - **Bottom bar:** agent status icon on the left (✓ idle / spinner running /
+ ✗ error), a context-window fill `progress` bar filling the middle, and a
+ compact token count + percent on the right (e.g. `12.3k / 200k · 6.1%`).
+ When the model's max context is unknown the bar renders inert/disabled
+ (`opacity-40`, no value) and the right side shows the bare current token
+ count with no percent. Before the first response it reads `— tokens`.
+- `packages/frontend/src/App.svelte` — pass the already-computed `contextLimit`
+ into `<ChatInput {contextLimit} />` (same value handed to the sidebar).
## Public surface changed
-- None externally. No exported API, prop, or type changes.
-- New module-internal helper `pacedProgressClass` in `KeyUsage.svelte` (not exported). Existing `progressClass` retained and reused as the fallback.
-
-## Fix 3 coloring logic
-`pacedProgressClass(percentUsed, elapsedPct)`:
-- `percentUsed >= 90` → `progress-error` (red) — always, per spec.
-- no time dot (`elapsedPct < 0`, e.g. missing `resetsAt`) → fall back to existing `progressClass` thresholds.
-- `percentUsed <= elapsedPct` → `progress-success` (green; equal counts as green/on-pace).
-- otherwise (usage ran ahead of the dot) → `progress-warning` (orange).
-
-Applied only to the 5 dot-bearing bars. The 3 Copilot/Gemini bars were intentionally left on the original `progressClass` (confirmed unused/out of scope by the requester).
+- `ChatInput.svelte` gained one optional prop: `contextLimit?: number | null`
+ (defaults to `null`). No other exported API/type changes.
+- Reuses the shared `computeContextUsage()` helper (`lib/context-window.ts`) and
+ the same fill-color thresholds (calm→warning→danger) as the Context Window
+ sidebar panel, so the two displays always agree. Compact `k`/`M` token
+ formatting is local to `ChatInput` (the sidebar keeps full `toLocaleString`).
+
+## Design decisions (agreed with requester)
+- Two stacked bars; send button kept (not dropped) for discoverability.
+- Send and Stop are the **same button** at a fixed width — no layout jump.
+- Bottom bar: status icon left; context number + percent right; progress bar
+ fills the remaining width; disabled/inert bar when the model has no known max.
+- Token format: compact (`12.3k`) for the slim bar.
## Verification status — PASS
- `bun run check` (biome): **PASS** — "Checked 163 files… No fixes applied."
-- `bun run test` (vitest): **PASS** — 35 test files, 552 tests passed.
-- Re-verified after `git merge --no-edit dev` (was already up to date) — still all-green.
+- `bun run test` (vitest): **PASS** — 35 files, 552 tests.
+- `bun run --cwd packages/frontend typecheck` (svelte-check): **PASS** — 0
+ errors, 0 warnings.
+- Re-verified all three after `git merge --no-edit dev` — still all-green.
- Note: `bun install` was required first; deps were not present in the worktree.
## Published
-- Yes. Committed `084f4d7`, merged `dev` down (already up to date), pushed fast-forward `7c527b4..084f4d7 → dev`.
+- Yes. Feature commit `2756730`, merged `dev` down (`f0207a7`, clean merge —
+ picked up another agent's CacheRatePanel/KeyUsage changes + their HANDOFF.md),
+ pushed fast-forward `3f0bfe7..f0207a7 → dev`.
+- This HANDOFF.md was rewritten from the incoming `m1/minor-fixes` handoff (that
+ content remains preserved in git history on its own merge).
## Assumptions / known gaps
-- Per requester: Copilot & Gemini usage bars are unused, so they keep the old threshold coloring (untouched).
-- Red threshold is `>= 90%` (exactly 90 is red); tie between usage and the dot resolves to green — both confirmed by requester.
-- Dot-less / hidden-dot cycle bars fall back to the original `progressClass` thresholds (confirmed option "a").
-- Changes are presentation-only (Tailwind/daisyUI classes + a coloring helper); no automated tests were added for the Svelte markup, consistent with the existing repo (no component-render tests for these panels). User visually confirmed the result before publish.
+- User visually confirmed the UI before merge ("sweet, merge it in").
+- No component-render tests were added for the Svelte markup, consistent with
+ the existing repo (these panels have no render tests). Logic is exercised
+ indirectly via the unchanged `computeContextUsage` unit tests.
+- Context usage reflects the most recent turn (`last.inputTokens +
+ last.outputTokens`) — identical semantics to the sidebar panel.