Files
buzz/desktop
Matt Toohey 409c0c6b26 perf(desktop): skip re-persisting identical agent prefill snapshots
While a composer sits in prefill state, every identity change of
restoreAddressedAgentMentions (it depends on profiles and
audience.pubkeys) re-runs the restore effect, and
applyRestoredAgentMentions re-persisted the prefill unconditionally.
saveDraftEntry has no same-content short-circuit, so each run cost a
localStorage flush plus a notifySubscribers() broadcast with a fresh
updatedAt, re-rendering Inbox count subscribers for no state change.

persistAgentPrefill now loads the stored record first and returns
without writing when the incoming snapshot is identical: same content,
same channelId, an already-agent-prefill classification, matching
mention refs, and no pending attachments or spoilered URLs (a stored
agent-prefill record always has neither, so any live attachment state
disqualifies the skip and the write proceeds).

Bound by a unit test on the production hook: persisting an identical
prefill snapshot twice notifies zero subscribers and leaves updatedAt
untouched, while a genuinely changed snapshot (grown audience) still
writes, notifies once, and keeps the agent-prefill classification.
Falsified against the disabled skip (fails 2 !== 0 notifications).

Verified: the touched unit test file (22 passing) and the
persistent-agent-audience Playwright suite (37 passing; one
load-flake passed in isolation and on full-suite rerun).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: Matt Toohey <contact@matttoohey.com>
2026-09-04 15:35:21 +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