Files
buzz/desktop
Matt Toohey 600c8b1c17 refactor(desktop): ref the whole mention-wake options object
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>
2026-08-26 21:50:24 +10: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