Skip to content

Persist file notifications#15403

Merged
calixtus merged 1 commit into
mainfrom
persistent-notifications
Mar 24, 2026
Merged

Persist file notifications#15403
calixtus merged 1 commit into
mainfrom
persistent-notifications

Conversation

@calixtus

@calixtus calixtus commented Mar 24, 2026

Copy link
Copy Markdown
Member

Related issues and pull requests

Fixes https://github.com/JabRef/jabref-issue-melting-pot/issues/1269

PR Description

Easily extendeble by adding more to-keep-persistent lists in JabRefDialogService constructor.

Steps to test

Open file in JabRef
Do external changes
See file notification until manually closed or hidden

Checklist

  • I own the copyright of the code submitted and I license it under the MIT license
  • I manually tested my changes in running JabRef (always required)
  • [.] I added JUnit tests for changes (if applicable)
  • [.] I added screenshots in the PR description (if change is visible to the user)
  • [.] I added a screenshot in the PR description showing a library with a single entry with me as author and as title the issue number
  • [.] I described the change in CHANGELOG.md in a way that can be understood by the average user (if change is visible to the user)
  • [.] I checked the user documentation for up to dateness and submitted a pull request to our user documentation repository

@qodo-free-for-open-source-projects

Copy link
Copy Markdown
Contributor

Review Summary by Qodo

Persist file notifications in info center

✨ Enhancement

Grey Divider

Walkthroughs

Description
• Add persistent notifications support to file change notifications
• Introduce getPersistentNotifications() method to DialogService interface
• Implement persistent notifications list in JabRefDialogService using fileNotifications
• Auto-hide info center when no persistent notifications exist
Diagram
flowchart LR
  A["DialogService Interface"] -->|adds method| B["getPersistentNotifications"]
  C["JabRefDialogService"] -->|implements| B
  C -->|uses EasyBind.concat| D["fileNotifications"]
  D -->|populates| E["persistentNotifications List"]
  E -->|binds to| F["InfoCenter autoHide"]
  F -->|hides when empty| G["Info Center UI"]
Loading

Grey Divider

File Changes

1. jabgui/src/main/java/org/jabref/gui/DialogService.java ✨ Enhancement +3/-0

Add persistent notifications getter to interface

• Add import for ObservableList from javafx.collections
• Add new method getPersistentNotifications() that returns an observable list of persistent
 notifications

jabgui/src/main/java/org/jabref/gui/DialogService.java


2. jabgui/src/main/java/org/jabref/gui/JabRefDialogService.java ✨ Enhancement +8/-0

Implement persistent notifications in dialog service

• Add import for ObservableList from javafx.collections
• Add private field persistentNotifications to store persistent notifications
• Initialize persistentNotifications using EasyBind.concat() with fileNotifications
• Implement getPersistentNotifications() method to expose the persistent notifications list

jabgui/src/main/java/org/jabref/gui/JabRefDialogService.java


3. jabgui/src/main/java/org/jabref/gui/JabRefGUI.java ✨ Enhancement +2/-0

Bind info center visibility to persistent notifications

• Add import for Bindings from javafx.beans.binding
• Bind info center's autoHideProperty to be true when persistent notifications list is empty
• Ensures info center automatically hides when no persistent notifications are present

jabgui/src/main/java/org/jabref/gui/JabRefGUI.java


Grey Divider

Qodo Logo

@qodo-free-for-open-source-projects

qodo-free-for-open-source-projects Bot commented Mar 24, 2026

Copy link
Copy Markdown
Contributor

Code Review by Qodo

🐞 Bugs (1) 📘 Rule violations (0) 📎 Requirement gaps (0) 📐 Spec deviations (0)

Grey Divider


Action required

1. Export blocks auto-hide 🐞 Bug ✓ Correctness
Description
JabRefGUI disables InfoCenterPane auto-hide whenever any file notification exists, but export
success uses a file notification that does not auto-remove. After exporting once, the info center
can remain non-auto-hiding until the user explicitly dismisses the export notification.
Code

jabgui/src/main/java/org/jabref/gui/JabRefGUI.java[326]

+        powerpane.getInfoCenterPane().autoHideProperty().bind(Bindings.isEmpty(dialogService.getPersistentNotifications()));
Evidence
Auto-hide is bound to isEmpty(dialogService.getPersistentNotifications()), and
persistentNotifications is currently the full fileNotifications list.
ExportSuccessNotification extends Notifications.FileNotification and is added on export success;
FileNotification has no auto-close behavior, so the list stays non-empty and auto-hide remains
disabled until manual removal (only happens if the user clicks the action).

jabgui/src/main/java/org/jabref/gui/JabRefGUI.java[321-328]
jabgui/src/main/java/org/jabref/gui/JabRefDialogService.java[82-96]
jabgui/src/main/java/org/jabref/gui/exporter/ExportCommand.java[113-148]
jabgui/src/main/java/org/jabref/gui/Notifications.java[34-40]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
InfoCenterPane auto-hide is disabled whenever `getPersistentNotifications()` is non-empty. Currently, `persistentNotifications` includes **all** `fileNotifications`, which also includes non-critical notifications like export success. Because `Notifications.FileNotification` does not auto-remove by default, success notifications can keep the info center from auto-hiding indefinitely.

