Skip to main content

Module pin

Module pin 

Source
Expand description

workspace service handlers for pinning a pane to its window: PinBlockToWindow and UnpinBlockFromWindow (docs/specs/SPEC_PIN_TRANSFORM_FACILITY_2026_12_02.md §9). A pin is a flag: the pane stays in its tab and in that tab’s layout, and the page draws it over the other tabs at the place it has in its own. So a pin, and an unpin in the pane’s own tab, are one reducer command and change no layout. Unpinned in another tab, the pane moves into that tab: onto the edge it was on, at its own thickness.

Structs§

Undo 🔒
What a failed move_pane puts back: where each block sat in its tab’s list, and each tab’s layout row.

Constants§

FLOATING_WORKSPACE_META 🔒
The workspace meta key the tear-off saga sets on the workspace of a pane torn into a window of its own: a floating window has one pane and no tabs to follow, so a pane of it is not pinnable.

Functions§

handle_pin_block_to_window 🔒
PinBlockToWindow(workspaceId, blockId).
handle_unpin_block_from_window 🔒
UnpinBlockFromWindow(workspaceId, blockId, showingTabId): the tab that is showing takes the pane when it is not the pane’s own.
in_floating_window 🔒
Whether block_id is a pane of a floating window: the workspace of its tab carries the tear-off’s mark.
layout_row 🔒
A tab’s layout row as it is now (none when the tab has none).
mark_floating_window 🔒
Mark workspace_id, the workspace of a window a pane was just torn into, as a floating window’s. Not a step of the tear-off saga: the saga’s recovery has no inverse for a meta patch, and deleting the workspace removes the mark anyway.
move_pane 🔒
Move the pane stack (its tabs, in order; active shows) from tab src into tab dst, as a band on band‘s edge at its thickness: the blocks first, then out of the one layout and into the other. All or nothing: a step that fails puts back the blocks already moved, at their places in the source tab, and both tabs’ layouts.
move_pane_steps 🔒
pane_rect 🔒
Where the pane that holds block_id sits in its own tab, as fractions of the tab’s area: the place a pinned pane is drawn at in every tab. None when its tab’s layout does not hold it.
pin_block 🔒
Pin the pane that holds block_id to the window of workspace workspace_id. Nothing moves. Refused for a floating pane, and by the reducer’s rules.
pin_holding 🔒
The pin of the pane that holds block_id in workspace workspace_id: the pin of block_id itself, or of the tab of its stack that has one (only one tab of a pinned pane does).
pin_updates 🔒
The object updates a pin change owes the renderers: the tabs and their layouts (layouts first, as tear_off::redock_updates explains), then the workspace.
put_pane_back 🔒
Undo a move_pane that failed: each moved block goes back to its place in src (the earliest place first, so each lands where it was), then, when the layouts were reached, both layouts are set back as they were. Best effort: the caller is already returning the error that started it, and tells the windows what is left (pin_updates).
put_pins_back 🔒
Pin again each pane that was pinned and no longer is: the reducer unpinned it when it was placed alone in an empty tab. Run once the pane is back in its own tab (the reducer refuses a pin on the only pane of a tab, so before that it would be refused).
run_command 🔒
Run a command through the reducer, store its events and publish them. Its refusal is the error.
stack_in 🔒
The tabs of the pane that holds block_id in tab tab_id’s layout, in order, and the one showing. A pane with no stack (or a block the tree does not hold) is just itself.
stack_into_tab 🔒
The rest of a stack, in order, as tabs of the pane stack[0] that is already in tab_id’s layout; active shows.
unpin_block 🔒
Unpin the pane that holds block_id. In its own tab (or with no dst_tab_id) only the pin goes. In another tab, the tab that is showing, the pane and all of its stack of pane tabs become a pane of that tab first, on the edge it was on; its own tab keeps its other panes.