Cline Window Management Primitives: State Persistence & Multi-Window Tracking

Cline adds window state persistence, multi-window tracking, and a factory pattern for BrowserWindow creation. Part 1 of a 3-part desktop infrastructure refactor.

Cline Window Management Primitives: State Persistence & Multi-Window Tracking

TL;DR

  • New window state persistence layer saves bounds, paths, and display affinity across restarts
  • Centralized window registry tracks all BrowserWindow instances with focus and lifecycle events
  • Window factory handles creation from persisted state with security checks for screen transitions

New

  • Window state persistence — Per-window bounds, last viewed path, and display affinity saved to userData on close and restored on launch
  • Multi-window registry — Centralized tracking of all BrowserWindow instances with focus tracking, lifecycle events, and batch operations (loadUrlInAllWindows, saveAllStates)
  • Window factory — Creates BrowserWindows from persisted state or defaults, handles disconnected screen transitions, enforces security via will-navigate origin checks
  • Native fallback UI — disconnected.html provides fallback interface for runtime crashes
  • Security bridge — Minimal preload.ts handles IPC channel setup with security boundaries

Part 1 of 3-way split from PR #372. Upcoming: runtime-orchestrator (372b), then main wiring (372c).

Source: Cline