Skip to content

feat: show abstract/description diff between article versions #159

Description

@DevGajjar28

Problem:
Authors on SciCommons can update their papers after receiving community feedback. However, when an update is made, reviewers and readers have no way to know what changed - they would have to re-read the entire paper to find differences. This creates friction for reviewers who have already invested time in evaluating a previous version and discourages authors from updating their work transparently.

Proposed solution
Add a "What changed" section to the article detail page that appears when an article has more than one version. It shows a plain-text diff of the abstract and description between the current and previous version highlighting additions in green and removals in red, similar to how GitHub shows file diffs.

Implementation plan

Use Python's built-in difflib to compute the diff no extra dependency needed
If version history is not tracked yet, add django-simple-history to the Article model to automatically store snapshots on every save
New endpoint: GET /api/articles/{id}/diff?from_version=1&to_version=2
New frontend component: collapsible diff card shown below article metadata, only visible when multiple versions exist

Who benefits

Reviewers - instantly see if their feedback was addressed without re-reading the paper
Authors - get transparency and accountability for their updates
Community managers - can track how papers evolve over time after discussion

Note: This covers abstract and description fields only. Full PDF diff is out of scope for now.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions