feat(website): show SeqSet citation formats on the page instead of in a modal - #7038
Draft
corneliusroemer wants to merge 1 commit into
Draft
feat(website): show SeqSet citation formats on the page instead of in a modal#7038corneliusroemer wants to merge 1 commit into
corneliusroemer wants to merge 1 commit into
Conversation
… a modal
The APA / MLA / BibTeX citations for a SeqSet were only reachable by opening
the "Export / Cite" modal, so a visitor landing on e.g.
/seqsets/PP_SS_1915.1 had no way to see how to cite the SeqSet without
knowing to click Export first.
Move the citation formats out of the modal and onto the SeqSet page as a
"How to cite" section with one tab per format (APA by default, then MLA and
BibTeX), placed directly under the Details / Citations grid and above
Statistics. The existing "Citations" section means *cited by*, so the two
are kept visually distinct. The modal keeps the JSON/TSV download only and
its heading and trigger button are renamed from "Export / Cite" to
"Export".
Implementation notes:
- The citation string building is extracted from ExportSeqSet into a pure
citationFormats.ts module with unit tests, mirroring the existing
formatCitationContributors.ts / .spec.ts pattern in this directory.
- The no-DOI fallback URL previously came from window.location.href. That
was only safe because Headless UI does not render closed-dialog children;
an always-rendered citation box would hit `window` during the SSR pass of
the client:load island. The canonical absolute URL is now computed in
[seqSetId].[version].astro and passed in as a prop, which also means the
citation always points at the versioned page even when the visitor
arrived via the unversioned redirect.
- Tabs reuse the existing BoxWithTabs components, whose Button is already
gated on hydration, so no new Playwright race is introduced.
- The seqset page object asserts the citation formats are visible on the
page and that switching to the BibTeX tab works. Its existing
`getByRole('button', { name: 'Export' })` lookups still match the renamed
button, and no on-page control uses "Download" or "Export" in its
accessible name, so `closeModal()`'s hidden-Download assertion is
unaffected.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
Claude-generated PR - not much thought has gone into this but it's a quick proof of concept to see if we like this direction.
Screenshots
The APA / MLA / BibTeX citations for a SeqSet were only reachable by opening
the "Export / Cite" modal, so a visitor landing on e.g.
/seqsets/PP_SS_1915.1 had no way to see how to cite the SeqSet without
knowing to click Export first.
Move the citation formats out of the modal and onto the SeqSet page as a
"How to cite" section with one tab per format (APA by default, then MLA and
BibTeX), placed directly under the Details / Citations grid and above
Statistics. The existing "Citations" section means cited by, so the two
are kept visually distinct. The modal keeps the JSON/TSV download only and
its heading and trigger button are renamed from "Export / Cite" to
"Export".
Implementation notes:
citationFormats.ts module with unit tests, mirroring the existing
formatCitationContributors.ts / .spec.ts pattern in this directory.
was only safe because Headless UI does not render closed-dialog children;
an always-rendered citation box would hit
windowduring the SSR pass ofthe client:load island. The canonical absolute URL is now computed in
[seqSetId].[version].astro and passed in as a prop, which also means the
citation always points at the versioned page even when the visitor
arrived via the unversioned redirect.
gated on hydration, so no new Playwright race is introduced.
page and that switching to the BibTeX tab works. Its existing
getByRole('button', { name: 'Export' })lookups still match the renamedbutton, and no on-page control uses "Download" or "Export" in its
accessible name, so
closeModal()'s hidden-Download assertion isunaffected.
Co-Authored-By: Claude Opus 5 (1M context) noreply@anthropic.com
PR Checklist
🚀 Preview: https://feat-seqset-citation-tabs.loculus.org