Feature custom properties cayw endpoint#15128
Conversation
Review Summary by QodoAdd citation properties support to CAYW endpoint with custom popup UI
WalkthroughsDescription• Added citation properties (locator, prefix, suffix, omit author) to CAYW endpoint • Implemented popup UI for users to set custom citation properties on selected entries • Updated all formatters (Pandoc, BibLaTeX, Natbib, Typst, MMD, SimpleJson) to include properties in output • Added comprehensive unit tests for citation properties and formatter behavior Diagramflowchart LR
A["User selects entry in CAYW"] --> B["Click entry chip"]
B --> C["CitationPropertiesPopup appears"]
C --> D["Set locator, prefix, suffix, omit author"]
D --> E["Properties saved to CitationProperties"]
E --> F["Formatters apply properties"]
F --> G["Output includes custom properties"]
File Changes1. jabsrv/src/main/java/org/jabref/http/server/cayw/gui/CitationProperties.java
|
|
I did my best to add unit tests to the new citation properties and formmaters, and I tried to read some documents related to unit tests and in the codebase in general |
Code Review by Qodo
1.
|
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
…rmattersTest.java Co-authored-by: Subhramit Basu <subhramit.bb@live.in>
This comment has been minimized.
This comment has been minimized.
✅ All tests passed ✅🏷️ Commit: 36a8ce6 Learn more about TestLens at testlens.app. |
* include additional citation properties * Add support for citation properties in the CAYW endpoint * include CitationProperties for improved citation handling * support citation properties and multicite formatting * enhance citation formatting * handle citation properties * utilize CitationProperties for enhanced output * include citation properties in JSON output * streamline citation formatting using CitationProperties * add citation properties for enhanced citation handling * manage citation attributes and formatting * managing citation properties in the GUI * LocatorType enum for citation types in GUI * click event to show citation properties popup * unit tests for to validate locator formatting and property handling * Add unit tests for formatters with CitationProperties * move data classes out of gui package to fix jbang build * Retrigger CI * fix submodules * add new source files to jbang build configuration * localize strings * follow Zotero BibLaTeX rules for suppress author starred variant * follow MMD documentation for citation formatting * updating to match the new formatter * Improve readability of CAYW formatters * Prevent multiple popups stacking on repeated chip clicks * simplify getSuffix to match getPrefix behavior * Fix submodules * remove trailing whitespace * add missing localization keys for citation properties * Fix submodules * Fix submodules * move add 13821 to the unreleased section * removed MMD_BRACKET_SEPARATOR constant * use nested test classes for better organization, and improved setup with @beforeeach * renamed variables to enhance readability: 'anyHasProperties' to 'hasAnyProperties' updated conditional checks to use Optional for better null safety in MMDFormatter * replace setter methods with 'with' methods for readability * replace setter methods with 'with' methods in for improved readability * use wither pattern with setters * Update jabsrv/src/main/java/org/jabref/http/server/cayw/format/PandocFormatter.java Co-authored-by: Philip <37398281+palukku@users.noreply.github.com> * Update jabsrv/src/main/java/org/jabref/http/server/cayw/format/NatbibFormatter.java Co-authored-by: Philip <37398281+palukku@users.noreply.github.com> * Update jabsrv/src/main/java/org/jabref/http/server/cayw/format/MMDFormatter.java Co-authored-by: Philip <37398281+palukku@users.noreply.github.com> * Use setters in instead of withers * use right format in PandocFormatter * improvements to the optionals and methods * Fix the Format test issue * fix syntax of Pandoc tests * Update jabsrv/src/test/java/org/jabref/http/server/cayw/format/CAYWFormattersTest.java Co-authored-by: Subhramit Basu <subhramit.bb@live.in> --------- Co-authored-by: Philip <37398281+palukku@users.noreply.github.com> Co-authored-by: Subhramit Basu <subhramit.bb@live.in>
* include additional citation properties * Add support for citation properties in the CAYW endpoint * include CitationProperties for improved citation handling * support citation properties and multicite formatting * enhance citation formatting * handle citation properties * utilize CitationProperties for enhanced output * include citation properties in JSON output * streamline citation formatting using CitationProperties * add citation properties for enhanced citation handling * manage citation attributes and formatting * managing citation properties in the GUI * LocatorType enum for citation types in GUI * click event to show citation properties popup * unit tests for to validate locator formatting and property handling * Add unit tests for formatters with CitationProperties * move data classes out of gui package to fix jbang build * Retrigger CI * fix submodules * add new source files to jbang build configuration * localize strings * follow Zotero BibLaTeX rules for suppress author starred variant * follow MMD documentation for citation formatting * updating to match the new formatter * Improve readability of CAYW formatters * Prevent multiple popups stacking on repeated chip clicks * simplify getSuffix to match getPrefix behavior * Fix submodules * remove trailing whitespace * add missing localization keys for citation properties * Fix submodules * Fix submodules * move add 13821 to the unreleased section * removed MMD_BRACKET_SEPARATOR constant * use nested test classes for better organization, and improved setup with @beforeeach * renamed variables to enhance readability: 'anyHasProperties' to 'hasAnyProperties' updated conditional checks to use Optional for better null safety in MMDFormatter * replace setter methods with 'with' methods for readability * replace setter methods with 'with' methods in for improved readability * use wither pattern with setters * Update jabsrv/src/main/java/org/jabref/http/server/cayw/format/PandocFormatter.java Co-authored-by: Philip <37398281+palukku@users.noreply.github.com> * Update jabsrv/src/main/java/org/jabref/http/server/cayw/format/NatbibFormatter.java Co-authored-by: Philip <37398281+palukku@users.noreply.github.com> * Update jabsrv/src/main/java/org/jabref/http/server/cayw/format/MMDFormatter.java Co-authored-by: Philip <37398281+palukku@users.noreply.github.com> * Use setters in instead of withers * use right format in PandocFormatter * improvements to the optionals and methods * Fix the Format test issue * fix syntax of Pandoc tests * Update jabsrv/src/test/java/org/jabref/http/server/cayw/format/CAYWFormattersTest.java Co-authored-by: Subhramit Basu <subhramit.bb@live.in> --------- Co-authored-by: Philip <37398281+palukku@users.noreply.github.com> Co-authored-by: Subhramit Basu <subhramit.bb@live.in>
Related issues and pull requests
Closes #13821
PR Description
Added custom citation properties (locator, prefix, suffix, omit author) to the CAYW endpoint,
when users click a selected entry chip, a popup appears allowing them to set properties,
all formatters (Pandoc, BibLaTeX, Natbib, Typst, MMD, SimpleJson) now include these properties in their output.
Steps to test
1- open a library





2- navigate to http://localhost:23119/better-bibtex/cayw in your browser
3- select one or more entries
4- Click on a selected entry chi,then a popup should appear with(Locator type dropdown + value field+ prefix + suffix fields+ Omit Author checkbox)
5-Fill properties
6- click anywhere outside the popup to close and save, then click "Cite"
Checklist
CHANGELOG.mdin a way that can be understood by the average user (if change is visible to the user)