Skip to content

fix: add permalinkRow to RowsSnapshot and related functions for perma…#57

Merged
arv merged 1 commit into
mainfrom
arv/permalink-fixes
Jul 11, 2026
Merged

fix: add permalinkRow to RowsSnapshot and related functions for perma…#57
arv merged 1 commit into
mainfrom
arv/permalink-fixes

Conversation

@arv

@arv arv commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

…link support

Copilot AI review requested due to automatic review settings July 11, 2026 09:43
@arv arv enabled auto-merge July 11, 2026 09:44
@arv arv added this pull request to the merge queue Jul 11, 2026

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

This PR extends the virtualizer’s permalink/deep-link handling by carrying the resolved permalink row through the rows snapshot (so the DOM row can be found via getRowKey even when it differs from the permalink id), and improves scroll-position persistence by flushing state immediately on scrollend (instead of only via debounce).

Changes:

  • Add permalinkRow to RowsSnapshot and populate it during permalink anchoring.
  • Update pending-permalink scrolling to locate the DOM row by getRowKey(permalinkRow) when available.
  • Persist scroll state immediately on scrollend, and add DOM tests covering permalink key mismatch + persist timing.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/solid/create-zero-virtualizer.test.ts Updates helper snapshot shape to include permalinkRow.
src/react/use-zero-virtualizer.test.ts Updates helper snapshot shape to include permalinkRow.
src/core/virtualizer.ts Implements key-based permalink row lookup and immediate persist on scrollend with refactoring into #writeScrollState.
src/core/virtualizer.test.ts Updates helper snapshot shape to include permalinkRow.
src/core/virtualizer.dom.test.ts Adds DOM tests for permalink row key mismatch and immediate persist-on-scrollend behavior.
src/core/rows.ts Extends RowsSnapshot with permalinkRow and wires it up in assembleRows.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/core/virtualizer.ts
Comment on lines +1404 to +1409
#persistNow(): void {
clearTimeout(this.#persistTimer);
this.#persistTimer = undefined;
this.#lastPersistKey = this.#persistKey();
this.#writeScrollState();
}
Merged via the queue into main with commit 859ff61 Jul 11, 2026
10 checks passed
@arv arv deleted the arv/permalink-fixes branch July 11, 2026 09:47
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