Skip to main content

replay_tabs

Function replay_tabs 

Source
pub(crate) async fn replay_tabs(
    state: &AppState,
    ws_id: &str,
    tabs: &[ReplayTab],
    log_ctx: &str,
) -> (Vec<Event>, Vec<Option<ReplayedTab>>)
Expand description

Rebuild tabs inside an existing workspace: per tab CreateTab, each block CreateBlock (its saved meta), then LayoutSetTree with the tree’s placeholders resolved to the new block ids. Shared by restore-on-relaunch (into a fresh workspace) and Layouts → Open layout… (into the current window’s) — SPEC_LAYOUT_FILES_2026_09_25.md §1.1.

Per-tab and per-block failures are logged and skipped, never fatal: a partially-stale input still rebuilds everything else. The returned vector is parallel to tabs (None = that tab didn’t come back). Events are applied to the store but not published — the caller does that.