Skip to content

Add shareable comparison links - #2698

Closed
hweihwang wants to merge 4 commits into
nextcloud:mainfrom
hweihwang:review/collectives-version-comparison-routing
Closed

hweihwang wants to merge 4 commits into
nextcloud:mainfrom
hweihwang:review/collectives-version-comparison-routing

Conversation

@hweihwang

@hweihwang hweihwang commented Aug 14, 2026 •

Copy link
Copy Markdown
Contributor

In one sentence: shareable URLs that pin two exact revisions and never silently change.

What and why

A comparison you can't link to can't be discussed — and a link that silently follows later edits shows a different comparison under the same URL. This PR pins comparisons to exact revision identities.

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: #2697. Final unit of six. Opened stacked on C1 — the diff narrows once #2697 merges; I'll rebase before review.

Verification

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

AI assistance

Commits carry Assisted-by: Codex:gpt-5.6-sol; an independent review pass was run with Claude Opus 5. Description drafted with Hermes (deepseek-v4-pro) from my notes, then reviewed by me.

Related

Normalize version chronology, quarantine invalid selector identities, load both snapshots atomically, and cache only immutable successful historical content.

Assisted-by: Codex:gpt-5.6-sol
Signed-off-by: Hoang Pham <hoangmaths96@gmail.com>
Expose comparison actions, preserve the desktop Viewer fallback, reject mobile one-pane fallback, and mount the Text comparison only after both snapshots load.

Assisted-by: Codex:gpt-5.6-sol
Signed-off-by: Hoang Pham <hoangmaths96@gmail.com>
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 requested review from max-nextcloud and mejo- and removed request for max-nextcloud August 14, 2026 16:36
@hweihwang hweihwang closed this Aug 14, 2026
@hweihwang
hweihwang deleted the review/collectives-version-comparison-routing branch August 14, 2026 17:12
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