Files
buzz/desktop
Hayt a86e5fb527 feat(desktop): auto-reload stale renderer when the user is away
Long-lived renderer sessions accumulate heap and timer churn until GC
pauses queue behind input, degrading scroll and click latency. The Cmd+R
clean-teardown reload clears it without touching the native engine or its
child agents, but relies on the user noticing and acting.

Add an idle backstop that performs the same reload automatically once a
session is ~12h old and the user is provably away (OS idle >= 30 min and
the window unfocused). It withholds the reload while any reload-destroyed
volatile work is outstanding: a starting/active huddle, a foreground or
background media upload including its completion settling window, queued
local file attachments a draft cannot serialize, or any in-flight
send/mutation/native operation. Persisted draft text survives via
localStorage, so it is deliberately not a blocker.

The reload primitive is one idempotent requestRendererReload() shared by
Cmd+R and the backstop: a module-level in-flight promise collapses
overlapping triggers so the native WebSocket teardown never runs twice,
teardown is bounded to 500 ms, and a rejecting or hung teardown is
swallowed so the reload always runs -- a rejection can no longer win the
race and strand the renderer on a stale heap.

All fire/withhold logic is a pure, exhaustively tested predicate; the hook
only wires live signals, arms after the session-age threshold, and
serializes overlapping checks. Signals are read imperatively at check time
(once a minute) so the hook holds no reactive subscription and never
re-renders. The controller mounts inside the ready main-window shell only,
guarded so Huddle companion windows and every onboarding/blocking/reset/
keyring/relaunch screen are ineligible by construction.

Outstanding volatile work is tracked through one app-global registry
(volatileWorkRegistry) that owns acquire/release; the native multi-file
picker seam registers at the choke point via withVolatileWork so every
caller is covered by construction. The deferred paperclip path is
deliberately left unregistered: useFilePicker's hidden input has no cancel
signal, so acquiring on open risks a hold that never releases.

Co-authored-by: Will Pfleger <pfleger.will@gmail.com>
Signed-off-by: Will Pfleger <pfleger.will@gmail.com>
2026-08-12 00:27:48 -04:00
..
2026-08-03 21:51:17 -04: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