mirror of
https://github.com/block/buzz.git
synced 2026-08-18 06:50:31 +02:00
Wren caught that the one negation was executed by everything and asserted by nothing. The frontend test proved a wheel delta reaches IPC as `lines: -2`; the engine tests proved `scroll(+2)` goes back into history. Neither ran the conversion between them, so deleting `-lines` from `terminal_scroll` left both suites green and reversed the terminal on a real trackpad. Reproduced before fixing: that mutant SURVIVED the full `buzz-terminal` and `buzz-desktop --lib` suites. The negation becomes `engine_scroll_lines`, a named function rather than a `-` in an argument list, because a conversion with no name has nowhere to hang an assertion. Three tests: the arithmetic with the direction in the test name, an end-to-end pass that drives a real `SharedTerminal` through the helper and asserts on the text that lands on screen -- the unit alone would still pass if the engine read the sign the other way -- and the `i32::MIN` case. `saturating_neg` rather than unary negation, also Wren's: `lines` arrives over IPC, and `-i32::MIN` panics in debug and wraps back to `i32::MIN` in release. The release case is the dangerous one, silently scrolling the wrong way on a crafted command. Saturating keeps the direction the caller asked for and lets the engine clamp. 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