CodeNomad/packages
Pascal André 1efe5e91d1
feat(desktop): persist and restore UI state across restarts (#578)
## Summary

- Restore the primary desktop client's window bounds, zoom, workspace
tabs, active sessions, drafts, bounded attachments, scroll positions,
and panel layout across launches.
- Keep additional Electron and Tauri processes independent: they still
start normally but do not read or write the shared native snapshot.
- Add translated settings to disable startup restoration or clear the
saved state.

## Implementation

- Persist a versioned, bounded snapshot atomically in Electron and
Tauri, preserving unknown future envelopes until an explicit clear.
- Elect one primary process with stale-owner recovery and process
identity checks, then protect renderer access with per-document
capability tokens.
- Flush renderer state before close, quit, reload, and app-owned
navigation with bounded failure handling and fresh token rotation.
- Reconcile partial or timed-out workspace hydration without losing
unsent prompt state or resurrecting explicitly cleared drafts,
attachments, sessions, or tabs.
- Correlate restore-created workspaces so cancellation and delayed SSE
events cannot produce ghost tabs.
- Harden workspace launch cancellation and cross-platform process
cleanup so failed starts cannot orphan detached POSIX, WSL, or Windows
children; incomplete shutdown exits nonzero.

The restored shell state remains local to the desktop client. Durable
semantic session properties continue to use OpenCode session metadata
separately.

## Validation

pm run typecheck --workspace @neuralnomads/codenomad
- Electron native suite: 43 passed
- Tauri suite: 54 passed
- Focused UI restore, reconciliation, attachment, authority, and race
suites passed
- Focused server workspace runtime, manager, process identity, route,
and shutdown suites passed
- pm run build
- pm run build:tauri
- git diff --check
- 16-pass adversarial review loop completed with final No findings
- extensivly optimized, tested and used day by day

## Platform notes

- Native menu reloads and app-owned navigation have awaited durability
guarantees. Browser-engine crashes or forced process termination remain
inherently best effort.
- Process cleanup uses identity-guarded platform adapters and fails
conservatively when target ownership cannot be proven.
2026-07-15 10:22:23 +01:00
..
cloudflare Min server 0.18.0 2026-06-21 20:09:49 +01:00
electron-app feat(desktop): persist and restore UI state across restarts (#578) 2026-07-15 10:22:23 +01:00
opencode-plugin Bump version to 0.18.0 2026-06-19 13:55:00 +01:00
server feat(desktop): persist and restore UI state across restarts (#578) 2026-07-15 10:22:23 +01:00
tauri-app feat(desktop): persist and restore UI state across restarts (#578) 2026-07-15 10:22:23 +01:00
ui feat(desktop): persist and restore UI state across restarts (#578) 2026-07-15 10:22:23 +01:00