mirror of
https://github.com/block/buzz.git
synced 2026-08-18 06:50:31 +02:00
Switching tabs left the outgoing session's text on screen. Only the cursor line moved, because `apply()` re-dirties it. `TerminalGrid` drains its dirty set in `paint()`, not in `apply()` (the sole `#dirty.clear()` is the last statement of `paint`). So an inactive session accumulates dirty lines and repaints fine on the first switch to it -- the failure needs a round trip. Once a grid has been painted and then deactivated, it holds rows with an empty dirty set, and the paint effect swapped `gridRef` without marking anything: `paint()` drew zero lines and the canvas kept the previous session's pixels. `markAllDirty()` alone is not sufficient. Switching to a session that has delivered no frame yet has no grid at all, so `markAllDirty()` and `paint()` are both no-ops on the optional chain, and only the background fill can erase the outgoing session. The fill is therefore not grid-guarded, and it covers the full canvas bounds rather than `columns * cellWidth`, which leaves a gutter. Both refs are read-then-written after the effect's early returns, so a pass that bails on a missing canvas or context keeps the switch pending instead of swallowing it. Four tests, each pinned by a mutant that only it kills: the round trip, the no-frame case, a negative test that a frame on an unchanged session does not force a full repaint (guarding the damage model against a permanently-true `sessionChanged`), and the bailed-pass case. The suite's `getContext` stub discarded every argument, which makes any assertion about painting vacuous; it now records draw calls keyed by canvas element so the banner canvas cannot be mistaken for the grid. Co-authored-by: tlongwell-block <109685178+tlongwell-block@users.noreply.github.com> Signed-off-by: tlongwell-block <109685178+tlongwell-block@users.noreply.github.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