feat: add invariant-safe workspace state

This commit is contained in:
Samuel Onoja committed 2026-09-24 11:06:53 +01:00
1 parent 4e4a44e210
commit 19abb033c5
2 files changed
+371

No files matched your search

+8
View File
@@ -2,6 +2,10 @@ use std::collections::{HashMap, HashSet};
use std::error::Error;
use std::fmt;
mod workspace;
pub use workspace::{Workspace, WorkspaceError, WorkspaceId, WorkspaceSet};
const MIN_SPLIT_RATIO: f64 = 0.05;
const MAX_SPLIT_RATIO: f64 = 0.95;
@@ -121,6 +125,10 @@ impl LayoutTree {
self.windows.contains_key(&window)
}
pub fn window_ids(&self) -> impl Iterator<Item = WindowId> + '_ {
self.windows.keys().copied()
}
pub fn insert(
&mut self,
window: WindowId,