Area of preview on hover should be shrink to the size of the text displayed
Closes #12351
This PR improves the sizing behavior of the entry-table tooltip when the preview feature is enabled. Previously, the tooltip became significantly larger than the actual preview content due to missing layout constraints. The fix adjusts the tooltip container and the PreviewViewer sizing logic so the tooltip now adapts to its preferred size and remains compact.
Steps to test
Open Preferences → Entry preview.
Enable: “Show preview in entry table tooltip”.
Hover over any entry in the main table.
Observe that the tooltip now:
matches the size of the preview content,
no longer grows excessively,
remains readable and compact.
Mandatory checks
- [x] I own the copyright of the code submitted and I license it under the MIT license
- [x] I manually tested my changes in running JabRef (always required)
- [x] I added JUnit tests for changes (if applicable)
- [x] I added screenshots in the PR description (if change is visible to the user)
- [x] I described the change in
CHANGELOG.mdin a way that is understandable for the average user (if change is visible to the user) - [x] I checked the user documentation: Is the information available and up to date? If not, I created an issue at https://github.com/JabRef/user-documentation/issues or, even better, I submitted a pull request updating file(s) in https://github.com/JabRef/user-documentation/tree/main/en.
Hey @samol123456!
Thank you for contributing to JabRef! Your help is truly appreciated :heart:
We have automated checks in place, based on which you will soon get feedback if any of them are failing. In a while, maintainers 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.
Please re-check our contribution guide in case of any other doubts related to our contribution workflow.
Okay we are going to fix it
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.
@samol123456 Please use English words for commit messages (in future)