Skip to main content

Module redock_origin

Module redock_origin 

Source
Expand description

Where a torn-off pane came from, and where a redock puts it back (SPEC_FLOATING_PANE_REDOCK_TO_ORIGIN_2026_11_03.md).

At tear-off the source tab’s tree is read before the pane leaves it, and a small record goes into the block’s meta (floater:origin, persisted with the block): the tab, the pane’s tab-mate if one stays, and up to four neighbouring panes (nearest first) with the split axis, side and size share the pane had next to each. A redock by the button walks that record against the origin tab’s tree as it is now and returns the first place that still exists; with none left it does what it always did. The functions that read and decide are pure, over a LayoutNode.

Structs§

Anchor 🔒
A neighbouring pane the torn-off pane can be put back beside.
OriginRecord 🔒
Where a floating pane was torn from.

Enums§

Resolution 🔒
Where a redock puts the pane.

Constants§

FRACTION_RANGE 🔒
The share of the two panes’ size the torn-off pane may take back, so a stale or odd size never gives a sliver or hides the neighbour.
MAX_ANCHORS 🔒
How many neighbours are remembered.
META_KEY 🔒
The block meta key that holds an OriginRecord.

Functions§

clear 🔒
Drop the record from each of these blocks: the pane is docked again, by whatever path, or a new tear-off has nothing to remember and must not leave an older record to be found later.
first_shown_block 🔒
The visible block of the first pane under node that is not a minimized chip.
patch_block_meta 🔒
path_to 🔒
The nodes from the root down to the pane holding block_id, as (parent, index of the child on the path), and that pane.
place_at_anchor 🔒
Put block_id beside the neighbour anchor names, on its recorded side and with its recorded share. Falls back to the layout’s next free place when that pane is gone by now (place_block).
record_for 🔒
The record for the blocks about to be torn out of tab_id, read from srv’s tree. Call before they leave it.
record_from_tree 🔒
The record for a pane about to leave tab_id: torn are the blocks that leave, the first being the one the record is stored on. None when there is nothing to come back to (a pane alone in its tab, with no tab-mate).
remember 🔒
Keep rec on the blocks that just left, or, when there is none to keep, drop any older one they carry.
resolve 🔒
Where rec puts the pane back, given the origin tab’s tree as it is now. A tab-mate that is still in a pane wins (the pane never left); else the first neighbour that is still a shown pane, which is the nearest one since the list is ordered by nearness; else Fallback. “Beyond recognition” is exactly that last case: the tab is gone (the caller’s check), or no recorded neighbour is a pane of it that is not a chip.
resolve_for_block 🔒
The record on block_id and where it resolves to now. None: no record, or its tab is gone or its workspace is open in no window (the pane would go where nobody sees it), which a caller treats as Fallback.
share 🔒
store 🔒
Keep rec on each of the blocks that left (whichever one a redock asks about finds it), so it survives a restart.
target_for 🔒
Where a redock by the button goes: the origin’s tab and workspace and how the pane is placed there, or, when nothing is recognisable, the tab the caller named and Fallback.