mirror of
https://github.com/block/buzz.git
synced 2026-08-18 06:50:31 +02:00
Buzz Term had no keyboard path to its tab actions: `encodeTerminalKey` rejects every metaKey event and the substrate handled only the Cmd+J handoff, so `onNewSession`/`onCloseSession`/`onSelectSession` existed as props with nothing bound to them. Add a capture-phase chord layer alongside the Cmd+J listener, gated on `enabled && owner === "terminal"`: Cmd+T spawns, Cmd+W closes the active tab, Shift+Cmd+Left/Right step between tabs. Matching lives in `matchTabChord`/`stepSession` as pure functions, mirroring the existing `matchBackForwardChord` split. Cmd+W additionally needed the native layer. Buzz never called `Builder::menu()`, so Tauri auto-installed `Menu::default()`, whose File and Window submenus each carry a `close_window` item bound to Cmd+W -- and macOS resolves a menu key equivalent before the webview sees any key event, so no JS listener could ever claim it. That accelerator was also already wrong on its own terms: `CloseRequested` on the main window is intercepted and turned into hide-to-tray, so Cmd+W hid the whole app rather than closing anything, duplicating Cmd+H. `app_menu` now builds the standard menu minus both `close_window` items, keeping Tauri's well-known Window/Help submenu ids so `init_app_menu` still hands them to AppKit. Control is deliberately excluded as a chord modifier on macOS: Ctrl-W is werase and Ctrl-T transposes, and consuming them in capture phase would starve the PTY. Tests pin each chord through the real window listener, plus the guards a matcher-only test would miss: chords inert in Buzz mode, Ctrl-W still reaching the PTY, and no repeat close on an already-closing tab. Six mutants (dispatch removed, owner gate dropped, closing guard dropped, Control accepted, closing-skip dropped, direction swapped) each fail at least one test; the direction pair needs three sessions, since with two tabs previous and next resolve to the same id. Co-authored-by: npub17jjz49l9jjmhhk7cac63j8yt9z555n9cw8vk7v5jz4vzw4ppld5qgj57cc <f4a42a97e594b77bdbd8ee35191c8b28a94a4cb871d96f32921558275421fb68@buzz.block.builderlab.xyz> Signed-off-by: npub17jjz49l9jjmhhk7cac63j8yt9z555n9cw8vk7v5jz4vzw4ppld5qgj57cc <f4a42a97e594b77bdbd8ee35191c8b28a94a4cb871d96f32921558275421fb68@buzz.block.builderlab.xyz>
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