Skip to content

Show differences (added/removed/changed text) when checking past versions #599

Closed

Description

@mgc8

Is your feature request related to a problem? Please describe.
Right now, it's possible to view older versions of a page and revert to them; however, it's impossible to see what is different in those versions compared to each other or to the latest (current) version.

Describe the solution you'd like
There should be a way to compare any two versions of the file between each-other, as well as any version to the current one. The UI can look like Wordpress, Confluence or any other similar implementation.

Describe alternatives you've considered
A poor kludge exists currently by using the "show author colors" option, but it's not nearly enough and doesn't show subsequent changes by the same author.

Additional context
Any Wiki with versioning system requires this functionality, as it is essential for teams working together on a document (in Word/LibreOffice and similar tools, it's called "Tracked Changes").

Activity

  1. moved this to 🧭 Planning evaluation / ideas in 🖍 Design teamon May 16, 2023
  2. moved this to 🧭 Planning evaluation (don't pick) in 📝 Productivity teamon Jun 29, 2023
  3. max-nextcloud commented on Oct 11, 2023

    @max-nextcloud
    Collaborator

    Working on a first iteration of this in nextcloud/text#4720

  4. marked Diffmode ith highlighting #2152 as a duplicate of this issue on Feb 19, 2026
  5. marked improve versions view #2407 as a duplicate of this issue on Apr 14, 2026
  6. moved this from 🧭 Planning evaluation (don't pick) to 💡 To discuss in 📝 Productivity teamon Jun 26, 2026
  7. moved this from 💡 To discuss to 📄 To do (~10 entries) in 📝 Productivity teamon Jul 6, 2026
  8. moved this from 📄 To do (~10 entries) to 🏗️ In progress in 📝 Productivity teamon Jul 15, 2026
  9. moved this to 👓 Design review in 🖍 Design teamon Aug 13, 2026
  10. hweihwang commented on Aug 14, 2026

    @hweihwang
    Contributor

    Implemented. Collectives can now compare any two page versions, or a version against the current content, and shows exactly what changed: grouped by section, in the original rendered documents, or as literal Markdown source. Comparisons are shareable: a link pins two exact revisions and always shows the same pair, even after the page is edited or renamed.

    The views

    • Changes (default): records grouped under the section heading they happened in, labelled by kind, each with its own before/after preview. A hide-formatting-only filter is available.
    • Full documents: both originals, read-only, highlighted at the reported positions, with paired navigation and independent scrolling. Wide, side-by-side, or Before/After tabs on narrow screens.
    • Markdown source: the literal text for everything a rendered view cannot show (line-ending changes, trailing whitespace, a missing final newline, rewritten link syntax). Runs in a cancellable worker with explicit limits.
    • Shareable links: compareFrom / compareTo pin two exact revisions. The pair survives reload, Back, Forward, copy and rename. A missing version fails explicitly instead of being silently swapped for a neighbour.

    Changes view
    Full documents
    Markdown source
    Image comparison
    Comparison link

    Demo (4K, 24 s): https://raw.githubusercontent.com/hweihwang/collectives/demo-assets/collectives-599/2026-09-final/featured/collectives-compare-versions-4k.mp4

    The six PRs, in dependency order

    # Repo Unit PR Depends on
    1 nextcloud/text semantic change model #9047 -
    2 nextcloud/text Changes view and public factory #9048 #9047
    3 nextcloud/text highlighted Full documents #9049 #9048
    4 nextcloud/text Markdown source view and worker #9050 #9049
    5 nextcloud/collectives pair selection and integration #2699 Text #9050
    6 nextcloud/collectives pinned routes and share links #2700 #2699

    Each PR is one review unit, one commit, on its predecessor's branch, so every diff shows only its own change. Release order: Text 1-4 together, then Collectives 5 and 6.

    Compatibility. Text capability is detected at runtime (a factory function check, not a version pin). Where it is missing, Collectives falls back to the stock Viewer compare() path unchanged, on Nextcloud 34 and wherever the Text factory is absent. On mobile the dialog refuses explicitly instead of showing one pane as a comparison. No Viewer change involved.

    Correctness boundaries
    • Both editors share one ProseMirror schema instance; node types compare by identity. A second schema would give a wrong result, not a slow one.
    • Move detection is conservative: only exact moves are reported, anything ambiguous becomes remove + insert.
    • Attributes and formatting stay separate, so hiding formatting-only changes never hides a changed link target.
    • The semantic model reports a bounded result with an explicit limit, never a silent partial list.
    • Rendered comparison rejects input lines above 20,000 characters; literal source stops at a safe per-line display boundary.
    • The source worker enforces three limits (2,000,000 characters, 50,000 edits, 2,000 ms) and always reports itself as limited.
    • Comparison URLs validate their parameters; a missing version stays in the selector with a Retry action.
    Verification
    • Text: focused Vitest 28/28; production Playwright 71/71 (zero retries/skips); full Vitest 1,760/1,761 (only the unchanged SyncService baseline); type check, lint and build pass (lint reports jsdoc warnings the repo config does not fail on).
    • Collectives: Integrate semantic page comparison #2699 focused Vitest 88/88; final 103/103; mounted Cypress 7/7; semantic Cypress 46/46; semantic Playwright 44/44; Stable32 Viewer fallback 1/1; CI config Vitest 5/5; lint, stylelint and build pass.
    • All six commits are DCO-signed; each PR is one commit over its stacked base.
    Full gallery

    Walkthrough (3:49): https://raw.githubusercontent.com/hweihwang/collectives/demo-assets/collectives-599/2026-09-final/full-gallery/collectives-compare-versions-walkthrough.mp4

  11. moved this from 🏗️ In progress to 👀 In review in 📝 Productivity teamon Aug 20, 2026
  12. mejo- commented on Sep 8, 2026

    @mejo-
    Member

    This is implemented now thanks to the work by @hweihwang ❤️

  13. moved this from 👓 Design review to 🎉 Done in 🖍 Design teamon Sep 8, 2026
  14. moved this from 👀 In review to ☑️ Done in 📝 Productivity teamon Sep 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions