mirror of
https://github.com/block/buzz.git
synced 2026-08-18 06:50:31 +02:00
As messages stream in, new author pubkeys join the users-batch query's
pubkey set and the queryKey ("users-batch", ...pubkeys) changes. React
Query treats the new key as a brand-new query and drops `data` to
undefined for a frame before the new batch resolves.
That single undefined frame is the root of both regressions tho saw on
first-load:
(a) Content-bust: the consumer collapses the profile lookup to {} when
data is undefined, so already-resolved rows revert to truncated
pubkeys and drop their avatars mid-stream.
(b) Gaping empty space: the near-empty rebuild hands MessageTimeline a
new messages reference, churning the virtualizer's measurement
cache and scrollMargin so older rows pop in one at a time above a
hole.
Adding placeholderData: keepPreviousData (v5 function form) retains the
previously resolved batch through the key transition, so settled rows
stay settled while the new batch fetches in the background. Verified
empirically against the installed query-core v5.100.14: the immediate
frame after a new author arrives keeps the prior profiles instead of
going undefined.
Co-authored-by: Taylor Ho <taylorkmho@gmail.com>
Signed-off-by: Taylor Ho <taylorkmho@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