Skip to content

fix(desktop): restore daily stream row heights across remounts - #969

Draft
ocavue wants to merge 5 commits into
masterfrom
fix/daily-stream-virtua-cache
Draft

fix(desktop): restore daily stream row heights across remounts#969
ocavue wants to merge 5 commits into
masterfrom
fix/daily-stream-virtua-cache

Conversation

@ocavue

@ocavue ocavue commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Persist the daily stream's virtua measurement cache across unmounts so back/forward returns land on the same content instead of drifting.

@coderabbitai

coderabbitai Bot commented Jul 27, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: f8871895-ea75-476b-a7d4-e9cbed0371be

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/daily-stream-virtua-cache

Comment @coderabbitai help to get the list of available commands.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 Virtualizer with 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.

Comment on lines +61 to +63
afterEach(async () => {
await cleanup()
})
Comment on lines +21 to +25
const snapshots = new Map<string, DailyStreamSnapshot>()

export function saveDailyStreamSnapshot(root: string, snapshot: DailyStreamSnapshot): void {
snapshots.set(root, snapshot)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants