Skip to content

Godot-style dock layout: side pane tabs left, entry editor right - #766

Draft
koppor wants to merge 44 commits into
mainfrom
godot-dock-layout
Draft

koppor wants to merge 44 commits into
mainfrom
godot-dock-layout

Conversation

@koppor

@koppor koppor commented Sep 9, 2026

Copy link
Copy Markdown
Member

Summary

Prototype of a Godot-editor-like main window: the side pane becomes a row of dock tabs on the left (groups, web search, OpenOffice/LibreOffice; drag to reorder, X to hide), the entry editor docks on the right instead of below the entry table, and checkboxes are drawn as filled boxes without a border. Plain JavaFX TabPane/SplitPane, no docking library; the flat dock styling is token-only CSS and therefore applies to every theme, the checkbox restyle only to the JabRef theme.

Open follow-ups (not in this PR, see PLAN.md on the branch): a preference to switch between the classic and the docked layout, remembering the selected dock tab, moving the entry editor's vertical toolbar to the top of the dock.

Dock layout

jabref-contrib-policy:4.2:reviewed​:ok

Analogies: Like honey, the docks stick together in one split pane instead of dripping down the window. Like chocolate, the tab strip is flat and breaks cleanly along its edges, with no borders in between. Like the moon, the entry editor now rises on the right, where the classic layout only ever showed an empty sky.

Steps to test

  1. Start JabRef and open any library.
  2. The left dock shows "Web search" and "Groups" as tabs with icons; click a tab to switch.
  3. Drag the "Groups" tab in front of "Web search", restart JabRef: the order is kept.
  4. Click the X on a dock tab: the pane hides. View > Toggle web search brings it back and selects it.
  5. Double-click an entry: the entry editor opens as a dock on the right of the entry table.
  6. Drag the divider between table and editor, restart: the width is kept.
  7. Open File > Preferences: the checkboxes are filled boxes without a border, the selected ones filled with the accent color.

Checkboxes

Related issues and pull requests

Prototype requested by koppor, no issue. Builds on the tab restyle of JabRef#17071.

AI usage

Claude Code (model claude-fable-5-1), AIL4: the whole change was written by the agent from the user's brief and screenshots were produced under Xvfb; the user reviews the result.

AI CHECKLIST.md walkthrough

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). (no new classes)
  • 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(...).
  • [/] 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). (only removed strings)
  • 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

  • [/] Behavior changes in org.jabref.model / org.jabref.logic have added or updated tests. (GUI only; SidePaneViewModelTest covers the new reorder)
  • 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). (LocalizationConsistencyTest + jabgui sidepane/frame/preferences/entryeditor/theme/walkthrough tests under Xvfb)
  • ./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). (prototype)
  • [/] 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.

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

🤖 Generated with Claude Code

https://claude.ai/code/session_017MRditeYFDXHjiR6iyibin

test and others added 30 commits July 27, 2026 16:22
Runs daily (and on demand) and merges a configurable list of branches from
JabRef/jabref and JabRef/jabref-koppor on top of the existing
all-branches-merged branch.

