Skip to content

Persist and restore multiple rulers#243

Closed
pascalpp wants to merge 2 commits into
codex/233-active-ruler-commandsfrom
codex/234-ruler-state-restoration
Closed

Persist and restore multiple rulers#243
pascalpp wants to merge 2 commits into
codex/233-active-ruler-commandsfrom
codex/234-ruler-state-restoration

Conversation

@pascalpp

Copy link
Copy Markdown
Owner

Implements #234 as part of #228. Adds a schema-versioned UserDefaults ruler-set store, restores saved rulers and active selection on launch, falls back for corrupt data, clears state for UI tests, and migrates old autosaved ruler frames when possible.

@pascalpp pascalpp force-pushed the codex/233-active-ruler-commands branch from 0b8293d to 53010d3 Compare June 17, 2026 05:54
@pascalpp pascalpp force-pushed the codex/234-ruler-state-restoration branch 2 times, most recently from 24a922f to ec79118 Compare June 17, 2026 06:14
@pascalpp pascalpp force-pushed the codex/233-active-ruler-commands branch from 53010d3 to 90914b7 Compare June 17, 2026 06:14
@pascalpp

Copy link
Copy Markdown
Owner Author

[codex reviewer] Resetting the active ruler bypasses the state-change notification path that this PR relies on for saving. resetRulerPositions mutates controller.state.settings/layout/visibility directly and calls controller.show() (Free Ruler/AppDelegate.swift:845), while persistence is wired through RulerManager.onStateChanged (Free Ruler/AppDelegate.swift:82) and controller/manager notifyStateChanged (Free Ruler/GroupedRulerWindow.swift:1755). There is no explicit notification/save for reset, so the rulerSetState in UserDefaults can remain stale until applicationWillTerminate happens. A crash or force quit after reset would restore the pre-reset ruler. Please route reset through a controller method that notifies, or explicitly save after resetting, and add a test that prefs.loadRulerSetState() reflects reset immediately after resetRulerPositions.

@pascalpp pascalpp force-pushed the codex/233-active-ruler-commands branch from 90914b7 to 91bb0dc Compare June 18, 2026 02:31
@pascalpp pascalpp force-pushed the codex/234-ruler-state-restoration branch from ec79118 to 90b0201 Compare June 18, 2026 02:31
@pascalpp pascalpp force-pushed the codex/233-active-ruler-commands branch from 91bb0dc to 8648e57 Compare June 19, 2026 02:20
@pascalpp pascalpp force-pushed the codex/234-ruler-state-restoration branch from 90b0201 to 71ece46 Compare June 19, 2026 02:20

pascalpp commented Jun 19, 2026

Copy link
Copy Markdown
Owner Author

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant