mirror of
https://github.com/block/buzz.git
synced 2026-08-18 06:50:31 +02:00
The three nav-beachball view transitions were dominated by main-thread first-render work on mount, not chunk-load or data-stall. Each surface had redundant or eagerly-executed work removable without deferral: - Channel: buildVideoReviewCommentsByRootId walked the full message list twice per mount (ChannelPane + TimelineMessageList), O(N^2) in the ancestor walk and unconditional even in channels with no video. TimelineMessageList now gates the whole-map build behind messages.some(hasVideoAttachment); ChannelPane builds a single root's comments on demand. resolvedAgentPubkeys and channelNames were rebuilt per visible row (identical across rows) — hoisted to the list, memoized for stable refs, and added to MessageRow's memo comparator so the hoist doesn't defeat its memoization. - Inbox: InboxMessageRow re-parsed markdown on every HomeView re-render. Wrapped in React.memo with a field-level comparator — its callbacks are recreated inline by HomeView, so a reference comparator would be inert; it compares the render-affecting message fields instead. - Agents: 14 invisible dialogs mounted unconditionally, executing their queries and hooks while closed. Conditionally rendered on each dialog's own open-state, removing closed-dialog work from the mount path. Each dialog mounts already-open; Radix drives its enter transition off data-state on first commit (covered by a tracked behavioral test). - Closed the AgentsView double-lazy preload gap: preloadAgentsScreen now warms the inner AgentsView chunk too, so the first agents navigation doesn't hit a cold chunk. The dynamic import keeps AgentsView its own chunk rather than collapsing it into the index bundle. Measured before/after (median of 3 runs, 4x CPU throttle): script duration dropped on every surface (channel first -63ms, channel switch -60ms, inbox -23ms, agents -32ms). Co-authored-by: Will Pfleger <pfleger.will@gmail.com> Signed-off-by: Will Pfleger <pfleger.will@gmail.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