Skip to content

Fix group icon picker colors in dark mode - #17920

Merged
Siedlerchr merged 3 commits into
JabRef:mainfrom
doraem-on:codex/fix-group-icon-picker-dark-theme
Nov 24, 2026
Merged

Siedlerchr merged 3 commits into
JabRef:mainfrom
doraem-on:codex/fix-group-icon-picker-dark-theme

Conversation

@doraem-on

@doraem-on doraem-on commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Summary

The group icon picker kept a white popup background and black cell borders in dark mode. It now uses the active theme's background and border colors, so the popup matches the rest of the Group Editor. The styles apply only to this picker.

Steps to test

  1. Select dark mode in JabRef, open the Group Editor, and click the picker next to the Icon field. The popup should have a dark background with readable icons and subtle borders.

    *Dark-mode capture: jabref-17887-dark-mode

  2. Search for account, then choose an icon. The icon field should update and the popup should close.

  3. Switch to light mode and reopen the picker. Its background and borders should follow the light theme. Switch back to dark mode and check again.

    **Light-mode capture: jabref-17887-light-mode
    **

Validation

  • The picker was verified in the running app in dark and light modes; both screenshots are included above.
  • No new automated test is included, as requested during review.
  • After removing the test, :jabgui:compileTestJava and :jabgui:checkstyleTest completed successfully.
  • Earlier full library checks passed: 13,574 tests passed, 33 skipped.
  • Checkstyle, Modernizer, Javadoc, Markdownlint, and textlint completed successfully.
  • OpenRewrite reported no changes, but also reported missing recipes and a parse problem in the unchanged SpecialFieldAction.java. Its checklist item remains open because that limits the check.

Related issues and pull requests

Closes #17887

AI usage

OpenAI GPT-6 assisted with the implementation. I ran local verification. I manually reviewed and verified the code

AI CHECKLIST.md walkthrough

Code checklist

[!IMPORTANT]
This is a mandatory final gate. When the implementation is finished and before you open a PR, work through every box below and tick it. If a box cannot be ticked, fix the code first; mark a box [/] only if the point genuinely does not apply.

AGENTS.md describes how to write code while developing — this file confirms the finished result. Do not skip the checklist and do not skip individual points.

1. Code self-review

Read your own diff once, top to bottom, and confirm each point.

Nullability and control flow

  • No == null / != null checks — JSpecify annotations (@NullMarked, @Nullable, @NonNull) used instead.
  • No Objects.requireNonNull(...) — nullability expressed via JSpecify annotations.
  • New classes annotated with @NullMarked (org.jspecify.annotations.NullMarked).
  • [/] New packages annotated with @NullMarked (org.jspecify.annotations.NullMarked).
  • Optional consumed with ifPresent / ifPresentOrElse / map / orElseThrow — never orElse(unusedValue) nor an isPresent() + get() block.
  • [/] StringUtil.isBlank(...) used instead of s == null || s.isBlank().

Exceptions

  • No catch (Exception e) — only specific exceptions are caught.
  • No throw new RuntimeException(...) / IllegalStateException(...) — these tear down the whole application.
  • [/] Logged exceptions are passed as the last logger argument (LOGGER.info("...", e)), not concatenated into the message string.

