Skip to main content

Module pane_singleton

Module pane_singleton 

Source
Expand description

A management pane (Settings, Vault, Kanban…) is opened once per window (REPORT_ACTION_RESULTS_ALWAYS_VISIBLE_ACROSS_WINDOWS_2026_10_31.md §4, step 6b). A pane.open for one that the window of the tab already has returns that pane with created: false, so an agent that opens Settings again and again leaves one pane, not a stack of them. new: true asks for another on purpose. A pane in another window doesn’t count, and existing duplicates are left alone.

Constants§

SINGLETON_VIEWS 🔒
The built-in management views, as BUILTIN_SINGLETON_VIEWS in frontend/app/store/widget-singleton.ts has them (a test keeps the two equal). A view that a widget entry flags singleton is the window’s to enforce: srv doesn’t read widgets.json.

Statics§

OPENING 🔒
Held from the lookup until the new pane is stored, so two opens of a management view at once don’t both find none and each make one. Opens of other views, and new: true, never wait on it.

Functions§

apply_to_existing 🔒
Give the pane the window already has what this open asked of it (reuse_patch).
in_window 🔒
The pane of view in the window that shows tab_id, as (block id, its tab id).
reuse_patch 🔒
What an open of view asks of the pane the window already has: the filter keys of the Kanban (kanban:waits, and kanban:open, the card to show), which a redirected open of Reviews carries. Nothing for any other view, and nothing for a Kanban open that names none, so a plain open leaves the pane as the person left it.
stands_for 🔒
The view a stored meta.view stands for. A Reviews pane saved before it was folded into the Kanban keeps reviews in its meta while it renders as the Kanban, so it is the window’s Kanban (pane_open_steps).
wants_existing 🔒
Whether this open should bring back the window’s pane of the view instead of making one. Floating, stacked and unplaced opens put the block somewhere on purpose, so they always create.