Files
buzz/desktop
npub1cc3ha7z055mu0rwwu7806t2wt8mj3pvu0uv5mfp2c50dahaqhczshdalg6andtlongwell-block 4354fe3bc2 fix(terminal): repaint the whole viewport when the active session changes
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>
2026-08-02 21:50:00 -04:00
..
…

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 frontend
  • pnpm tauri dev - run the desktop app
  • pnpm build - typecheck and build frontend
  • pnpm typecheck - TypeScript checks
  • pnpm lint - Biome lint
  • pnpm 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