Overview
Implement session persistence, multi-project support, and direct manifest file watching (inotify) to match macOS app behavior.
Session Persistence
Match PPG CLI/PPG CLI/DashboardSession.swift:
- Persist terminal/agent entries and grid layouts to
.ppg/dashboard-sessions.json
SessionData { entries: Vec<TerminalEntry>, gridLayouts: HashMap<String, GridLayoutNode> }
TerminalEntry { id, label, kind, parent_worktree_id, working_directory, command, tmux_target, session_id, grid_owner_entry_id, variant_id }
- Debounced writes (1 second) via
glib::timeout_add_seconds
- Synchronous flush on app quit (
connect_shutdown)
- Restore sessions on relaunch: reconnect to tmux windows, rebuild pane grids
Multi-Project Support
Match PPG CLI/PPG CLI/Models.swift (OpenProjects):
Vec<ProjectContext> persisted to config dir
- Each project has its own manifest, dashboard session, and manifest watcher
- Sidebar shows all open projects' trees
- Ctrl+1-9 switches to project's first item
- "Open Project" action adds a project to the list
- "Close Project" removes from list
Manifest File Watching
Match PPG CLI/PPG CLI/SidebarViewController.swift (ManifestWatcher):
- Use
gio::FileMonitor (wraps inotify on Linux) to watch .ppg/manifest.json
- On change: debounce 200ms, then re-read manifest, apply tree diff to sidebar
- Safety fallback: 3s polling timer in case inotify misses events (file recreated)
- Also receive WebSocket
manifest_updated events as a complement
Prerequisite Checks
Match PPG CLI/PPG CLI/SetupViewController.swift:
- On launch, check
ppg --version and tmux -V (tmux ≥ 3.5)
- If missing: show setup screen with install instructions
ppg: npm install -g pure-point-guard
tmux: sudo apt install tmux / sudo dnf install tmux
Acceptance Criteria
Overview
Implement session persistence, multi-project support, and direct manifest file watching (inotify) to match macOS app behavior.
Session Persistence
Match
PPG CLI/PPG CLI/DashboardSession.swift:.ppg/dashboard-sessions.jsonSessionData { entries: Vec<TerminalEntry>, gridLayouts: HashMap<String, GridLayoutNode> }TerminalEntry { id, label, kind, parent_worktree_id, working_directory, command, tmux_target, session_id, grid_owner_entry_id, variant_id }glib::timeout_add_secondsconnect_shutdown)Multi-Project Support
Match
PPG CLI/PPG CLI/Models.swift(OpenProjects):Vec<ProjectContext>persisted to config dirManifest File Watching
Match
PPG CLI/PPG CLI/SidebarViewController.swift(ManifestWatcher):gio::FileMonitor(wraps inotify on Linux) to watch.ppg/manifest.jsonmanifest_updatedevents as a complementPrerequisite Checks
Match
PPG CLI/PPG CLI/SetupViewController.swift:ppg --versionandtmux -V(tmux ≥ 3.5)ppg:npm install -g pure-point-guardtmux:sudo apt install tmux/sudo dnf install tmuxAcceptance Criteria