Skip to content

Add a readable view to the version compare - #62

Merged
bonelifer merged 1 commit into
mainfrom
readable-compare
Oct 14, 2026
Merged

bonelifer merged 1 commit into
mainfrom
readable-compare

Conversation

@bonelifer

Copy link
Copy Markdown
Contributor

The compare page showed raw BBCode, which is hard to follow for editors who don't read BBCode (the TODO's "Readable version compare"). It now opens in a Readable view, and Source keeps the old BBCode diff.

Readable view (new wiki/readable_diff.php)

  • Both versions are rendered as the article page shows them, then split into blocks: each line of text, heading, quote, code box, list item and table row. The blocks are compared with phpBB's own diff engine.
  • Unchanged parts keep their formatting. Added parts are green and underlined, and removed parts are red and struck through.
  • A line, heading or list item whose words changed shows which words. A table row is compared cell by cell.
  • A part whose formatting alone changed is outlined, and the source view shows how. A part with an image is shown whole rather than as words.
  • Template: pages are compared as written (Source only), since their text doesn't make sense rendered on its own.

Fixes in the compare page

  • Comparing now needs u_wiki_versions, like the version history. Before, anyone could open ?action=compare&from=…&to=… for any version IDs, including versions waiting for approval. Both versions must also belong to the article in the address.
  • A changed description could be hidden, because the description diff used the sources' "no changes" flag.
  • NO_VERSIONS_SELECTED had no text and showed as the raw key. It now reads "Choose two versions of this article to compare."

Also

  • 8 unit tests for the readable diff: changed words, an added heading, lists, table cells, formatting-only changes, images, escaping and Unicode, and empty versions.
  • The README describes both views, and the item is removed from docs/TODO.md.

Claude tested this on a seed-forum board with the wiki fixtures. It covered Main Page versions 1 → 3 (changed words, a removed line with a link, an added image and list) and Busy Article 17 → 46 in the readable view, plus the source view. It also checked that a guest is refused, that mismatched or missing version IDs give the new message, and that the compare page still links to approving and rejecting versions.


Investigated and written by Claude on behalf of William Jacoby (bonelifer).

🤖 Generated with Claude Code

The compare page opens in a Readable view: both versions rendered, split
into lines, headings, list items and table rows, and compared with
phpBB's diff engine. Unchanged parts keep their formatting, added and
removed parts are marked whole, a part whose words changed shows which
ones, and a part whose formatting alone changed is outlined. Parts with
an image are shown whole. Source keeps the BBCode diff; Template: pages
use it only.

Also: comparing now needs u_wiki_versions, like the version history, and
both versions must belong to the article in the address; the description
diff no longer hides behind the sources' diff; and NO_VERSIONS_SELECTED
has its text.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@bonelifer
bonelifer merged commit d6f9349 into main Oct 14, 2026
58 checks passed
@bonelifer
bonelifer deleted the readable-compare branch October 14, 2026 17:18
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