Repository navigation
[Port to black-forest] Menu not visible on small screens - #25
Open
jabref-machine wants to merge 1 commit into
Open
jabref-machine wants to merge 1 commit into
jabref-machine wants to merge 1 commit into
Conversation
### Summary When the JabRef window has limited space, the Groups, Web search and OpenOffice/LibreOffice panels in the side pane could become unreachable. This change wraps the side pane in a JavaFX `ScrollPane`. After review feedback, the approach was simplified to avoid confusing scrollbars: - The groups list keeps a minimum height and uses its own existing scrollbar for long group lists. - Other panels keep their full height, so nothing is cut off. - The outer vertical scrollbar only appears when the window is too short for all panels together. It has a gap to the resize divider, so it no longer looks like part of it. - The horizontal scrollbar is kept, so wide content such as the OpenOffice buttons stays reachable when the side pane is narrow. - All unrelated formatting changes were removed from `JabRefFrame.java`. Known limitation: when the side pane is scrolled sideways, the "Add group" button scrolls with the content. Moving it next to the filter field would fix this, but it touches `GroupTreeView`, so it is better as a follow-up. ### Steps to test 1. Start JabRef with the development setup and open a library with many groups. 2. Open the Groups, Web search and OpenOffice/LibreOffice panels. 3. In a normal-sized window, verify that only the groups list has a vertical scrollbar and no second bar sits next to the divider. 4. Reduce the window height and verify that the groups list keeps a few rows, then an outer vertical scrollbar appears and all panels remain reachable. 5. Drag the divider to make the side pane narrow and verify that a horizontal scrollbar appears and all OpenOffice buttons can be reached. 6. Widen the side pane again and verify that the layout returns to normal. 7. Close and reopen the side pane from the View menu and verify that the divider position is remembered. ### Screenshots <img width="1262" height="392" alt="Image" src="https://github.com/user-attachments/assets/5a94aaa8-0974-48d7-89ee-300c33579e28" /> <img width="1261" height="685" alt="Image" src="https://github.com/user-attachments/assets/ffe423d9-ec90-4206-91d4-552758bf3c3f" /> **Normal window: only the groups list scrolls** TODO: add cropped screenshot of the side pane in a normal window **Short window: outer scrollbar as fallback** TODO: add cropped screenshot of the side pane in a short window ### Related issues and pull requests Closes JabRef#17470 ### AI usage I used Claude to help investigate the issue, suggest the `ScrollPane`-based implementation in `JabRefFrame.java` and `SidePaneComponent.java`, and adjust the layout and CSS after review feedback. I reviewed, tested and understand the code and take responsibility for it. <details> <summary>AI CHECKLIST.md walkthrough</summary> ## 1. Code self-review ### 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()`. - [x] 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. - [/] 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 - [/] `./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 - [x] `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. - [x] Searched [jabref/issues](https://github.com/JabRef/jabref/issues) and [jabref-koppor/issues](https://github.com/JabRef/jabref-koppor/issues) for a related issue; linked only on a confident match. - [/] 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 - [x] PR body built from `.github/PULL_REQUEST_TEMPLATE.md`, every section filled. - [x] All checklist items kept and marked `[x]`, `[ ]`, or `[/]`. - [x] "Steps to test" is a numbered list with a cropped screenshot of the result for every visible change; no video. - [x] All HTML comments removed from the PR body. - [/] PR created with `gh pr create --body-file <file>` (not `--body`). </details> ### Checklist - [x] I own the copyright of the code submitted and I license it under the [MIT license](https://github.com/JabRef/jabref/blob/main/LICENSE) - [x] 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 - [x] I manually tested my changes in running JabRef (always required) - [/] 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 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](https://docs.jabref.org/) for up-to-dateness and submitted a pull request to our [user documentation repository](https://github.com/JabRef/user-documentation/tree/main/en) --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: ThiloteE <73715071+ThiloteE@users.noreply.github.com> (cherry picked from commit 96eab00)
12 of 16 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Port of JabRef#17592 to
black-forest, see Branching strategy.If this PR is a draft, the cherry-pick conflicted: the conflicting files are committed with Git's conflict markers left in. Resolve the markers locally, push, and mark the PR ready.