write_default_three_pane_layout

Function write_default_three_pane_layout 

Source
pub(crate) fn write_default_three_pane_layout(
    store: &Store,
    tab_id: &str,
    agent_block_id: &str,
    sysinfo_block_id: &str,
    swarm_block_id: &str,
) -> Result<(), StoreError>
Expand description

Write the default 3-pane launch layout (agent | [sysinfo / swarm]) into tab_id’s LayoutState, wrapping three block IDs that the caller has ALREADY created.

Split out of seed_default_layout for the 2nd-window-tear-off desync fix (#1681). seed_default_layout creates its blocks store-only via create_block, which is correct for first-launch (ensure_initial_data runs before bootstrap loads SQLite into the in-memory reducer srv_state). But the post-bootstrap “open another window” path (service.rs CreateWindow) must create the blocks THROUGH THE REDUCER so they also land in srv_state; otherwise the new window’s blocks live only in SQLite, the frontend renders them, and TearOffBlock rejects them as “block not found” (the reducer never saw them). Both callers share this one function for the tree shape so the layout can never drift between the two paths.