mirror of
https://github.com/block/buzz.git
synced 2026-10-30 22:11:36 +00:00
Scrollback paging felt slow even with a fast relay because a fetched page could sit unpainted for seconds, and one gesture often pulled several pages. useSettleGatedPrependMessages held a landed page on ANY wheel/scroll input with a 4s deadline, and assumed motion at hold start — so even a scroller at rest paid a full quiet window, and a reader keeping fingers on the trackpad waited seconds for a 450ms page. Track motion for the scroller's whole life (lastMotionTsRef) so an at-rest hold admits after the stable-frame count, and cut SETTLE_HOLD_DEADLINE_MS to 1500: trackpad momentum — the only phase with the dropped-write hazard — decays well inside that bound. Retiring the hold directly on wheel was tried and rejected: it drifted the anchor ~30px under live input. loadOlderViaVirtualizer refused to re-fire only while isFetchingOlder or the settle hold was set. Between the fetch resolving and the prepend committing, WebKit's scroll events at the boundary started the next page, cascading one gesture into many. Add isRenderedTimelineBehindHistoryPrepend to the refuse predicate — the same signal the spinner already uses. Tests (each fails on the previous code): - useSettleGatedPrependMessages.test.mjs: at-rest hold admits without a charged quiet window; motion before the hold still charges it. - virtualization 09: commit under 60 wheel bursts is bounded (gapSinceInput < 80ms, sinceSpinner < deadline+slack) and the anchor holds within 5px at commit. - scroll-history "one gesture pages once": emulate WebKit's at-rest scroll events and tighten the ceiling from <=4 pages to <=1. Co-authored-by: Meli <5aaa86bce934fc3445fc254aab560a40923f10252f92107e665073dede0e04d3@buzz.block.builderlab.xyz> Signed-off-by: Meli <5aaa86bce934fc3445fc254aab560a40923f10252f92107e665073dede0e04d3@buzz.block.builderlab.xyz>
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