Skip to content

Fix for inconsistent "hide tab bar" behavior#15409

Merged
calixtus merged 3 commits into
JabRef:mainfrom
alxafan:fix-for-issue-12680
Mar 25, 2026
Merged

Fix for inconsistent "hide tab bar" behavior#15409
calixtus merged 3 commits into
JabRef:mainfrom
alxafan:fix-for-issue-12680

Conversation

@alxafan

@alxafan alxafan commented Mar 25, 2026

Copy link
Copy Markdown
Contributor

Related issues and pull requests

Closes #12680

PR Description

  • Added listener to "hide tab bar when a single library is present" setting, so that the UI updates on toggle. This fixes the tab bar not showing.
  • Changed CSS of tab-header-area from collapsing the element, to changing its size to 0. The collapsed element would not be updated correctly and be stuck in a stale state, only updating after another Library was added.

Before:

Screencast.From.2026-03-24.22-56-30.mp4

After:

Screencast.From.2026-03-25.01-29-50.mp4

Screenshot with my name and issue number:
image

Steps to test

Go through steps of the related issue:

  1. Set preference to true for "Hide tab bar when single library is present"
  2. Create a new library
  3. Change the preference to false.
  4. Now instead of no tab being shown, you should see the expected *untitled tab.

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

Fix tab bar visibility toggle behavior

🐞 Bug fix

Grey Divider

Walkthroughs

Description
• Added listener to "hide tab bar" setting for dynamic UI updates
• Changed CSS from visibility collapse to height-based hiding
• Ensures tab bar properly shows/hides when preference toggled
• Updated CHANGELOG with fix description
Diagram
flowchart LR
  A["hideTabBarProperty listener"] -->|triggers| B["updateTabBarVisible()"]
  B -->|updates| C["tab-header-area CSS"]
  C -->|applies| D["Dynamic height changes"]
  E["CSS visibility:collapse"] -->|replaced by| F["height-based hiding"]
Loading

Grey Divider

File Changes

1. jabgui/src/main/java/org/jabref/gui/frame/JabRefFrame.java 🐞 Bug fix +1/-0

Add preference listener for tab bar visibility

• Added listener to hideTabBarProperty() that triggers updateTabBarVisible()
• Ensures UI updates when the "hide tab bar when single library" preference is toggled
• Complements existing listeners for database and tab changes

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


2. jabgui/src/main/resources/org/jabref/gui/Base.css 🐞 Bug fix +3/-1

Replace visibility collapse with height-based hiding

• Replaced visibility: collapse with explicit height properties (-fx-min-height: 0,
 -fx-max-height: 0)
• Added -fx-padding: 0 for consistency
• Fixes stale state issue where collapsed elements wouldn't update correctly

jabgui/src/main/resources/org/jabref/gui/Base.css


3. CHANGELOG.md 📝 Documentation +1/-0

Document tab bar visibility fix

• Added entry documenting the fix for tab bar visibility toggle issue #12680
• Describes the resolved problem in user-friendly language

CHANGELOG.md


Grey Divider

Qodo Logo

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

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

Copy link
Copy Markdown
Contributor

Code Review by Qodo

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

Grey Divider


Action required

1. Invalid -fx-max-height CSS📘 Rule violation ✓ Correctness
Description
The new CSS rule contains a malformed declaration (-fx-min-height: 0;-fx-max-height), which can
cause the JavaFX CSS parser to ignore the rule or behave inconsistently. This risks the tab bar
hide/show state becoming non-reactive or visually incorrect when toggling the preference.
Code

jabgui/src/main/resources/org/jabref/gui/Base.css[R670-671]

+    -fx-min-height: 0;-fx-max-height
+    -fx-max-height: 0;
Evidence
PR Compliance ID 42 requires UI state to remain reactive and consistent; the added CSS includes an
invalid property token that can prevent the intended layout update from applying reliably.

jabgui/src/main/resources/org/jabref/gui/Base.css[670-671]
Best Practice: Learned patterns

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

## Issue description
A malformed JavaFX CSS declaration was introduced in the `hide-tab-bar` rule: `-fx-min-height: 0;-fx-max-height` is not valid CSS and may prevent the rule from applying.
## Issue Context
This CSS rule is part of the fix for inconsistent tab bar visibility, so parsing failures can reintroduce stale/non-reactive UI behavior.
## Fix Focus Areas
- jabgui/src/main/resources/org/jabref/gui/Base.css[670-671]

ⓘ 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

@github-actions github-actions Bot added good second issue Issues that involve a tour of two or three interweaved components in JabRef component: ui labels Mar 25, 2026
Comment thread jabgui/src/main/resources/org/jabref/gui/Base.css Outdated
@testlens-app

This comment has been minimized.

@testlens-app

testlens-app Bot commented Mar 25, 2026

Copy link
Copy Markdown

✅ All tests passed ✅

🏷️ Commit: a23510a
▶️ Tests: 10203 executed
⚪️ Checks: 52/52 completed


Learn more about TestLens at testlens.app.

@calixtus calixtus added this pull request to the merge queue Mar 25, 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 25, 2026
Merged via the queue into JabRef:main with commit 6b59bec Mar 25, 2026
52 checks passed
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
* Fix tab bar update when toggling "Hide tab bar when a single library is present"

* Add CHANGELOG message

* Fix malformed CSS declaration
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component: ui good second issue Issues that involve a tour of two or three interweaved components in JabRef status: no-bot-comments 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.

No tab shown when untitled tab is created

2 participants