Version history: compare versions, revert through the pipeline, log filters #98

Merged
anas merged 1 commits from feature/version-history into main 2026-10-09 22:43:16 +00:00
Owner

Part of #51 (version history like a wiki).

  • Compare any two versions of a work, a book/section's arrangement or tags: «موازنہ کریں» with two version pickers on each history page (تاریخچہ), and «فرق» on each published row (that version against the one before). Version 0 is the Wikisource text from before Divan's first version.
  • Bring an old version back («ورژن N واپس لائیں» on the compare page): it puts that text into the moderator's draft (open or new). The draft goes through review and publishing like any other edit, so a revert is also a commit in divan-data. It needs the same permission as editing. The timeline records it as «پرانا ورژن واپس لایا».
  • Moderation log filters (موڈریشن › ریکارڈ): by person (email), kind of change (text, arrangement, tags, e-books) and step.
  • The three history pages share one table component (it was copied three times).

API: GET /api/mod/compare/:entity/:id?a=&b=, POST /api/mod/revert/:entity/:id {version}, /api/mod/log?who=&kind=&action=. Tests extended (compare, version 0, permissions, revert draft and events, log filters); all 44 API tests pass. Checked the pages locally with a temporary published version and a revert (302 to the new draft).

Left of #51 for later: history for poets, intros and books, which comes with their editors (#32).

🤖 Generated with Claude Code

Part of #51 (version history like a wiki). - **Compare any two versions** of a work, a book/section's arrangement or tags: «موازنہ کریں» with two version pickers on each history page (تاریخچہ), and «فرق» on each published row (that version against the one before). Version 0 is the Wikisource text from before Divan's first version. - **Bring an old version back** («ورژن N واپس لائیں» on the compare page): it puts that text into the moderator's draft (open or new). The draft goes through review and publishing like any other edit, so a revert is also a commit in divan-data. It needs the same permission as editing. The timeline records it as «پرانا ورژن واپس لایا». - **Moderation log filters** (موڈریشن › ریکارڈ): by person (email), kind of change (text, arrangement, tags, e-books) and step. - The three history pages share one table component (it was copied three times). API: `GET /api/mod/compare/:entity/:id?a=&b=`, `POST /api/mod/revert/:entity/:id {version}`, `/api/mod/log?who=&kind=&action=`. Tests extended (compare, version 0, permissions, revert draft and events, log filters); all 44 API tests pass. Checked the pages locally with a temporary published version and a revert (302 to the new draft). Left of #51 for later: history for poets, intros and books, which comes with their editors (#32). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
anas added 1 commit 2026-10-09 22:42:28 +00:00
anas merged commit 650b684ae8 into main 2026-10-09 22:43:16 +00:00
Sign in to join this conversation.
No reviewers
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: anas/divan#98
No description provided.