Skip to content

feat(website): display version comment on review cards for revocations#6395

Draft
theosanderson-agent wants to merge 1 commit into
mainfrom
feat/website-display-version-comment-on-review-cards
Draft

feat(website): display version comment on review cards for revocations#6395
theosanderson-agent wants to merge 1 commit into
mainfrom
feat/website-display-version-comment-on-review-cards

Conversation

@theosanderson-agent
Copy link
Copy Markdown
Collaborator

@theosanderson-agent theosanderson-agent commented May 11, 2026

Summary

image

Fixes #6394 (and addresses #4522).

Previously, when reviewing a revocation entry on the review page, there was no way to see the version comment the submitter entered when creating the revocation. The card only showed a generic message: "This is a revocation entry, which will create a new version that revokes this accession". This made it impossible to double-check the revocation reason before approving the entry.

This PR surfaces the version comment alongside the existing revocation marker on the review card.

Changes

Backend

Website

  • Add versionComment to the sequenceEntryStatus zod schema.
  • Render a Version comment KeyValueComponent on the review card whenever the entry is a revocation and a comment was provided.
  • Add a Vitest case asserting the comment is rendered for revocation entries.

Design notes

  • The existing /get-data-to-edit endpoint (used by useGetMetadataAndAnnotations to populate the review card's metadata) explicitly errors for revocations, so it was not appropriate to repurpose. Returning the comment on the list response means no extra HTTP round-trip per card.
  • For non-revocation revisions, versionComment is already part of the processed metadata and rendered via the existing MetadataList. The new card field is gated on isRevocation to avoid showing it twice.

Test plan

  • Manual check: submit a revocation with a version comment, open the review page, confirm the comment is shown on the card.
  • Manual check: submit a revocation without a comment — no "Version comment" row appears (only the existing revocation marker).
  • Manual check: revisions still show their versionComment via the normal metadata list (unchanged behavior).
  • CI=1 npm run test (website) — 646 tests passing including new should show the version comment for revocation entries case.
  • CI=1 npm run check-types (website) — clean.
  • npm run format (website) — clean.
  • ./gradlew compileKotlin && ./gradlew ktlintFormat (backend) — clean.
  • Backend integration tests — could not run locally (test infra needs Docker/postgres setup); rely on CI.

🤖 Generated with Claude Code

🚀 Preview: Add preview label to enable

When submitting a revocation the submitter can supply a version comment
(the reason for revocation), but the review page had no way to see it
before approving the entry. The card showed only a generic "This is a
revocation entry..." message, which made it impossible to double-check
the comment before releasing.

Surface the version comment alongside the revocation marker on the
review card. To make the data available without an extra fetch (the
existing `/get-data-to-edit` endpoint explicitly errors for revocations
and is not appropriate to repurpose for read-only display), expose the
comment on the list response:

- Add `versionComment: String?` to `SequenceEntryStatus`.
- In `getSequences`, extract the value from
  `unprocessed_data.metadata.versionComment` using a JSONB scalar path.
- Update the website's zod schema and render a `Version comment`
  KeyValueComponent on the review card for revocations with a comment.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@claude claude Bot added website Tasks related to the web application backend related to the loculus backend component labels May 11, 2026
@theosanderson theosanderson added the preview Triggers a deployment to argocd label May 12, 2026
@theosanderson
Copy link
Copy Markdown
Member

Details > The existing /get-data-to-edit endpoint (used by useGetMetadataAndAnnotations to populate the review card's metadata) explicitly errors for revocations, so it was not appropriate to repurpose. Returning the comment on the list response means no extra HTTP round-trip per card.

@theosanderson-agent Try making an alternative PR which: renames this endpoint to /get-original-data-for-entry and makes it not error for revocations and uses that instead

@theosanderson-agent
Copy link
Copy Markdown
Collaborator Author

Opened #6412 as the alternative you suggested: /get-data-to-edit/{accession}/{version} is renamed to /get-original-data-for-entry/{accession}/{version}, the endpoint no longer throws 422 for revocations, and the review card now reads versionComment from originalData.metadata instead of a new field on /get-sequences. SequenceEntryVersionToEdit.processedData becomes nullable (null for revocations) and isRevocation is added to the response. CLI / integration auth test / website client all updated to the new path.

Happy to close this PR in favour of #6412 if that approach looks right.

@anna-parker anna-parker removed the preview Triggers a deployment to argocd label May 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend related to the loculus backend component website Tasks related to the web application

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Display version comment on review cards

3 participants