Properties3
Is BaseNo
Icon
Order
30Workspaces
Each native macOS window and each native tab is backed by a KytosWorkspace — an @Observable model holding a split tree of panes plus the focused pane.
KytosAppModel manages the mapping from window/tab UUIDs to workspaces.
Persistence
At shutdown, Kytos persists:
KytosAppModel_Windows_v7— the full workspace map (all windows, all panes)KytosAppModel_TabGroups_v1— native tab groupings
On relaunch:
- SwiftUI/AppKit restores each
NSWindowvia state restoration - Each window's UUID is restored by
WindowGroup(for: UUID.self) KytosAppModel.workspace(for:)reconnects the UUID to its workspace- UUID remapping handles cases where SwiftUI assigns new UUIDs on restore
- Tab groups are replayed via
addTabbedWindowafter windows register
Tab Restoration
Tab restoration uses a retry loop (attemptPendingTabRestoration) that:
- Fires every 0.1s, up to 40 attempts
- Waits for all windows in a group to register
- Orders them front
- Groups them with
addTabbedWindow - Skips if AppKit already grouped them
restoredWindowIDRemap and remapPendingTabGroups keep tab group data consistent when UUIDs change during restoration.
Widget Snapshots
KytosAppModel writes a JSON snapshot to the widget's sandbox container after state changes:
~/Library/Containers/me.jwintz.Kytos.KytosWidget/Data/Library/Application Support/Kytos/widget-snapshot.json
WidgetCenter.shared.reloadAllTimelines() is called immediately after writing.
