Skip to content

Fix group filter icon in side pane#15408

Merged
calixtus merged 9 commits into
JabRef:mainfrom
jadegold55:fix-group-filter-icon
Mar 25, 2026
Merged

Fix group filter icon in side pane#15408
calixtus merged 9 commits into
JabRef:mainfrom
jadegold55:fix-group-filter-icon

Conversation

@jadegold55

@jadegold55 jadegold55 commented Mar 24, 2026

Copy link
Copy Markdown
Contributor

Related issues and pull requests

Closes #15402

PR Description

This changes the groups side pane filter field to use the filter icon instead of the search icon so the UI matches its actual purpose.

Steps to test

  1. Start JabRef.
  2. Open the Groups side pane.
  3. Verify that the field with the placeholder "Filter groups..." shows a filter icon on the left.
  4. Confirm that the Web search field still shows the search icon.

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

Current State:

image

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

Copy link
Copy Markdown
Contributor

Review Summary by Qodo

Replace search icon with filter icon in groups pane

🐞 Bug fix

Grey Divider

Walkthroughs

Description
• Replace search icon with filter icon in groups side pane
• Import IconTheme and apply filter icon graphic to search field
• Maintain existing field behavior and styling unchanged
Diagram
flowchart LR
  A["GroupTreeView"] -- "createNodes method" --> B["SearchTextField"]
  B -- "add filter icon" --> C["IconTheme.JabRefIcons.FILTER"]
  C -- "getGraphicNode" --> D["Filter icon graphic"]
  D -- "setLeft on field" --> E["Updated search field"]
Loading

Grey Divider

File Changes

1. jabgui/src/main/java/org/jabref/gui/groups/GroupTreeView.java 🐞 Bug fix +4/-0

Replace search icon with filter icon in groups pane

• Added import for IconTheme class
• Created filter icon graphic node from IconTheme.JabRefIcons.FILTER
• Applied search-field-icon style class to the filter icon
• Set filter icon as left graphic on the search field using setLeft()

jabgui/src/main/java/org/jabref/gui/groups/GroupTreeView.java


Grey Divider

Qodo Logo

@github-actions

Copy link
Copy Markdown
Contributor

Hey @jadegold55! 👋

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.

@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 (0) 📘 Rule violations (0) 📎 Requirement gaps (0) 📐 Spec deviations (0)

Grey Divider


Remediation recommended

1. Duplicated icon styling contract🐞 Bug ⚙ Maintainability
Description
GroupTreeView manually re-applies the same CSS class convention that SearchTextField.create() uses
for its default left icon, which couples this view to internal SearchTextField/CSS details. If
SearchTextField’s icon styling changes (class name, structure), the group filter icon can diverge in
appearance without any compile-time signal.
Code

jabgui/src/main/java/org/jabref/gui/groups/GroupTreeView.java[R149-151]

+        Node filterIcon = IconTheme.JabRefIcons.FILTER.getGraphicNode();
+        filterIcon.getStyleClass().add("search-field-icon");
+        searchField.setLeft(filterIcon);
Evidence
SearchTextField.create() hard-codes a left icon and applies the "search-field-icon" style class
itself, meaning GroupTreeView is now intentionally overriding that internal setup and must replicate
the styling hook to keep consistent visuals. The CSS also contains specific styling for the group
filter bar’s icon nodes ("#groupFilterBar .glyph-icon"), reinforcing that the icon’s class structure
is relied upon by styling.

jabgui/src/main/java/org/jabref/gui/search/SearchTextField.java[16-25]
jabgui/src/main/resources/org/jabref/gui/Base.css[1130-1137]
jabgui/src/main/resources/org/jabref/gui/Base.css[2349-2358]

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

## Issue description
`GroupTreeView` overrides `SearchTextField.create()`’s default left icon and must duplicate the styling hook (`"search-field-icon"`). This increases coupling between views and `SearchTextField`/CSS implementation details.
### Issue Context
- `SearchTextField.create()` always sets a left SEARCH icon and applies `"search-field-icon"`.
- `GroupTreeView` replaces that icon with FILTER and re-applies the class manually.
### Fix Focus Areas
- Add an overload like `SearchTextField.create(KeyBindingRepository repo, Node leftIcon)` (or `JabRefIcon`) that applies the standard icon styling internally, and use it from the groups view.
- jabgui/src/main/java/org/jabref/gui/search/SearchTextField.java[16-40]
- jabgui/src/main/java/org/jabref/gui/groups/GroupTreeView.java[146-153]

ⓘ 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 first contrib good first issue An issue intended for project-newcomers. Varies in difficulty. component: groups status: no-bot-comments labels Mar 24, 2026
@github-actions github-actions Bot added status: changes-required Pull requests that are not yet complete and removed status: no-bot-comments labels Mar 24, 2026
@github-actions github-actions Bot added status: no-bot-comments and removed status: changes-required Pull requests that are not yet complete labels Mar 24, 2026
@testlens-app

This comment has been minimized.

Comment on lines +20 to +29
@Test
void createUsesRequestedIcon() {
KeyBindingRepository keyBindingRepository = Mockito.mock(KeyBindingRepository.class);

CustomTextField textField = SearchTextField.create(keyBindingRepository, IconTheme.JabRefIcons.FILTER);

Node leftGraphic = textField.getLeft();
assertEquals(IconTheme.JabRefIcons.FILTER.getGraphicNode().toString(), leftGraphic.toString());
assertTrue(leftGraphic.getStyleClass().contains("search-field-icon"));
}

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.

To keep the tests managable, we do not test trivialities.
Especially here you more or less testing javafx and java, not our logic. Test can be removed imho.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Ok sounds good and thanks for the review/ feedback. Will update it real quick.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done!

@testlens-app

This comment has been minimized.

@testlens-app

This comment has been minimized.

@calixtus

Copy link
Copy Markdown
Member

Changelog entry should be added. Even though the change is minimal, it is user-facing and should be mentioned.

@testlens-app

testlens-app Bot commented Mar 25, 2026

Copy link
Copy Markdown

✅ All tests passed ✅

🏷️ Commit: 0c5c755
▶️ Tests: 10203 executed
⚪️ Checks: 62/62 completed


Learn more about TestLens at testlens.app.

@calixtus calixtus enabled auto-merge March 25, 2026 17:09
@calixtus calixtus added this pull request to the merge queue Mar 25, 2026
github-merge-queue Bot pushed a commit that referenced this pull request Mar 25, 2026
* Fix group filter icon in side pane

* Refactor search field icon handling

* Fix search field checkstyle imports

* Fix search field test newline

* Remove trivial SearchTextField test

* Add changelog entry for group filter icon

---------

Co-authored-by: jadegold55 <jadegold55@users.noreply.github.com>
@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 7b0ea8b Mar 25, 2026
61 of 62 checks passed
jadegold55 added a commit to jadegold55/jabref that referenced this pull request Mar 26, 2026
* Fix group filter icon in side pane

* Refactor search field icon handling

* Fix search field checkstyle imports

* Fix search field test newline

* Remove trivial SearchTextField test

* Add changelog entry for group filter icon

---------

Co-authored-by: jadegold55 <jadegold55@users.noreply.github.com>
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 group filter icon in side pane

* Refactor search field icon handling

* Fix search field checkstyle imports

* Fix search field test newline

* Remove trivial SearchTextField test

* Add changelog entry for group filter icon

---------

Co-authored-by: jadegold55 <jadegold55@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component: groups first contrib good first issue An issue intended for project-newcomers. Varies in difficulty. 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.

Change icon of group filtering to filter icon

2 participants