### Issue Context
- Auto-hide binding is driven by `Bindings.isEmpty(dialogService.getPersistentNotifications())`.
- `persistentNotifications` is set to `EasyBind.concat(fileNotifications.getNotifications())`, i.e., the entire file-notification group.
- `ExportSuccessNotification` extends `Notifications.FileNotification` and does not auto-close.

### Fix Focus Areas
- jabgui/src/main/java/org/jabref/gui/JabRefGUI.java[321-328]
- jabgui/src/main/java/org/jabref/gui/JabRefDialogService.java[82-96]

### Suggested fix direction
Make `getPersistentNotifications()` contain only the notifications that truly must prevent auto-hide (e.g., external-change warnings).
Concrete options:
1. Introduce a dedicated notification subtype/marker for persistent notifications (e.g., `PersistentFileNotification extends FileNotification`) and build `persistentNotifications` by filtering for that type.
2. Keep `fileNotifications` for display grouping, but maintain a separate `ObservableList` that only tracks persistent ones.
3. Alternatively, change export success to a `UiNotification` with auto-close (or schedule `remove()` on the ExportSuccessNotification), so it doesn’t affect persistence.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

ⓘ The new review experience is currently in Beta. Learn more

Grey Divider

Qodo Logo

Comment thread jabgui/src/main/java/org/jabref/gui/JabRefGUI.java
@testlens-app

testlens-app Bot commented Mar 24, 2026

Copy link
Copy Markdown

✅ All tests passed ✅

🏷️ Commit: 6ac10c7
▶️ Tests: 10203 executed
⚪️ Checks: 115/115 completed


Learn more about TestLens at testlens.app.

@calixtus calixtus added component: ui status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers component: external-changes labels Mar 24, 2026
@calixtus calixtus enabled auto-merge March 24, 2026 20:18
@Siedlerchr

Copy link
Copy Markdown
Member

is the qodo comment valid?

@calixtus

Copy link
Copy Markdown
Member Author

No. Auto-Hide property is bound to emptiness of list of notifications. An export success notification removes itself from list after a few seconds, so list is empty again.

@calixtus calixtus added this pull request to the merge queue Mar 24, 2026
@github-actions github-actions Bot added the status: to-be-merged PRs which are accepted and should go into the merge-queue. label Mar 24, 2026
Merged via the queue into main with commit 2bd3b10 Mar 24, 2026
103 of 116 checks passed
@calixtus calixtus deleted the persistent-notifications branch March 24, 2026 22:54

@koppor koppor left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good at first sight. Let's merge and see how it behaves.

I see the QODO comment, but I think, we cannot do anything about it.

@calixtus

Copy link
Copy Markdown
Member Author

Mhh, maybe valid after all. Maybe needs another group. Maybe an additional flag in the notification to filter by?

Siedlerchr added a commit to geovani-rocha/jabref that referenced this pull request Mar 28, 2026
…o fix-group-icons

* 'fix-group-icons' of github.com:geovani-rocha/jabref: (26 commits)
  chore(deps): update dependency org.apache.logging.log4j:log4j-to-slf4j to v2.25.4 (JabRef#15436)
  chore(deps): update jackson monorepo to v3.1.1 (JabRef#15435)
  Fix PushToPreferences reset and import (JabRef#15395)
  Add fulltext fetcher for Wiley via their TDM API (JabRef#15388)
  Embed in-text nature in reference marks for CSL citations (JabRef#15381)
  Chore(deps): Bump com.gradleup.shadow:shadow-gradle-plugin (JabRef#15430)
  Fix not on fx thread exceptions for cleanup and cite key generator (JabRef#15424)
  Revert "Update gradle to nightly of 2026-03-23 (JabRef#15372)"
  feat: add benchmarks for Lucene fulltext search and linked file indexing, including setup and teardown of the index. (JabRef#15385)
  Chore(deps): Bump org.openrewrite.recipe:rewrite-recipe-bom (JabRef#15418)
  Add claude gitignore (JabRef#15413)
  Fix group filter icon in side pane (JabRef#15408)
  Add new prs_link feature
  Chore(deps): Bump org.glassfish.hk2:hk2-api in /versions (JabRef#15422)
  Chore(deps): Bump org.openrewrite.rewrite from 7.28.2 to 7.29.0 (JabRef#15419)
  Chore(deps): Bump jablib/src/main/resources/csl-styles (JabRef#15417)
  Fix for inconsistent "hide tab bar" behavior (JabRef#15409)
  Update dependency org.glassfish.hk2:hk2-utils to v4 (JabRef#15407)
  Persist file notifications (JabRef#15403)
  Update dependency org.glassfish.hk2:hk2-locator to v4 (JabRef#15405)
  ...
Ranjeet2702 pushed a commit to Ranjeet2702/jabref that referenced this pull request Apr 14, 2026
Co-authored-by: Carl Christian Snethlage <calixtus@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component: external-changes component: ui status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers status: to-be-merged PRs which are accepted and should go into the merge-queue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants