Skip to content

Show several maps at once in a split window - #1

Merged
Suva merged 3 commits into
mainfrom
split-view
Nov 16, 2026
Merged

Suva merged 3 commits into
mainfrom
split-view

Conversation

@Suva

@Suva Suva commented Nov 16, 2026

Copy link
Copy Markdown
Owner

What

The window can now be split into panes, each showing a map of its own over the one vault.

  • ⇧⌘D (View › Split This Pane) splits the pane you are in, the long way of that pane: a wide screen first goes side by side, a half then goes one above the other, as far as each pane keeps about 360×280 pixels. ⇧⌘W or a pane's × closes it.
  • One pane is active: a click, scroll or pinch in a pane, or ⌃Tab / ⌃⇧Tab, makes it so. The keyboard, header, notes panel, search, export and pictures all work on the active pane.
  • ⌥-click a map in the sidebar or a breadcrumb, ⌥-double-click a portal, or ⌥⌘↓ on a Mac, opens it in the other pane (the one used last).
  • Dragging a node onto another pane's map moves it to that map, as one undo step.
  • ⌘Z straight after a split, with nothing changed in the vault since, closes the new pane instead of undoing an earlier edit. Splitting is otherwise not a step of the vault's undo.
  • The panes, their tiling and the dividers are kept in the session; sessions from before come back as one pane.

Why

To have two or more maps, or two parts of a large map, on screen at once, and to move branches between maps by dragging. One window with panes rather than several windows: each window would hold its own copy of the vault and its own undo, which would drift apart; panes share the one vault, saver, undo and agent door. The design and the steps are in PLAN.md, "Maps side by side".

How

  • src/ui/pane.svelte.ts: a pane's state (open map, selection, editing, view, back and forward), moved out of App.svelte.
  • src/ui/tiling.ts: how the panes share the room, a tree of splits; pure and tested. Panes are drawn in their own rectangles in one keyed list, so a view is never remade as the tree changes.
  • MapView and OutlineView take active, and only the active one answers the window's keys and clipboard or takes the focus. Per-view state is no longer module-level or page-wide: cameras are keyed by pane, the link arrow's id is the view's own, the outline finds rows within itself.
  • Undo, tidying of empty nodes and repair look at every pane. placeAcross in moves.ts does a drag between maps, refusing a map dropped into a map inside it.
  • Menu bar and Windows' ☰ menu have Split This Pane, Close This Pane, Next and Previous Pane, and Open Map in Other Pane. Off the Mac that last one names no key, as Ctrl+Alt+↓ turns the screen on some Windows computers.
  • README, CHANGELOG, AGENTS.md, the tour (a "Two maps at once" node) and the site's demo pictures are updated.

Testing

  • npm run check clean; npm run test:core 241 passing, new tests for the session, the tiling, cross-map drops and undo's sparing of other panes' nodes. No Rust changes.
  • Tried in npm run dev in the built-in browser: splitting and closing, ⌃Tab order, the undo guard both ways, keys and clicks reaching only the active pane, ⌃Tab from outline rows, title edits and dialogs, ⌥-open from all three places, divider drags, drags across with one and two nodes, copy and paste across, undo landing in another pane, deleting the map another pane shows, the session after reload.
  • The browser tool's drag jumps in two moves and synthetic events cannot take real pointer capture, so cross-pane drags were tried with stepped events routed as the capture would.

Not tried yet

The desktop app (npm start, WebKit): ⌃Tab reaching the page, a pinch making a pane active, the new menu items, and ⇧⌘D / ⇧⌘W acting once each (key and menu echo).

🤖 Generated with Claude Code

Suva and others added 3 commits November 16, 2026 03:32
⇧⌘D, or View › Split View, opens a second pane beside the first, or below
it when there is more room that way. Each pane has its own map, view, back
and forward; the one last clicked, or reached with ⌃Tab, is the one the keys,
the header and the notes work on. ⌥-click a map in the sidebar or the
breadcrumbs, or ⌥-double-click a portal, to open it in the other pane, and
drag a node across to move it to that map. Both panes, the split and the
divider are kept in the session.

The panes share the one vault, saver and undo. What belongs to one view is
kept on its pane (pane.svelte.ts) or the view's own instance, never in
module state, a page-wide id or a page-wide query. Undo selects in the pane
that shows what it touched, tidying spares every pane's nodes, and a pane
lets go of nodes that have gone. A drag across lands with placeAcross,
which refuses a map dropped into a map inside it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
⇧⌘D now splits the pane you are in, the long way of that pane, so a wide
screen first goes side by side and a half then goes one above the other, as
far as there is room. ⇧⌘W, or a pane's ×, closes the pane you are in; the
pane used before it becomes active. ⌃Tab goes round the panes left to right
and top to bottom, and "the other pane" for ⌥-click is the one used last.

How the panes share the room is a tree (tiling.ts), tested under Node and
kept in the session; two panes saved before come back as one split. Each
pane is drawn in its own rectangle in one keyed list, so its view is never
made again as the tree changes. ⌘Z straight after a split, with nothing
changed in the vault since, closes it rather than undoing an earlier edit.
A pane too small for the minimap has none.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Suva
Suva merged commit 7829a22 into main Nov 16, 2026
1 check passed
@Suva
Suva deleted the split-view branch November 16, 2026 02:07
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