Style and idioms

  • [/] New BibEntry objects built with withers (withField, not setField).
  • Modern Java used: List.of() / Map.of() / Set.of(), Path.of(), SequencedCollection / SequencedSet, text blocks.
  • [/] Regexes use a precompiled Pattern.compile(...) constant, not String.matches(...).
  • [/] Keep alphabetical ordering when adding variables or enum items.
  • [/] Background work uses org.jabref.logic.util.BackgroundTask, not new Thread().
  • No commented-out code, no trivial comments restating the code, no AI-disclosure comments in source.
  • [/] Markdown Javadoc (///) uses Markdown syntax, not JavaDoc inline tags: `code` instead of {@code}, [ClassName] instead of {@link}.

User-facing text

  • [/] All user-facing text localized (Localization.lang in Java, % prefix in FXML).
  • [/] Sentence case (not Title Case); no trailing !; labels do not end with :.
  • [/] Variance expressed with placeholders ("...: %0"), not string concatenation.

Security

  • [/] User-controlled data (request params, entry fields, file contents) is HTML-escaped before being written into any text/html response — including exception/error messages, not just the success body (XSS).

Tests

  • [/] In case issue lists an example, this concrete example is covered by a test case. The picker was checked manually; the added GUI test was removed as requested during review.
  • [/] Behavior changes in org.jabref.model / org.jabref.logic have added or updated tests.
  • [/] Tests assert object contents (assertEquals), use plain JUnit asserts (not AssertJ), have no @DisplayName, do not catch exceptions (let them propagate so JUnit reports setup/teardown failures directly), and use @TempDir instead of manual temp directories.
  • [/] Fetcher tests hit the live endpoints — the remote API is not mocked or stubbed (automated-review suggestions to mock it are rejected on purpose).

2. Verification commands

Run in this order — cheapest first. Each must pass.

  • ./gradlew :jablib:check (or ./gradlew check for all modules).
  • ./gradlew checkstyleMain checkstyleTest checkstyleJmh.
  • ./gradlew modernizer.
  • ./gradlew --no-configuration-cache :rewriteDryRun reports no changes (run ./gradlew rewriteRun to fix).
  • ./gradlew javadoc.
  • npx markdownlint-cli2 "docs/**/*.md" "*.md" (only if Markdown changed).
  • npm ci && npm run textlint reports no misspellings (only if Markdown changed).
  • [/] Only if formatting is still off after rewriteRun: docker run -v $(pwd):/github/workspace ghcr.io/leventebajczi/intellij-format:master "*.java" "" ".idea/codeStyles/Project.xml".

3. Documentation

  • CHANGELOG.md entry added if the change is visible to the user (end-user wording, no extra blank lines, sorted in next to existing entries about the same component/feature). Link the issue if one exists; link the PR only when no issue exists. Use TODO as the placeholder when neither is known yet — never a fake number. No entry for fixes to changes that were themselves introduced after the last release (feature only in ## [Unreleased]) — update the existing unreleased entry instead if needed.
  • Searched jabref/issues and jabref-koppor/issues for a related issue; linked only on a confident match, otherwise kept TODO (no closes/fixes for merely-similar issues).
  • [/] Requirement added to docs/requirements/<area>.md if the change is a new feature or significant bug fix (skip for refactors, minor fixes, and internal changes).
  • [/] Developer documentation under docs/ updated if behavior or architecture changed.

4. Pull request

  • PR body built from .github/PULL_REQUEST_TEMPLATE.md, every section filled.
  • All checklist items kept and marked [x], [ ], or [/].
  • "Steps to test" is a numbered list with a cropped screenshot of the result for every visible change; no video (only allowed when another program is involved, e.g. drag and drop or push to an external application).
  • All HTML comments removed from the PR body.
  • PR created with gh pr create --body-file <file> (not --body).
  • [/] If CHANGELOG.md used a TODO placeholder (no issue confidently identified yet — an existing issue link always stays), the PR was opened as draft, the placeholder was replaced with the real PR-number link after PR creation, committed and pushed, and only then was the PR marked ready for review. If an issue is identified or created later, the link is switched to the issue.

Notes: Related issues were searched in both repositories; #17887 is the confirmed match. OpenRewrite's limitations are recorded above.

Checklist

  • I own the copyright of the code submitted and I license it under the MIT license
  • If AI tools were used, I disclosed them in the "AI usage" section and reviewed, understood, and take full ownership of all AI-generated code
  • 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 one sentence (max 20 words) to CHANGELOG.md describing the change from the user's point of view (if the 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

@jabref-machine jabref-machine added this to the 6.1 milestone Nov 24, 2026
@jabref-machine jabref-machine added the dev: send-to-black-forest Port to the black-forest branch of JabRef/jabref-black-forest after merging (ADR-0073) label Nov 24, 2026
@qodo-free-for-open-source-projects

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

Copy link
Copy Markdown
Contributor

PR Summary by Qodo

Fix group icon picker colors in dark mode

🐞 Bug fix 🧪 Tests 📝 Documentation 🕐 10-20 Minutes

Grey Divider

AI Description

• Make the Group Editor icon picker background and borders follow the active theme.
• Scope the styling to this picker, leaving other popovers unchanged.
• Add a theme-switching regression test and document the visible fix.
Merge Risk 🟢 Low

Blast radius 🟢 Low 💥 1 capability

  • 1 affected end-to-end capability after fault-specific containment; implementation boundaries do not widen its functional scope.
  • The changed Java code creates the icon-picker PopOver and the FXML caller binds the picker button to openIconPicker; the CSS then styles that same PopOver and its grid cells.
  • These are presentation hops for one bounded group-management behavior, not independent capabilities or deployment layers.
Sources

jabgui/src/main/resources/org/jabref/gui/theme/internal/jabref-base.css[1188-1191]

.popover.group-icon-picker > .border {
    -fx-fill: -color-bg-secondary;
    -fx-stroke: -color-border-light;
}

jabgui/src/main/resources/org/jabref/gui/theme/internal/jabref-base.css[1193-1195]

.group-icon-picker .grid-cell:filled {
    -fx-border-color: -color-border-light;
    -fx-border-width: 1;
Behavioral complexity 🟢 Low 🧩 Straightforward

  • Before, each populated grid cell received a hardcoded black border directly in the cell implementation.
  • After, the PopOver receives a dedicated style class and the base theme maps that class to theme colors for the PopOver border/background and populated grid cells.
  • This is a direct presentation-rule substitution using the existing JavaFX/ControlsFX styling pipeline; it does not introduce new branches, state transitions, ordering, persistence, or compatibility protocol.
Sources

jabgui/src/main/resources/org/jabref/gui/theme/internal/jabref-base.css[1188-1191]

.popover.group-icon-picker > .border {
    -fx-fill: -color-bg-secondary;
    -fx-stroke: -color-border-light;
}

jabgui/src/main/resources/org/jabref/gui/theme/internal/jabref-base.css[1193-1195]

.group-icon-picker .grid-cell:filled {
    -fx-border-color: -color-border-light;
    -fx-border-width: 1;
Potential damage 🟢 Low 🩹 Cosmetic

  • If the changed style-class assignment or CSS selectors were wrong, the group icon picker could have an incorrect background or border appearance, such as losing theme alignment or cell delineation.
  • The icon selection behavior and persisted icon identifier are unchanged, and no persistent data, external effect, or shared resource is modified.
  • Recovery is by reverting or correcting the UI code/CSS and shipping the UI update; no state repair or compensation is required.
  • Fully recoverable through a code/CSS revert or follow-up release.
  • Existing group data and selected icon identifiers are unaffected.
Sources

jabgui/src/main/resources/org/jabref/gui/theme/internal/jabref-base.css[1188-1191]

.popover.group-icon-picker > .border {
    -fx-fill: -color-bg-secondary;
    -fx-stroke: -color-border-light;
}

jabgui/src/main/resources/org/jabref/gui/theme/internal/jabref-base.css[1193-1195]

.group-icon-picker .grid-cell:filled {
    -fx-border-color: -color-border-light;
    -fx-border-width: 1;
Assessed commit 52f845e
Diagram

graph TD
  Theme["Theme preset"] --> Tokens["Theme colors"] --> CSS["Scoped picker CSS"] --> Popup["Popover border"]
  Editor["Group editor"] --> CSS
  CSS --> Cells["Filled icon cells"]
Loading
High-Level Assessment

Keep the picker-specific CSS approach: it uses existing theme tokens, responds to theme changes, and avoids changing unrelated ControlsFX popovers. A global popover override would broaden the effect without addressing a broader requirement.

Files changed (4) +125 / -5

Bug fix (2) +13 / -5
GroupDialogView.javaMark the icon popover for scoped styling +1/-5

Mark the icon popover for scoped styling

• Adds a dedicated style class to the icon picker popover and removes the hard-coded black border from icon cells.

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

jabref-base.cssApply theme colors to the icon picker +12/-0

Apply theme colors to the icon picker

• Uses theme background and border tokens for the marked popover and theme border tokens for its filled grid cells. Selectors are scoped to the group icon picker.

jabgui/src/main/resources/org/jabref/gui/theme/internal/jabref-base.css

Tests (1) +111 / -0
GroupIconPickerThemeTest.javaTest picker colors across themes and scheme changes +111/-0

Test picker colors across themes and scheme changes

• Opens the real Group Editor picker and compares its popover and cell colors with themed reference styles. Covers JabRef, Nord, and Primer while switching dark to light to dark.

jabgui/src/test/java/org/jabref/gui/theme/GroupIconPickerThemeTest.java

Documentation (1) +1 / -0
CHANGELOG.mdDocument the group icon picker theme fix +1/-0

Document the group icon picker theme fix

• Adds an end-user changelog entry linking the issue.

CHANGELOG.md

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

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

Copy link
Copy Markdown
Contributor

Code Review by Qodo

Grey Divider

Resolved findings
1. PR body claims a regression test that is no longer in the diff ⊘ Outdated Low
Description
The PR description says a new regression test fails on the original white popup and passes with the
fix, but commit 3 ('Remove icon picker theme test as requested in review') removed that test, so the
final diff has no test covering the popup styling. The fix is CSS-only and tied to ControlsFX
PopOver internals, so a future theme or library change could silently bring the white background
back, and reviewers reading the description would assume it is guarded.

2. Icon picker test may inspect a stale popup window ✓ Resolved Low
Description
The test looks up the first PopOver in Window.getWindows() and never hides the popup it opens,
so each parameterized run and any other test that leaves a popover open can make findFirst()
return a different window than the one just opened. The assertions would then check a picker from
another scene, which can make the regression test pass or fail for the wrong reason.

Grey Divider

Tip of the day
💡 Did you know, you can show, collapse, or hide each part of a finding: code, evidence, and all

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

@github-actions github-actions Bot added the status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers label Nov 24, 2026
@calixtus

Copy link
Copy Markdown
Member

Remove the test please. Too much ai slop.

koppor
koppor previously requested changes Nov 24, 2026

@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.

As carl said: remov the tests - the other things look good

@github-actions github-actions Bot added status: changes-required Pull requests that are not yet complete and removed status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers labels Nov 24, 2026
@github-actions github-actions Bot added size: small and removed size: medium status: changes-required Pull requests that are not yet complete labels Nov 24, 2026
@doraem-on
doraem-on requested a review from koppor November 24, 2026 08:02
@github-actions github-actions Bot added the status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers label Nov 24, 2026
@Siedlerchr
Siedlerchr enabled auto-merge November 24, 2026 08:30
@Siedlerchr
Siedlerchr added this pull request to the merge queue Nov 24, 2026
@github-actions github-actions Bot added status: to-be-merged PRs which are accepted and should go into the merge-queue. and removed status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers labels Nov 24, 2026
Merged via the queue into JabRef:main with commit d058450 Nov 24, 2026
89 of 90 checks passed
@jabref-machine

Copy link
Copy Markdown
Collaborator

Successfully created backport PR for black-forest:

@github-actions github-actions Bot added the status: changes-required Pull requests that are not yet complete label Nov 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component: css component: groups component: theming component: ui dev: send-to-black-forest Port to the black-forest branch of JabRef/jabref-black-forest after merging (ADR-0073) size: small status: changes-required Pull requests that are not yet complete 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.

Icon Picker in group editor is not styled correctly

5 participants