mirror of
https://github.com/block/buzz.git
synced 2026-08-18 06:50:31 +02:00
Fold Thufir's three blocking amendments into cbfbe1ed0:
1. Centralize display metric as DisplayTotal {kind, value, partial}.
deriveApproxTotal() replaced by deriveDisplayTotal() returning an
explicit exact|approximate|unknown discriminant with provenance:
- exact: totalTokens.value present; partial mirrors wire incomplete flag
- approximate: totalTokens null, i/o known; value = bigint-safe i/o sum;
partial = inputTokens.incomplete || outputTokens.incomplete
- unknown: no token counts at all; value null, partial false
All surfaces (Section header/bars/rows, DailyBars, FocusedView stat)
now consume this single result — no surface can drift independently.
2. Re-sort agents/models by display tier.
sortAgentsByKnownTotal/sortModelsByKnownTotal replaced by
sortAgentsByDisplayTotal/sortModelsByDisplayTotal using a three-tier
key (exact=0, approximate=1, unknown=2), descending by value within
tier, then existing tiebreaks. With all-null prod totals the list
order and bar widths now agree instead of disagreeing.
3. Split caveat paragraph into per-condition sentences.
The single agent-usage-focused-partial-explanation block replaced by
two separately-gated <p> elements:
- agent-usage-focused-unknown-intervals-caveat: gates on hasUnknownUsage
- agent-usage-focused-invalid-reports-caveat: gates on invalidReportCount > 0
Each sentence claims only what its gate proves.
Test updates:
- deriveApproxTotal tests replaced with deriveDisplayTotal tests covering
all three kinds, partial provenance, and i/o-only combinations.
- Sort tests updated for new export names and assertions.
- Mixed exact/approximate/unknown population tests added for both
sortAgentsByDisplayTotal and sortModelsByDisplayTotal.
- e2e spec updated from single partial-explanation testid to the two
per-condition testids.
- 3567 tests pass, tsc --noEmit clean.
Co-authored-by: Will Pfleger <pfleger.will@gmail.com>
Signed-off-by: Will Pfleger <pfleger.will@gmail.com>
Buzz
Desktop chat shell with:
- Tauri + React + TypeScript + Vite
- Tailwind CSS
- shadcn/ui-ready shared components
- Biome (lint/format/check)
- Feature-driven frontend structure
Scripts
pnpm dev- run the web frontendpnpm tauri dev- run the desktop apppnpm build- typecheck and build frontendpnpm typecheck- TypeScript checkspnpm lint- Biome lintpnpm format- Biome format (write)pnpm check- Biome check
Structure
src/shared- reusable app-wide code (ui,lib,styles)src/features- feature modules (vertical slices)src/app- top-level app composition