Skip to content

Conversation

@Kartikkdg05
Copy link

@Kartikkdg05 Kartikkdg05 commented Jan 7, 2026

User description

Closes #14818

Side pane visibility is now restored from user preferences on startup.
Previously, panes such as Web Search could reopen even after being closed.

Now, side panes open or stay closed exactly as the user left them.

Steps to test

Started JabRef with a fresh configuration

Closed Web Search, restarted → stays closed

Opened Web Search, restarted → opens again

if user kept the web search on before exiting Jabref
Screenshot 2026-01-07 164058
if not then,
Screenshot 2026-01-07 164151

Mandatory checks


PR Type

Bug fix


Description

  • Removed WEB_SEARCH from default visible side panes on startup

  • Added validation to prevent empty pane visibility from overwriting preferences

  • Ensures side panes respect user's last session state correctly


Diagram Walkthrough

flowchart LR
  A["Default Panes Config"] -->|Changed| B["GROUPS only<br/>WEB_SEARCH removed"]
  C["User Preferences"] -->|Load on Startup| D["setAll Method"]
  D -->|Added Validation| E["Skip if Empty<br/>Preserve State"]
  E -->|Result| F["Panes Match<br/>Last Session"]
Loading

File Walkthrough

Relevant files
Bug fix
SidePanePreferences.java
Fix default panes and preference restoration logic             

jabgui/src/main/java/org/jabref/gui/frame/SidePanePreferences.java

  • Removed SidePaneType.WEB_SEARCH from default visible panes, keeping
    only GROUPS
  • Added null/empty check in setAll() method to prevent overwriting
    preferences with empty pane sets
  • Ensures user's side pane visibility state is properly restored from
    previous session
+4/-2     

@qodo-free-for-open-source-projects
Copy link
Contributor

qodo-free-for-open-source-projects bot commented Jan 7, 2026

PR Compliance Guide 🔍

Below is a summary of compliance checks for this PR:

Security Compliance
🟢
No security concerns identified No security vulnerabilities detected by AI analysis. Human verification advised for critical code.
Ticket Compliance
🎫 No ticket provided
  • Create ticket/issue
Codebase Duplication Compliance
Codebase context is not defined

Follow the guide to enable codebase context checks.

Custom Compliance
🟢
Generic: Comprehensive Audit Trails

Objective: To create a detailed and reliable record of critical system actions for security analysis
and compliance.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Meaningful Naming and Self-Documenting Code

Objective: Ensure all identifiers clearly express their purpose and intent, making code
self-documenting

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Robust Error Handling and Edge Case Management

Objective: Ensure comprehensive error handling that provides meaningful context and graceful
degradation

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Secure Error Handling

Objective: To prevent the leakage of sensitive system information through error messages while
providing sufficient detail for internal debugging.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Secure Logging Practices

Objective: To ensure logs are useful for debugging and auditing without exposing sensitive
information like PII, PHI, or cardholder data.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Security-First Input Validation and Data Handling

Objective: Ensure all data inputs are validated, sanitized, and handled securely to prevent
vulnerabilities

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

  • Update
Compliance status legend 🟢 - Fully Compliant
🟡 - Partial Compliant
🔴 - Not Compliant
⚪ - Requires Further Human Verification
🏷️ - Compliance label

@github-actions github-actions bot added the good first issue An issue intended for project-newcomers. Varies in difficulty. label Jan 7, 2026
@qodo-free-for-open-source-projects
Copy link
Contributor

qodo-free-for-open-source-projects bot commented Jan 7, 2026

PR Code Suggestions ✨

Explore these optional code suggestions:

CategorySuggestion                                                                                                                                    Impact
Possible issue
Allow user to have no panes
Suggestion Impact:The commit partially implemented the suggestion by removing the isEmpty() check that prevented saving empty pane sets (lines 14-16 removed, line 17 simplified). However, the commit did not add the null check for the preferences object that was suggested.

