fix(desktop): restore daily stream row heights across remounts - #969
fix(desktop): restore daily stream row heights across remounts#969ocavue wants to merge 5 commits into
Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Pull request overview
Adds a small persistence layer around Virtua’s measurement cache so the Daily Stream can restore row heights across unmount/remount, keeping scroll restoration stable when navigating back/forward within the same graph.
Changes:
- Introduces a per-graph-root in-memory snapshot store for Virtua
CacheSnapshot, keyed and validated by the daily window start date. - Seeds
Virtualizerwith the saved cache on first render and saves the latest cache on unmount. - Adds a browser test that exercises the remount/scroll-stability contract with intentionally “tall” rows.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| apps/desktop/src/lib/daily-stream-cache.ts | New in-memory snapshot store for Virtua cache keyed by graph root + window start. |
| apps/desktop/src/components/daily-stream.tsx | Reads snapshot on mount to seed Virtua; saves snapshot on unmount. |
| apps/desktop/src/components/daily-stream.cache.test.tsx | Browser test validating remount preserves “same day at same offset” behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| afterEach(async () => { | ||
| await cleanup() | ||
| }) |
| const snapshots = new Map<string, DailyStreamSnapshot>() | ||
|
|
||
| export function saveDailyStreamSnapshot(root: string, snapshot: DailyStreamSnapshot): void { | ||
| snapshots.set(root, snapshot) | ||
| } |
Persist the daily stream's virtua measurement cache across unmounts so back/forward returns land on the same content instead of drifting.