Fix #12351: Improved tooltip responsiveness and removed empty space in entry preview#14973
Conversation
|
Hey @lithincg! 👋 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. |
PR Compliance Guide 🔍Below is a summary of compliance checks for this PR:
Compliance status legend🟢 - Fully Compliant🟡 - Partial Compliant 🔴 - Not Compliant ⚪ - Requires Further Human Verification 🏷️ - Compliance label |
|||||||||||||||||||||||||
PR Code Suggestions ✨Explore these optional code suggestions:
|
||||||||||||
|
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. |
90ef08b to
d594ea3
Compare
ee2dbe8 to
34155e1
Compare
|
I apologize for the commit clutter and force pushes earlier. This is my first PR, and got a bit caught up in merge conflicts and formatting issues. I have made the changes as requested and fixed the CHANGELOG.md formatting as well. The tests seem to be passing now(except the "Binaries / comment-on-issue-and-pr (pull_request)" . I am not sure if it is related to my code tho). |
|
No worries, it's okay. |
…n entry preview (#14973) * Fix #12351: Shrink entry preview tooltip area to fit content * Update changelog * Fix changelog spacing and java formatting * Move tooltip resizing logic into PreviewViewer * fix: increase tooltip width to 750px to handle extreme cases * Use _ --------- Co-authored-by: Oliver Kopp <kopp.dev@gmail.com>
calixtus
left a comment
There was a problem hiding this comment.
Everything looks good to me except one magic number. Then good to merge. Thanks.
|
Thank you for the reviews and helpful suggestions in this PR! |


User description
Closes
Closes #12351
Description
This PR improves the entry preview tooltip in the main table by dynamically adjusting its height to fit the citation content.
I refactored the layout to align with JavaFX's encapsulation principles: the resizing logic is now owned by PreviewViewer, while the Tooltip manages the window sizing. This eliminates the "ghost" space (giant empty dark boxes) and removes redundant labels for a cleaner, more responsive UI.
Steps to test
Steps to test
Before:

After:

Mandatory checks
CHANGELOG.mdin a way that is understandable for the average user (if change is visible to the user)PR Type
Enhancement, Bug fix
Description
Dynamically adjusts tooltip height to fit citation content via WebView listener
Removes redundant field label from preview tooltip for compact display
Executes JavaScript to measure actual content height and resize WebView accordingly
Sets fixed width (600px) and calculates height based on rendered content
Diagram Walkthrough
File Walkthrough
MainTableTooltip.java
Implement dynamic WebView height calculation for tooltipsjabgui/src/main/java/org/jabref/gui/maintable/MainTableTooltip.java
VBoxlayout with directWebViewextraction fromPreviewViewerheight based on rendered content
fieldValueLabelfrom preview tooltip displayadjustment
PreviewViewer.java
Expose WebEngine accessor methodjabgui/src/main/java/org/jabref/gui/preview/PreviewViewer.java
getEngine()method to exposeWebEnginefrom internalpreviewViewcontent measurement
CHANGELOG.md
Document tooltip improvement in changelogCHANGELOG.md
space removal