code diff:

     public void setAll(SidePanePreferences preferences) {
-        if (!preferences.visiblePanes().isEmpty()) {
-            this.setVisiblePanes(preferences.visiblePanes());
-        }
+        this.setVisiblePanes(preferences.visiblePanes());
         this.setPreferredPositions(preferences.getPreferredPositions());
         this.webSearchFetcherSelected.set(preferences.getWebSearchFetcherSelected());

Remove the condition preventing an empty set of panes from being saved, as
having no visible panes is a valid user preference. Instead, add a null check
for the preferences object.

jabgui/src/main/java/org/jabref/gui/frame/SidePanePreferences.java [71-77]

 public void setAll(SidePanePreferences preferences) {
-    if (!preferences.visiblePanes().isEmpty()) {
-        this.setVisiblePanes(preferences.visiblePanes());
+    if (preferences == null) {
+        return;
     }
+    this.setVisiblePanes(preferences.visiblePanes());
     this.setPreferredPositions(preferences.getPreferredPositions());
     this.webSearchFetcherSelected.set(preferences.getWebSearchFetcherSelected());
 }

[Suggestion processed]

Suggestion importance[1-10]: 7

__

Why: The suggestion correctly identifies that the PR change prevents users from saving a state with no visible side panes, which is a valid user preference, and proposes a fix that respects this user choice.

Medium
  • Update

@satyambuilds
Copy link

Thanks for the clear fix and detailed test steps 👍

One question / suggestion regarding edge cases:

  • If a user intentionally closes all side panes, should this empty state be treated as a valid preference and restored on startup?
  • Currently, the validation preventing empty pane visibility from overwriting preferences might block that scenario.

If intentional, maybe worth clarifying in code comments or documenting the expected behavior.

Otherwise, the approach looks solid and the manual test steps are clear.

@Kartikkdg05
Copy link
Author

@satyambuilds Thanks for pointing this out

Yes, closing all side panes is a valid user choice and should be remembered.
The check is only there to avoid default settings overwriting saved preferences during startup, not to block user actions

@koppor
Copy link
Member

koppor commented Jan 7, 2026

If intentional, maybe worth clarifying in code comments or documenting the expected behavior.

Go ahead and update https://github.com/JabRef/jabref/tree/main/docs/requirements. We are trying to improve the documentation there. Don't use AI to create. Think for yourself. I don't want to read AI text coming from a sloppy prompt. I am more efficient when interacting with an AI for myself.

One question / suggestion regarding edge cases:

* If a user intentionally closes _all_ side panes, should this empty state be treated as a valid preference and restored on startup?

Good pattern as newcomer: Create an answer with pros and cons.

Maybe start an old version of JabRef and test it out.

This is not too hard. Really. It's worth the time.

* Currently, the validation preventing empty pane visibility from overwriting preferences might block that scenario.

Unclear text. "might" is speculative. Think. Read the code. Think again. It is NOT a distributed system here. It is a desktop application - and side panes are directly visible. Not much code for toggling. READ AND LEARN. -- Improve your code reading skills.

@Kartikkdg05
Copy link
Author

Kartikkdg05 commented Jan 7, 2026

@koppor @Siedlerchr changing the default visible panes is not the correct approach, I’ll undo the default change and rework on the issue

@subhramit
Copy link
Member

@satyambuilds kindly refrain from getting involved in projects and discussions you have no idea about, just to experiment with AI or fulfill some "2.5k+ contributions" target. That's really not what open source is supposed to be about. Note that all this activity of yours will be public and can (and will) potentially do more harm than good.

@calixtus calixtus closed this Jan 8, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Jan 8, 2026

This pull requests was closed without merging. You have been unassigned from the respective issue #14818. In case you closed the PR for yourself, you can re-open it. Please also check After submission of a pull request in CONTRIBUTING.md.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

good first issue An issue intended for project-newcomers. Varies in difficulty. Review effort 2/5

Projects

None yet

Development

Successfully merging this pull request may close these issues.

default opening of the search panel upon new launch

6 participants