Branches that have disappeared and branches that conflict are reported via
::warning and skipped, so one dead or conflicting branch does not stop the
remaining merges.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AiaGjSfwh9uqDGtbW8tLfU
The branch only exists on JabRef/jabref, not on the koppor fork, so the
previous koppor/ entry warned and skipped on every run.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AiaGjSfwh9uqDGtbW8tLfU
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AiaGjSfwh9uqDGtbW8tLfU
The branch was deleted upstream after JabRef#16151 merged.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016Ww52ZvR7zTL8ZnLHBWhkQ
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014f69UBH8mjRLVQHs7CgnFj
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HKn7io1Av1DrQyqCRqEAWY
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HKn7io1Av1DrQyqCRqEAWY
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QP88ao94XmLMgPK1weN1HS
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018zp2dm93rwWgk6KAy2nm1D
Add PR link comments after each branch entry so the merge source is traceable.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JD6B4ZoMN5d4Ejk9ys37mf
directory-rest-api is the tip of that stack and contains it, so the same conflict was reported twice.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Vr3E1Gg5DRU4LQDDVnhPys
origin/keyword-separator-per-library (JabRef#16835) and
origin/show-diff-button (JabRef#16832) no longer exist on either
remote; last night's run warned about both. Upstream has landed the
keyword-separator work itself, so experimental picks it up via
origin/main.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NPHwSBqteEYM7E2QgWhk8U
…list

origin/common-style (JabRef#16708), origin/fulltext-context-menu
(JabRef#16829) and origin/fulltext-download-background-task
(JabRef#16831) no longer exist upstream; last night's run warned
about all three.

Upstream has landed each of them itself: the StyleClasses migration, the
GroupChangeDetailsView extraction and the background full text search
(req~fetchers.fulltext-background-search~1) all arrived via origin/main,
so experimental keeps the work without the branches.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KEfEAwaU63aKf2XzAKa7p8
koppor and others added 11 commits September 8, 2026 00:34
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017MRditeYFDXHjiR6iyibin
The side pane becomes a TabPane of docks (closable, drag-reorderable) instead of stacked
panels with up/down buttons, and the entry editor moves from the bottom into a right dock
of the same split pane. Docks get a flat Godot-like tab style, checkboxes a filled
borderless box.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017MRditeYFDXHjiR6iyibin
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017MRditeYFDXHjiR6iyibin
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017MRditeYFDXHjiR6iyibin
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017MRditeYFDXHjiR6iyibin
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017MRditeYFDXHjiR6iyibin

koppor commented Sep 13, 2026

Copy link
Copy Markdown
Member Author

🤖 Generated with Claude Code

Merging origin/main into this branch conflicts in 2 files. I did not push a resolution — one side needs a human decision.

  • jabgui/src/main/resources/org/jabref/gui/theme/jabref-theme.css (modify/delete) — main deleted this file in "Drop the frame around tabs and give the check box its own border token" (Drop the frame around tabs and give the check box its own border token jabref#17071), and the JabRef theme now lives in the jabgui/src/main/themes.jabref.org submodule. There is no .check-box rule left anywhere in this repo, so this PR's Godot-style check box restyling has no file here to move to; re-applying it means a change in the themes repository, not a merge resolution. Accepting main's deletion instead would silently drop the PR's intent.
  • jabgui/src/main/java/org/jabref/gui/sidepane/GroupsSidePaneComponent.java (content) — this PR drops moveUpCommand/moveDownCommand from the constructor and sets the walkthrough id on getContainer(); main keeps those parameters and switched to setId(WalkthroughNodeIds.GROUPS_SIDE_PANE). Combining them is plausible (getContainer().setId(WalkthroughNodeIds.GROUPS_SIDE_PANE)), but it depends on how the dock layout is meant to expose the walkthrough target, so I left it to you.

No compile check was run.


Generated by Claude Code

koppor commented Sep 14, 2026

Copy link
Copy Markdown
Member Author

🤖 Generated with Claude Code

Update to my note of 2026-09-13: a third file now conflicts. Still not pushed; git merge --abort.

New since then — main landed "Fix sidebar width drifting when side panels are toggled" (JabRef#17102, 9bbf645a58), which conflicts with this PR in jabgui/src/main/java/org/jabref/gui/frame/JabRefFrame.java. Both sides reworked the same two methods: main added unsubscribeHorizontalDivider() plus a rapid-toggle guard in updateHorizontalDividerPosition() and tests sidePane.getChildren().isEmpty(), while this PR replaces that method with updateDividerPositions() handling both dock dividers and tests sidePane.getTabs().isEmpty(). Picking either loses the other's behaviour, so it needs your call on how the dock layout should track divider state.

The two conflicts from my earlier note are unchanged (jabref-theme.css modify/delete, GroupsSidePaneComponent.java content).


Generated by Claude Code

koppor commented Sep 16, 2026

Copy link
Copy Markdown
Member Author

🤖 Generated with Claude Code

Update to my note of 2026-09-14: still not pushed (git merge --abort). Six files now conflict, but the blocking pair is unchanged.

Genuinely blocking, both need your call:

  • jabgui/.../frame/JabRefFrame.java — main's updateHorizontalDividerPosition() + unsubscribeHorizontalDivider() vs this PR's updateDividerPositions(); picking either loses the other's behaviour.
  • jabgui/.../theme/jabref-theme.css — modify/delete: this PR deletes the file, main edited it in Drop the frame around tabs and give the check box its own border token jabref#17071 (tab frame / check-box border token). Where those rules belong in the dock layout is a design decision.

New since 2026-09-14, all mechanical: SidePane.java and SidePaneComponent.java conflict only because main's OpenRewrite run (JabRef#17117) renamed lambda parameters to _ in code this PR rewrites or deletes; GroupsSidePaneComponent.java additionally wants main's new WalkthroughNodeIds.GROUPS_SIDE_PANE constant in place of the "groups-side-pane" literal; .github/workflows/update-experimental.yml takes main's version outright. I resolved none of them, since the two above block the merge anyway.


Generated by Claude Code

# Conflicts:
#	.github/workflows/update-experimental.yml
#	jabgui/src/main/java/org/jabref/gui/frame/JabRefFrame.java
#	jabgui/src/main/java/org/jabref/gui/sidepane/GroupsSidePaneComponent.java
#	jabgui/src/main/java/org/jabref/gui/sidepane/SidePane.java
#	jabgui/src/main/java/org/jabref/gui/sidepane/SidePaneComponent.java
#	jabgui/src/main/resources/org/jabref/gui/theme/jabref-theme.css

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JQLhzuyHc67mW7AgrhBMyD

koppor commented Sep 28, 2026

Copy link
Copy Markdown
Member Author

🤖 Generated with Claude Code

Merged main into this branch to resolve the merge conflicts. Six files conflicted:

  • SidePane.java, SidePaneComponent.java — kept this branch's versions. main's only changes here were lambda parameter renames (e → _) inside the createHeaderView() code this branch replaces with setToolbar(Node).
  • GroupsSidePaneComponent.java — kept this branch's 3-arg super(...) and getContainer().setId(...), but switched the id to main's new WalkthroughNodeIds.GROUPS_SIDE_PANE constant (same value "groups-side-pane"; WalkthroughNodeIdsTest asserts the constant is referenced from this file). Dropped addExtraNodeToHeader, which this branch replaced with the toolbar HBox.
  • JabRefFrame.java — kept this branch's updateDividerPositions()/bindDivider (which already unsubscribes on every call, so main's unsubscribeHorizontalDivider() has no counterpart). I did carry main's fix across into bindDivider: divider positions of exactly 0 or 1 are no longer written to the preferences, since they occur while a dock is added or removed.
  • .github/workflows/update-experimental.yml (add/add) — took main's version wholesale. This branch's copy is an older snapshot that arrived through a koppor/main merge, not part of this PR's change.
  • jabgui/.../theme/jabref-theme.css (modify/delete) — accepted main's deletion. main removed the whole 953-line theme in Drop the frame around tabs and give the check box its own border token jabref#17071 (271b1face7), and no file in main defines .check-box any more, so there is no renamed target to re-apply to. That means this PR's Godot-style check-box styling is not in the merge — if you still want it, it has to be re-applied to theme/internal/jabref-base.css.

Verified by diffing each resolved file against both sides; no build run here (Gradle dependency resolution is blocked in this environment), so CI is the compile check.


Generated by Claude Code

# Conflicts:
#	jabgui/src/main/java/org/jabref/gui/frame/JabRefFrame.java

koppor commented Nov 13, 2026

Copy link
Copy Markdown
Member Author

🤖 Generated with Claude Code

Merged origin/main into this branch to resolve the merge conflict; pushed as a merge commit.

One file conflicted: jabgui/src/main/java/org/jabref/gui/frame/JabRefFrame.java, in the import block — this branch adds java.util.function.DoubleConsumer, main adds java.util.function.Consumer.

Resolved by keeping both: Consumer is used by main's navigateHistory(...) and DoubleConsumer by this branch's bindDivider(...). The CHANGELOG.md and the l10n property files merged cleanly on their own.

No build was run here — dependency resolution is blocked in this environment — so CI is the compile check.


Generated by Claude Code

koppor commented Nov 17, 2026

Copy link
Copy Markdown
Member Author

🤖 Generated with Claude Code

I did not push a merge of origin/main (59d6c1e95c) — unlike my 2026-11-13 note, this one is now a semantic conflict that needs your decision. git merge --abort.

Conflicting files: jabgui/src/main/java/org/jabref/gui/frame/JabRefFrame.java and jabgui/src/main/java/org/jabref/gui/sidepane/SidePaneComponent.java.

What makes it hard: both sides restructured the same layout code, in incompatible directions. SidePane is extends TabPane on this branch but extends VBox on main, so getTabs() and getChildren() cannot simply be combined. main (via JabRef#17592, "Menu not visible on small screens") also wrapped the side pane in a new sidePaneScroll ScrollPane and introduced a verticalSplit that hosts the entry editor below the table, together with updateHorizontalDividerPosition() / unsubscribeHorizontalDivider() / updateVerticalDividerPosition() — whereas this PR's premise is the entry editor to the right, added straight into horizontalSplit. SidePaneComponent diverged the same way: this branch drops initialize() and adds getSidePaneType() for the Tab model, while main's initialize() now sets VBox.setVgrow and min-heights that a tab-based dock would not use.

Resolving it means deciding whether the dock layout adopts main's scroll wrapper and divider-subscription API and then re-implementing the tab dock on top of it — new code rather than a conflict resolution, so I left it alone. No build was run here; CI would be the compile check.


Generated by Claude Code

koppor commented Nov 19, 2026

Copy link
Copy Markdown
Member Author

🤖 Generated with Claude Code

Update to my note of 2026-11-17: origin/main has moved on to 304051bf9d, but the conflict is unchanged — still not pushed (git merge --abort).

Same two files, same reason: jabgui/src/main/java/org/jabref/gui/frame/JabRefFrame.java and jabgui/src/main/java/org/jabref/gui/sidepane/SidePaneComponent.java. SidePane is a TabPane here and a VBox on main, and main's sidePaneScroll/verticalSplit plus divider-subscription API assume the entry editor below the table, not to the right.

Resolving still means re-implementing the tab dock on top of main's new layout, which is new code rather than a conflict resolution. CI would be the compile check.


Generated by Claude Code

# Conflicts:
#	jabgui/src/main/java/org/jabref/gui/frame/JabRefFrame.java
#	jabgui/src/main/java/org/jabref/gui/sidepane/SidePaneComponent.java

koppor commented Nov 22, 2026

Copy link
Copy Markdown
Member Author

🤖 Generated with Claude Code

Merged origin/main into godot-dock-layout to resolve the merge conflicts.

Conflicting files: JabRefFrame.java and SidePaneComponent.java — both from main's side-pane sizing work (ScrollPane wrapper around the stacked side pane, setMinHeight(220) for the groups pane) landing on top of this PR's tab-dock rewrite.

Resolution: took this PR's version in both. The dock replaces the vertical VBox stack with a TabPane, so main's sidePaneScroll wrapper, verticalSplit and the initialize() min-height block have nothing left to apply to — and sidePane.getChildren() / updateHorizontalDividerPosition() no longer exist here. Main's unrelated NativeDesktop constructor wiring is kept in full. Also dropped the now-unused ScrollPane import so Checkstyle stays happy.

Worth a look: main's side-pane-scroll CSS rule is now unused, and if the groups pane should still have a minimum height inside a dock tab, that needs setting on the tab content rather than on the component.

CI is the compile check here.


Generated by Claude Code

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants