Repository navigation
feat(citation): add a Copy Citation format override - #997
Open
thostetler wants to merge 11 commits into
Open
thostetler wants to merge 11 commits into
thostetler wants to merge 11 commits into
Conversation
Reuses the unread defaultCitationFormat key with a copy: marker, so the three ways it was written on live accounts all read as linked. An override naming a format the manifest no longer offers relinks to the export format.
An opt-in checkbox under Default Format reveals a separate selector, initialised to the export format so opting in does not change what gets copied. Checked state comes from the stored marker, never from comparing the two formats.
Reset to defaults on the Default Format tab now clears the override. The default for the field becomes empty rather than a bare format id, which reset would otherwise stamp into accounts as a fresh ambiguous value.
Chakra forwards unknown props to the wrapper label, so the disclosure state goes through inputProps to reach the native input.
Gives the stub in-memory user data so a save can be read back, and asserts the stored marker directly rather than only the rendered state. STUB_PORT lets the stub run when 18080 is already taken.
A hardcoded gray.200 made the disclosure rule the brightest element on a dark page.
Three cases asserted through resolution could not fail, because an empty id and a missing marker both fall through to the same linked result. Asserting them on decodeCopyCitationOverride gives them teeth.
useCitationFormat is the shared resolver for copying and exporting, so putting the override inside it also redirected the Export Citation link, both Other Formats menus and the export page fallback. The hook now resolves the two separately and only copy surfaces read the override. The override is also restricted to the formats the quick-copy modal offers, which drops custom: picking a custom template reorders customFormats, so a copy:custom override silently changed template whenever the export template did.
Uses the existing onCopyComplete callback, which only fires on a resolved write, so a refused copy leaves the modal open with its failure notice visible.
…onfirm on Closing the modal on a successful copy took the inline confirmation with it, since the label and the close fire in the same render. The toast names the format the reader selected rather than their default, and matches the split button's wording.
Contributor
Bundle sizeShared by all pages: 643.6 kB (-0.0 kB) ⚪
First load = polyfills + shared |
thostetler
marked this pull request as ready for review
December 3, 2026 04:57
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #997 +/- ##
========================================
+ Coverage 58.3% 58.7% +0.5%
========================================
Files 407 408 +1
Lines 12768 12822 +54
Branches 2863 2875 +12
========================================
+ Hits 7434 7520 +86
+ Misses 4648 4612 -36
- Partials 686 690 +4
🚀 New features to boost your workflow:
|
…tion-format-override
This branch has not been deployed
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.
Copy Citation on the abstract page now follows its own format when the Export Settings checkbox under Default Format is turned on, instead of always matching the Default Export Format.