Skip to content

Add shareable comparison links - #2700

Draft
hweihwang wants to merge 2 commits into
review/collectives-version-comparisonfrom
review/collectives-version-comparison-routing
Draft

Add shareable comparison links#2700
hweihwang wants to merge 2 commits into
review/collectives-version-comparisonfrom
review/collectives-version-comparison-routing

Conversation

@hweihwang

@hweihwang hweihwang commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

A comparison you cannot link to cannot be discussed with others. And a link that silently follows later edits is worse than no link: after the page changes, the same URL shows a different comparison without any warning. This PR pins comparison URLs to exact revision identities, so a shared link always shows what was shared.

What's in this PR

  • compareFrom / compareTo URL parameters pin two exact revisions. The pair survives reload, Back, Forward, copy into another session, and page rename.
  • Namespaced identities (current:<id> / version:<id>). Aliases keep previously shared links resolving.
  • A missing version stays visible in the selector with a Retry action. It is never substituted with a nearby snapshot.
  • Validation rejects non-strings (duplicate query params arrive as arrays), path separators, control characters, over-long values, identical pairs and half-pairs.
  • Ambiguous DAV identities are quarantined individually, not fatal.

Unavailable version: the pinned identity stays visible, an explicit error, Retry bottom right
The pinned identity is never silently replaced. The dialog keeps full height; Retry sits bottom right.

Design notes

  • One history entry per path. Manual open pushes one managed entry, so Back closes and Forward reopens the same pair. Route-driven changes replace it instead of accumulating.
  • Rename canonicalizes only the slug, so shared links survive renames. Unrelated query values and the hash are preserved.

Stack

Depends on: #2699. Base: review/collectives-version-comparison, retargets to main once #2699 merges. Final unit of six.

Verification

lint (tsc + eslint) passes; unit suite 46/46, covering identity resolution, aliases, quarantine and every rejected input class. The route matrix (link copy, reload, Back, Forward, rename, malformed parameters) is covered by the live suite in the recorded runs (NC35 28/28, NC34 28/28). Missing IDs are never substituted. A fresh live pass with Viewer 33dc36ba is due before this leaves draft.

Related

Happy to answer any questions in review.

Namespace current and historical canonical identities, retain rollover aliases, quarantine genuine duplicates, and preserve unrelated route state.

Assisted-by: Codex:gpt-5.6-sol
Signed-off-by: Hoang Pham <hoangmaths96@gmail.com>
Restore comparison pairs from URLs, keep history and slug updates scoped, report invalid or unavailable identities, and copy only successful pinned links.

Assisted-by: Codex:gpt-5.6-sol
Signed-off-by: Hoang Pham <hoangmaths96@gmail.com>
@hweihwang
hweihwang force-pushed the review/collectives-version-comparison-routing branch from a964840 to 2c826e0 Compare August 17, 2026 15:27
@benjaminfrueh
benjaminfrueh self-requested a review August 18, 2026 07:55
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.

1 participant