Skip to main content

seed_default_layout

Function seed_default_layout 

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

Seed a tab with the default 3-pane launch layout (agent + sysinfo + swarm):

  ┌────────────────┬──────────────┐
  │                │   sysinfo    │  size 2 of 10 ≈ 20%
  │     agent      ├──────────────┤
  │    (tall)      │              │
  │                │    swarm     │  size 8 of 10 ≈ 80%
  │                │              │
  └────────────────┴──────────────┘
       50% width         50% width

Connectors and Memory aren’t in the starter set (each is one click away in the widget bar) and sysinfo moved above swarm, keeping its previous 20% share of the right column. Supersedes the 4-pane arrangement from SPEC_DEFAULT_WIDGETS_REORDER_2026_08_25.md. Only affects tabs seeded from here — first launch and newly-created windows; an existing persisted layout is untouched.

Shared by first-launch bootstrap (ensure_initial_data) and the new-window path (server::service’s CreateWindow with an empty workspace) so “Open another window” gets the same starter layout instead of opening blank (regression — see docs/retro/retro-blank-new-window-2026-06-21.md). The tab must already exist with a valid layoutstate; both create_tab_with_opts and the reducer’s apply_tab_created provision one.

rootnode is built directly rather than queued via pendingbackendactions: the frontend reducer races when draining multiple insert+split actions in one cycle (layoutPersistence.ts + layoutNodeModels.ts::getNodeByBlockId); a pre-built tree skips the reducer entirely and just renders.