feat: article version history with abstract/title diff#162
Open
xenacode-art wants to merge 10 commits intom2b3:testfrom
Open
feat: article version history with abstract/title diff#162xenacode-art wants to merge 10 commits intom2b3:testfrom
xenacode-art wants to merge 10 commits intom2b3:testfrom
Conversation
Sync Alphatest with Test
Sync Main with AlphaTest
Sync test with alphatest
Sync main with Alphatest
Sync AlphaTest with Test
Sync Main with Alphatest
change MAX_COMMUNITIES_PER_USER to 40
change MAX_COMMUNITIES_PER_USER to 40
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #159
Adds version tracking for articles so users can see what changed between edits (title and abstract diffs).
Changes
articles/models.pyArticleVersionmodel — storestitle,abstract,versionnumber, andcreated_atfor each editarticles/api.pyupdate_article()now snapshots the current title+abstract intoArticleVersionbefore overwritingGET /articles/{article_id}/versions— returns a list of versions, each with a unified diff for title and abstract(uses Python stdlib
difflib)articles/schemas.pyArticleVersionDiffOutschema withversion,created_at,title_diff: List[str],abstract_diff: List[str]articles/migrations/0034_articleversion.pyArticleVersiontableExample response
[ { "version": 1, "created_at": "2026-03-26T10:00:00Z", "title_diff": ["--- ", "+++ ", "@@ -1 +1 @@", "-Old Title", "+New Title"], "abstract_diff": ["--- ", "+++ ", "@@ -1,2 +1,2 @@", "-Old abstract text.", "+Updated abstract text."] } ] Test plan - Edit an article via PUT /articles/{id} and confirm an ArticleVersion row is created - Call GET /articles/{id}/versions and verify the diff output is correct - Confirm articles with no edits return [] - Confirm 404 is returned for unknown article IDs