Skip to content

feat(website): Edit individual accession on revise page using form#6503

Merged
tombch merged 28 commits into
mainfrom
edit-on-revise-page
Jul 8, 2026
Merged

feat(website): Edit individual accession on revise page using form#6503
tombch merged 28 commits into
mainfrom
edit-on-revise-page

Conversation

@tombch

@tombch tombch commented May 27, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Adds a tab to the revise page to 'Revise individual sequence entry using a form'.
  • This displays a search bar, where a user can enter the accession (optionally with version) of the sequence entry they want to revise. Guidance on finding the correct sequence entry from the 'released sequences page' is also provided, in inspiration from feat(website): Add tab on revise page pointing to per-sequence revise button #6504.
  • Once a valid accession (and optional version) is entered, renders the existing EditPage component and form, populating the form with the metadata from the get-data-to-edit endpoint, fetching data for the latest version of the sequence entry unless a specific version was provided.
  • Updates the existing 'Revise sequence' button to redirect to this page with the accession and version filled in.
  • Adds a warning when a user is attempting to revise from a version which is not the latest.
  • Updates the naming of the 'Submit' button in the EditPage - now displays either Submit edits and proceed to Approval or Upload and proceed to Approval depending on whether the user is editing/revising.

Screenshot

image

Revising from an earlier version:

image

PR Checklist

  • All necessary documentation has been adapted.
  • The implemented feature is covered by appropriate, automated tests.
  • Any manual testing that has been done is documented (i.e. what exactly was tested?)

🚀 Preview: https://edit-on-revise-page.loculus.org

@claude claude Bot added the website Tasks related to the web application label May 27, 2026
@theosanderson

Copy link
Copy Markdown
Member

@theosanderson-agent inspired by this try making a version that has this tab but where this tab just has docs information that tells users that there is a revise button at the bottom of each of their sequences on the sequence details page, and which links to "my sequences" to allow them to browse. Make a separate PR.

@theosanderson-agent

Copy link
Copy Markdown
Collaborator

Opened #6504 as an alternative: same tabbed layout, but the "Revise individual sequence entry using a form" tab just shows a short info panel that points users to the Revise this sequence button under Sequence management on each sequence details page, plus a button linking to My sequences for browsing. No accession lookup or embedded EditPage in that variant.

@anna-parker anna-parker added the preview Triggers a deployment to argocd label Jun 15, 2026
@corneliusroemer corneliusroemer removed the preview Triggers a deployment to argocd label Jun 18, 2026
@theosanderson theosanderson added the preview Triggers a deployment to argocd label Jun 22, 2026
@tombch tombch removed the preview Triggers a deployment to argocd label Jun 29, 2026
@tombch
tombch marked this pull request as ready for review July 1, 2026 14:19
@claude

claude Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Claude finished @tombch's task in 4m 1s —— View job


Code Review

  • Gather context (read changed files, diff against origin/main)
  • Understand the request (code review requested)
  • Review code quality, security, performance, testing, docs
  • Post inline comments for actionable issues
  • Post final summary review

I reviewed the diff (origin/main...HEAD), focusing on the new IndividualRevisionForm, the RevisionForm/DataUploadForm routing changes, and SubmissionRoute.ts. Two inline comments posted:

  • website/src/routes/SubmissionRoute.ts:82accessionVersion is concatenated into the URL without encodeURIComponent, which can break the query string or allow parameter injection if it contains reserved characters.
  • website/src/components/Submission/RevisionForm.tsx:42 — the action === 'revise' + inputMode === 'form' branch in DataUploadForm/FormOrUploadWrapper is now unreachable dead code, since RevisionForm always routes 'form' to the new IndividualRevisionForm.

General observations

  • Authorization: Confirmed the backend's get-data-to-edit endpoint already rejects accessions that don't belong to the caller's group (GetDataToEditEndpointTest.kt), so letting users type an arbitrary accessionVersion client-side isn't a new security hole — the group check happens server-side and the form surfaces the resulting error correctly.
  • URL state syncing: window.history.replaceState usage in IndividualRevisionForm follows the same pattern used elsewhere in the codebase (e.g. useStateSyncedWithUrlQueryParams.ts), so this is consistent.
  • Component reset on new search: Keying EditPage on `${data.accession}.${data.version}` is a nice touch — it correctly remounts the form state instead of leaking edits between different searched sequences.
  • Testing: No automated tests were added for the new IndividualRevisionForm component (the parsing of accessionVersion input, and the distinction between a parse error vs. a backend/API error). The PR description already flags this itself ("heavily clauded ... would need some work"). Given this component has non-trivial logic (input parsing, URL syncing, conditional rendering of EditPage), some basic tests (e.g. valid/invalid accession input, API error rendering) would be valuable before merging.
  • Everything else (routing changes in revise.astro/submit.astro, routes.ts, EditPage.tsx button/label changes, SequenceDataUI.tsx) looked correct and consistent with existing conventions.

Note: I was unable to run npm run check-types / CI=1 npm run test in this sandbox (commands required approval that wasn't available), so please make sure those pass per the website AGENTS.md checklist before merging.

Comment thread website/src/routes/SubmissionRoute.ts Outdated
Comment thread website/src/components/Submission/RevisionForm.tsx
Comment thread website/src/routes/SubmissionRoute.ts Outdated
Comment thread website/src/components/Submission/RevisionForm.tsx
@theosanderson theosanderson added the preview Triggers a deployment to argocd label Jul 1, 2026
Comment thread website/src/components/Submission/IndividualRevisionForm.tsx Outdated
…n same layout as other pages, and include warning on non-latest version
Comment thread website/src/pages/[organism]/submission/[groupId]/submit.astro
@anna-parker

anna-parker commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

When I try searching for an accession that does not exist the spinner keeps spinning for a long period and I see that the page is doing a lot of network calls with errors (probably still trying to find the accession):

Screen.Recording.2026-07-06.at.09.34.53.mov

I find this a bit odd

Comment thread website/src/components/Submission/IndividualRevisionForm.tsx Outdated
@tombch tombch added preview Triggers a deployment to argocd and removed preview Triggers a deployment to argocd labels Jul 6, 2026
Comment thread integration-tests/tests/specs/features/revise-sequence.spec.ts

@anna-parker anna-parker left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

amazing! I just tested this out and it feels really smooth!

Comment thread website/src/components/Submission/IndividualRevisionForm.tsx
@tombch
tombch merged commit f7a7028 into main Jul 8, 2026
49 checks passed
@tombch
tombch deleted the edit-on-revise-page branch July 8, 2026 17:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

preview Triggers a deployment to argocd website Tasks related to the web application

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants