Skip to content

feat: split view (horizontal + vertical)#2

Merged
anbturki merged 1 commit into
mainfrom
feat/split-view
May 17, 2026
Merged

feat: split view (horizontal + vertical)#2
anbturki merged 1 commit into
mainfrom
feat/split-view

Conversation

@anbturki
Copy link
Copy Markdown
Owner

Summary

Two-pane reader layout for DocsReader. The user can toggle between single, side-by-side, and stacked, drag the splitter to resize, and each pane keeps its own tabs, scroll position, and external-change banner.

  • Header toggle group between the three modes, mirroring the diff-dialog and settings ToggleGroup pattern
  • New usePanes hook composes two useTabs instances and persists the PaneLayout
  • Pane 0 reuses the legacy tabsState storage key for zero-migration backward compat; pane 1 stores under tabsState.pane1
  • Collapsing back to single keeps pane 1's tabs in storage (round-trips losslessly across toggles)
  • "Open in other pane" context-menu entry; auto-enables horizontal split when collapsed
  • Outline tracks whichever pane is focused via a per-pane scroll-el array
  • Keyboard shortcuts: Cmd+\ horizontal, Cmd+Shift+\ vertical, Cmd+1 / Cmd+2 focus pane 0 / pane 1 (no-op inside form inputs)
  • Driven by react-resizable-panels v4 (orientation + onLayoutChanged with named panel ids)

Test plan

  • bun run build (tsc + vite) clean
  • cargo check clean
  • Toggle horizontal: pane 1 starts empty, sidebar clicks route to active pane, "Open in other pane" flips focus
  • Toggle vertical: stacked layout, drag the splitter, both panes resize without scroll loss
  • Independent scroll per pane
  • Outline tracks the focused pane's active tab
  • External-change banner appears only in the pane that owns the modified file
  • Restart preserves split mode, splitter position, both panes' tabs and active tabs, focused pane
  • Backward compat: existing v0.4.0 tabsState restores into pane 0 with split off
  • Shortcuts: Cmd+, Cmd+Shift+, Cmd+1, Cmd+2

Screenshots

See README - docs/screenshots/split.png (light), split-dark.png (dark side-by-side), horizontal-split.png (dark stacked).

…ientations

Two-pane reader layout: side-by-side or stacked. Each pane owns its
own tabs, scroll position, and external-change banner. The outline
tracks whichever pane is focused.

- New usePanes hook composes two useTabs instances and persists the
  PaneLayout (split mode, divider size, active pane). Pane 0 reuses
  the legacy tabsState storage key so existing tabs migrate with no
  user action; pane 1 lives under tabsState.pane1.
- Header toggle group switches between single, horizontal, and
  vertical. Cmd+\ toggles horizontal, Cmd+Shift+\ toggles vertical,
  Cmd+1 / Cmd+2 focus a pane. Shortcuts no-op while typing in inputs.
- "Open in other pane" context-menu entry auto-enables horizontal
  split when collapsed and routes the file to the inactive pane.
- ResizablePanelGroup driven by the v4 react-resizable-panels API
  (orientation prop, onLayoutChanged with named panel ids).
- Collapsing back to single keeps pane 1's tabs in storage so the
  layout round-trips losslessly across toggles.
@anbturki anbturki merged commit 5461019 into main May 17, 2026
1 check passed
@anbturki anbturki deleted the feat/split-view branch May 17, 2026 08:01
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.

1 participant