Skip to content

Fix #14556 Removed the extra space occupied by the table.#15360

Merged
Siedlerchr merged 14 commits intoJabRef:mainfrom
OfficialArpitNege:fix-issue
Mar 28, 2026
Merged

Fix #14556 Removed the extra space occupied by the table.#15360
Siedlerchr merged 14 commits intoJabRef:mainfrom
OfficialArpitNege:fix-issue

Conversation

@OfficialArpitNege
Copy link
Copy Markdown
Contributor

Related issues and pull requests

Closes #14556

PR Description

  1. Removed the extra space occupied by the websearch table to improve the layout.
  2. The main intention was to make the interface cleaner.

Steps to test

  1. Open the app -> File -> Preferences -> Web Search
Screenshot 2026-03-18 023346

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

@github-actions
Copy link
Copy Markdown
Contributor

Hey @OfficialArpitNege! 👋

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
Copy link
Copy Markdown
Contributor

Review Summary by Qodo

Fix WebSearch table excessive whitespace and dynamic sizing

🐞 Bug fix ✨ Enhancement

Grey Divider

Walkthroughs

Description
• Fixed excessive whitespace in WebSearch table layout
• Implemented dynamic table height calculation based on content
• Added fixed cell size for consistent row rendering
• Table now adjusts height when items are added or removed
Diagram
flowchart LR
  A["WebSearchTab"] -->|"setFixedCellSize"| B["Table Row Height"]
  A -->|"adjustTableHeight"| C["Dynamic Height Calculation"]
  C -->|"header + rows + padding"| D["Optimized Layout"]
  E["Item Changes"] -->|"InvalidationListener"| C
Loading

Grey Divider

File Changes

1. jabgui/src/main/java/org/jabref/gui/preferences/websearch/WebSearchTab.java 🐞 Bug fix +14/-0

Dynamic table height and fixed cell sizing

• Added constants for fixed table row height (30.0) and header height (32.0)
• Set fixed cell size on table to prevent variable row heights
• Implemented adjustTableHeight() method to dynamically calculate table dimensions
• Added listener to recalculate table height when items are added or removed

jabgui/src/main/java/org/jabref/gui/preferences/websearch/WebSearchTab.java


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

Document WebSearch table layout fix

• Added entry documenting the fix for WebSearch table extra space issue
• References issue #14556 with link to GitHub issue tracker

CHANGELOG.md


Grey Divider

Qodo Logo

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

qodo-free-for-open-source-projects bot commented Mar 17, 2026

Code Review by Qodo

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

Grey Divider


Action required

1. Websearch wording in changelog📘 Rule violation ✓ Correctness
Description
The new CHANGELOG entry uses the wording Websearch, which is inconsistent with the UI/tab name
Web search and reads like a typo. This is user-facing text and should be professional and precise.
Code

CHANGELOG.md[40]

