Added "DOI" and URL to entry preview [#14193]#15121
Conversation
|
Hey @cursedesigner! 👋 Thank you for contributing to JabRef! We have automated checks in place, based on which you will soon get feedback if any of them are failing. We also use Qodo for review assistance. It will update your pull request description with a review help and offer suggestions to improve the pull request. After all automated checks pass, a maintainer will also review your contribution. Once that happens, you can go through their comments in the "Files changed" tab and act on them, or reply to the conversation if you have further inputs. You can read about the whole pull request process in our contribution guide. Please ensure that your pull request is in line with our AI Usage Policy and make necessary disclosures. |
Review Summary by QodoAdd DOI field to default entry preview style
WalkthroughsDescription• Added DOI field display to default entry preview style • Implemented migration to inject DOI section into existing preview layouts • Added test coverage for preview style migration with DOI field • Updated changelog with feature documentation Diagramflowchart LR
A["Default Preview Style"] -->|Add DOI section| B["Updated Preview Template"]
C["Existing Preview Layouts"] -->|Migration: inject DOI| D["Migrated Layouts with DOI"]
B -->|Applied to| E["Entry Preview Display"]
D -->|Applied to| E
File Changes1. jabgui/src/main/java/org/jabref/gui/preferences/JabRefGuiPreferences.java
|
Code Review by Qodo🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)
Great, no issues found!Qodo reviewed your code and found no material issues that require reviewⓘ The new review experience is currently in Beta. Learn more |
|
looks good already on a first look |
✅ All tests passed ✅🏷️ Commit: bd6d43b Learn more about TestLens at testlens.app. |
|
I will try to look into it tomorrow |
You could dig into with |
Review Summary by QodoAdd DOI field to default entry preview style
WalkthroughsDescription• Add DOI field display to default entry preview style • Implement automatic migration for existing custom preview styles • Include DOI formatting with clickable link to doi.org • Add comprehensive test coverage for preview style migration Diagramflowchart LR
A["Default Preview Style"] -->|Add DOI section| B["Updated Preview with DOI"]
C["Custom Preview Styles"] -->|Migration Logic| D["Migrated with DOI"]
B -->|Display in UI| E["Entry Preview"]
D -->|Display in UI| E
File Changes1. jabgui/src/main/java/org/jabref/gui/preferences/JabRefGuiPreferences.java
|
|
Persistent review updated to latest commit 2baa92b |
Review Summary by QodoAdd DOI and URL fields to entry preview with migration support
WalkthroughsDescription• Added DOI and URL fields to default entry preview layout • Implemented automatic migration for existing custom preview styles • Added test coverage for preview style migration scenarios • Updated CHANGELOG with feature description File Changes1. jabgui/src/main/java/org/jabref/gui/preferences/JabRefGuiPreferences.java
|
|
Persistent review updated to latest commit a30142d |
|
Persistent review updated to latest commit 10f859c |
| "\\begin{doi}<BR>doi <a href=\"https://doi.org/\\format[DOIStrip]{\\doi}\">\\format[DOIStrip]{\\doi}</a>\\end{doi}__NEWLINE__" + | ||
| "\\begin{url}<BR>URL <a href=\"\\url\">\\url</a>\\end{url}__NEWLINE__" + |
There was a problem hiding this comment.
1. Url block text mismatches patch 📎 Requirement gap ✓ Correctness
The added URL block uses the label URL instead of the required patch text (doi in the URL block as specified), so the default preview style does not match the mandated formatting. This can lead to non-compliant rendering relative to the specified patch content.
Agent Prompt
## Issue description
The default preview style URL block content does not match the exact DOI+URL patch text required by the compliance checklist.
## Issue Context
The compliance requirement expects the default preview style in `JabRefGuiPreferences` to include DOI and URL blocks consistent with the ticket-provided patch.
## Fix Focus Areas
- jabgui/src/main/java/org/jabref/gui/preferences/JabRefGuiPreferences.java[282-283]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
| String oldPreviewStyle = """ | ||
| <font face="sans-serif">__NEWLINE__\ | ||
| Customized preview style using reviews and comments:__NEWLINE__\ | ||
| \\begin{review}<BR><BR><b>Review: </b> \\format[HTMLChars]{\\review} \\end{review}__NEWLINE__\ | ||
| \\begin{comment} Something: \\format[HTMLChars]{\\comment} special \\end{comment}__NEWLINE__\ | ||
| </font>__NEWLINE__\ | ||
| \\begin{pages}<BR> p. \\format[FormatPagesForHTML]{\\pages}\\end{pages}__NEWLINE__\ | ||
| \\begin{abstract}<BR><BR><b>Abstract: </b>\\format[HTMLChars]{\\abstract} \\end{abstract}__NEWLINE__"""; | ||
|
|
||
| String newPreviewStyle = """ | ||
| <font face="sans-serif">__NEWLINE__\ | ||
| Customized preview style using reviews and comments:__NEWLINE__\ | ||
| \\begin{comment}<BR><BR><b>Comment: </b> \\format[Markdown,HTMLChars(keepCurlyBraces)]{\\comment} \\end{comment}__NEWLINE__\ | ||
| \\begin{comment} Something: \\format[Markdown,HTMLChars(keepCurlyBraces)]{\\comment} special \\end{comment}__NEWLINE__\ | ||
| </font>__NEWLINE__\ | ||
| \\begin{pages}<BR> p. \\format[FormatPagesForHTML]{\\pages}\\end{pages}__NEWLINE__\ | ||
| \\begin{doi}<BR>doi <a href="https://doi.org/\\format[DOIStrip]{\\doi}">\\format[DOIStrip]{\\doi}</a>\\end{doi}__NEWLINE__\ | ||
| \\begin{url}<BR>URL <a href="\\url">\\url</a>\\end{url}__NEWLINE__\ | ||
| \\begin{abstract}<BR><BR><b>Abstract: </b>\\format[HTMLChars]{\\abstract} \\end{abstract}__NEWLINE__"""; | ||
|
|
||
| when(preferences.get(JabRefGuiPreferences.PREVIEW_STYLE)).thenReturn(oldPreviewStyle); | ||
|
|
There was a problem hiding this comment.
2. Tests miss \end{doi} case 📎 Requirement gap ⛯ Reliability
The added/updated tests validate migration behavior around \end{pages}__NEWLINE__\begin{abstract}
and a non-matching case, but they do not cover the required matching trigger
\end{doi}\n\begin{abstract}. This leaves the mandated conditional migration behavior unverified
and risks regressions.
Agent Prompt
## Issue description
The migration tests do not verify the required conditional trigger based on `\\end{doi}` followed by a newline and then `\\begin{abstract}`.
## Issue Context
Compliance requires coverage for both:
- matching `\\end{doi}\\n\\begin{abstract}` (migration inserts DOI+URL patch)
- non-matching variants (migration leaves preview unchanged)
## Fix Focus Areas
- jabgui/src/test/java/org/jabref/migrations/GuiPreferencesMigrationsTest.java[83-126]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
Review Summary by QodoAdd DOI and URL to default entry preview layout
WalkthroughsDescription• Added DOI and URL fields to default entry preview layout • Implemented automatic migration for existing preview styles • Updated preview style storage to use __NEWLINE__ for proper migration • Added comprehensive tests for preview style migration scenarios Diagramflowchart LR
A["Default Preview Layout"] -->|Add DOI field| B["DOI with link"]
A -->|Add URL field| C["URL with link"]
D["Existing Preview Styles"] -->|Migration triggered| E["Updated with DOI/URL"]
F["Preview Storage"] -->|Replace newlines| G["__NEWLINE__ format"]
File Changes1. jabgui/src/main/java/org/jabref/gui/preferences/JabRefGuiPreferences.java
|
|
Do not mark a PR as ready-for-review while the CI is running. CI checks need to be completed and passed. |
|
Persistent review updated to latest commit 10f859c |
Review Summary by QodoAdd DOI and URL fields to default entry preview
WalkthroughsDescription• Added DOI and URL fields to default entry preview style • Implemented migration logic to update existing preview styles • Enhanced preview style storage to use __NEWLINE__ for proper migration • Added comprehensive tests for preview style migration scenarios Diagramflowchart LR
A["Default Preview Style"] -->|"Add DOI/URL fields"| B["Updated Preview Template"]
C["User Custom Preview"] -->|"Migration Logic"| D["Migrated Preview Style"]
B -->|"Store with __NEWLINE__"| E["Preferences Storage"]
D -->|"Validation Tests"| F["Test Coverage"]
File Changes1. jabgui/src/main/java/org/jabref/gui/preferences/JabRefGuiPreferences.java
|
|
Persistent review updated to latest commit 18644c1 |
|
thanks for the help! |
|
Qodo is an AI bot, so you have to take it always with a bit of grain at salt but it helps to see potential issues that need a second look. |
…anner * upstream/tryToFixBanner: (194 commits) Enable loading of main.wxs Fix icon on Linux (#15188) chore(deps): update dependency org.apache.maven.plugins:maven-surefire-plugin to v3.5.5 (#15178) New Crowdin updates (#15173) Reduce complexity in dependencies setup (#15169) Start new development cycle snapcraft snapcraft use snapctl update metadata fiels try with mesa candidate fix snapcraft and skmanrc to use correct version Release v6.0-alpha.5 chore(sbom): update CycloneDX SBOM files (#15172) Chore(deps): Bump jablib/src/main/resources/csl-styles (#15171) Added "DOI" and URL to entry preview [#14193] (#15121) Fix condition to check running CI in workflow Add maintainer permission check to workflow Add debug output for running checks Fix matrix ...
* feat: added "DOI" replace if entry preview has default value * fix: remove multiple consecutive blank lines * feat: add URL replace for default entry preview and negative migration test * refactor: use text block in preview style migration * fix newlines in preview prefs * use textblock * refine changelog --------- Co-authored-by: Siedlerchr <siedlerkiller@gmail.com> Co-authored-by: Oliver Kopp <kopp.dev@gmail.com>

Related issues and pull requests
Closes #14193
PR Description
I've added a "DOI" replacement if entry preview has default value. Added tests to check the merge.
Screenshots:
Steps to test
Checklist
CHANGELOG.mdin a way that can be understood by the average user