Skip to main content

Module pane_tabs

Module pane_tabs 

Source
Expand description

The Pane Tab edit commands (pane.moveTab, pane.moveTabs, pane.activateTab, pane.removeTab): resolve the block’s tab, dispatch the reducer command, publish, and queue the matching layout action for other views. Split out of pane.rs, which open_pane and the other pane commands fill.

Functions§

activate_tab 🔒
pane.activateTab: make block_id its pane’s visible tab (Command::LayoutStackActivate), then queue a stackactivate under the caller’s action id for any other view of the tab.
apply_pane_tab_command 🔒
Resolve block_id’s tab, then dispatch cmd → mstore → publish, the shape every pane-tab RPC shares. Returns the tab and whether the reducer changed anything.
edit_result 🔒
What a pane-tab RPC answers: the row’s version once the change is stored. A failed queue is logged, not returned: the tree change already happened.
move_tab 🔒
Core pane.moveTab logic — reorder cmd.block_id within its own pane, or move it into a different pane (Command::LayoutStackMove). Queues a stackmove layout action so any OTHER window/tab viewing the same db_layout sees the change (mirrors stack_onto_block_id’s stackpush queue above); the calling frontend applies its own optimistic local edit directly and skips the queued copy by its action_id. SPEC_PANE_TAB_DRAG_AND_DROP_2026_09_19.md §4.1, Phase 3.
move_tabs 🔒
Core pane.moveTabs logic: several tabs into one pane in one reducer edit (Command::LayoutStackMoveMany), then one queued stackmove per block (and a stackactivate when the visible tab is a member that did not move) so any OTHER window viewing the layout follows. The calling frontend has already made the same edit and skips every queued copy by its base action_id. SPEC_PANE_TAB_MULTI_SELECT_MOVE_AND_COLLAPSED_EXPAND_2026_10_24.md §5.
remove_tab 🔒
pane.removeTab: take block_id out of its pane — that one tab of a stack, or the pane with its last tab (Command::LayoutDeleteNodeByBlock) — then queue the delete under the caller’s action id. The block itself is closed by ClosePane, which the caller sends next. A block in no pane is a no-op: nothing is queued and the revision is 0.