+- We fixed an issue where the Websearch table had extra space, to improve the layout. [#14556](https://github.com/JabRef/jabref/issues/14556)
Evidence
PR Compliance ID 29 requires user-facing text to be free of typos and professionally written; the
added CHANGELOG entry contains inconsistent/typo-like wording (Websearch) for the feature name.

CHANGELOG.md[40-40]
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
The CHANGELOG entry uses inconsistent/typo-like wording (`Websearch`) in user-facing release notes.
## Issue Context
The UI uses `Web search` as the feature/tab name, so the release note should match and be professionally phrased.
## Fix Focus Areas
- CHANGELOG.md[40-40]

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



Remediation recommended

2. adjustTableHeight hard-codes heights📘 Rule violation ⛯ Reliability
Description
The table height is computed from hard-coded pixel constants and then forced via pref/min/max
heights, which can make the UI layout less responsive across DPI/themes/font sizes. This risks
reintroducing layout issues on different environments instead of relying on responsive layout
mechanisms.
Code

jabgui/src/main/java/org/jabref/gui/preferences/websearch/WebSearchTab.java[R186-191]

+    private void adjustTableHeight() {
+        double height = TABLE_HEADER_HEIGHT + (searchEngineTable.getItems().size() * TABLE_ROW_HEIGHT) + 2.0;
+        searchEngineTable.setPrefHeight(height);
+        searchEngineTable.setMinHeight(height);
+        searchEngineTable.setMaxHeight(height);
+    }
Evidence
PR Compliance ID 33 requires responsive UI layout and discourages hard-coded pixel constraints; the
new code introduces fixed pixel constants and forces the control height to an exact computed value
via pref/min/max height setters.

jabgui/src/main/java/org/jabref/gui/preferences/websearch/WebSearchTab.java[84-85]
jabgui/src/main/java/org/jabref/gui/preferences/websearch/WebSearchTab.java[186-191]
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
The current approach hard-codes pixel heights (`TABLE_ROW_HEIGHT`, `TABLE_HEADER_HEIGHT`) and forces the table size via `setPrefHeight`, `setMinHeight`, and `setMaxHeight`. This can reduce responsiveness across DPI/themes/fonts and conflicts with the guideline to avoid hard-coded pixel constraints.
## Issue Context
This change is meant to remove extra empty space, but should still behave well with different font sizes and UI scaling.
## Fix Focus Areas
- jabgui/src/main/java/org/jabref/gui/preferences/websearch/WebSearchTab.java[84-85]
- jabgui/src/main/java/org/jabref/gui/preferences/websearch/WebSearchTab.java[186-191]

ⓘ 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 first issue An issue intended for project-newcomers. Varies in difficulty. component: preferences labels Mar 17, 2026
@github-actions github-actions bot added the status: changes-required Pull requests that are not yet complete label Mar 17, 2026
@testlens-app

This comment has been minimized.

@testlens-app

This comment has been minimized.

@testlens-app

This comment has been minimized.

@github-actions github-actions bot added status: no-bot-comments status: changes-required Pull requests that are not yet complete and removed status: changes-required Pull requests that are not yet complete status: no-bot-comments labels Mar 18, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Your pull request conflicts with the target branch.

Please merge with your code. For a step-by-step guide to resolve merge conflicts, see https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/addressing-merge-conflicts/resolving-a-merge-conflict-using-the-command-line.

@testlens-app

This comment has been minimized.

@testlens-app

This comment has been minimized.

@github-actions github-actions bot added status: no-bot-comments and removed status: changes-required Pull requests that are not yet complete labels Mar 19, 2026

// Dynamic height based on font size and number of items
DoubleBinding rowHeight = Bindings.createDoubleBinding(
() -> enableWebSearch.getFont() != null ? enableWebSearch.getFont().getSize() * 2.5 : 30.0,
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.

Please use constants instead of magic numbers

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.

Thanks for the review! I’ve replaced the magic numbers with named constants (FONT_HEIGHT_MULTIPLIER, DEFAULT_ROW_HEIGHT, HEADER_HEIGHT_ESTIMATE) and added brief comments to clarify their purpose. The table layout still adapts dynamically to the font size.

@testlens-app

This comment has been minimized.

@github-actions github-actions bot added status: changes-required Pull requests that are not yet complete and removed status: no-bot-comments labels Mar 19, 2026
@testlens-app

This comment has been minimized.

@github-actions github-actions bot added status: no-bot-comments status: changes-required Pull requests that are not yet complete and removed status: changes-required Pull requests that are not yet complete status: no-bot-comments labels Mar 19, 2026
@testlens-app

This comment has been minimized.

@github-actions github-actions bot added status: no-bot-comments and removed status: changes-required Pull requests that are not yet complete labels Mar 20, 2026
@OfficialArpitNege
Copy link
Copy Markdown
Contributor Author

OfficialArpitNege commented Mar 21, 2026

Hi @calixtus if you have time could you please review this pr , Happy to make any changes if needed , Thanks.

@github-actions github-actions bot added status: changes-required Pull requests that are not yet complete and removed status: no-bot-comments labels Mar 25, 2026
@subhramit
Copy link
Copy Markdown
Member

subhramit commented Mar 27, 2026

@OfficialArpitNege please don't resolve comments yourselves as we use them for tracking requested changes

@testlens-app

This comment has been minimized.

searchEngineTable.fixedCellSizeProperty().bind(rowHeight);
searchEngineTable.prefHeightProperty().bind(
Bindings.size(searchEngineTable.getItems())
.add(HEADER_HEIGHT_ESTIMATE) // Estimate for header height
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.

redundant comment

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.

I have removed the redundant comment and commited the change ! Thanks for the review .

@github-actions github-actions bot added status: no-bot-comments and removed status: changes-required Pull requests that are not yet complete labels Mar 27, 2026
@testlens-app

This comment has been minimized.

@testlens-app
Copy link
Copy Markdown

testlens-app bot commented Mar 28, 2026

✅ All tests passed ✅

🏷️ Commit: 4ee1276
▶️ Tests: 10205 executed
⚪️ Checks: 55/55 completed


Learn more about TestLens at testlens.app.

@Siedlerchr Siedlerchr added this pull request to the merge queue Mar 28, 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 28, 2026
Merged via the queue into JabRef:main with commit 2cd41d8 Mar 28, 2026
55 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component: preferences 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.

Fix UI for configuring custom URLs

4 participants