pub(crate) async fn reattach_window_agents(
state: &AppState,
workspace_id: &str,
parked: &[String],
) -> usizeExpand description
A closed window reopening: the agent blocks it parked at its close (parked, from its closed-window
record) go back into the tab they were parked from, where their layout leaf still is. A block that is
not parked any more (its agent was opened elsewhere, or deleted) is not brought back, and its leaf is
removed from the window’s layout so the window doesn’t show the agent twice. A block already back in
one of its tabs (the reopen is tried again until the window shows) is left as it is. Returns how many
came back.