mirror of
https://github.com/block/buzz.git
synced 2026-12-01 05:32:24 +00:00
useMentionWakePreflight destructured its ten options into locals and then reassembled them into an identical object twice — once as the useRef initializer, once as the per-render assignment. Both were hand-maintained mirrors of the parameter list: adding an option without updating them silently froze that field at its mount-time value, with no type error. Keep the options object as the parameter and ref it directly (contextRef -> optionsRef). There is no field list left to maintain — a new option is automatically fresh in optionsRef.current, so drift is impossible by construction. The hook also stops allocating a second context object per render on top of the caller's literal. The invalidation effect still destructures the subset it depends on, but that list is not a mirror: it is the deliberately narrower set of "which prop changes re-arm the preflight", excluding getManagedAgentsByPubkey and startManagedAgent as the existing biome-ignore documents. useEffectEvent would delete the ref entirely, but prepareMentionWake escapes the hook into MessageComposer's keystroke path, which violates its "call only from inside Effects" contract. The latest-ref pattern stays; it just no longer needs a hand-copied field list. The public parameter type is unchanged, so the call site and every existing test compile and pass untouched. Signed-off-by: Matt Toohey <contact@matttoohey.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