Description
Add an opt-in session restoration setting that reopens the user's last workspace and saved-file tabs when SnapDock starts.
This replaces the earlier autosave proposal. SnapDock should restore navigation state only and always reload file content from disk.
Expected Behavior
When session restoration is enabled, SnapDock should remember:
- The last open workspace/folder
- The ordered list of open saved-file tabs
- The active saved-file tab
On the next launch, SnapDock should:
- Reopen the saved workspace
- Reopen each saved-file tab in its previous order
- Restore the previously active tab
- Load the current content of every file from disk
- Skip missing, moved, or inaccessible files without blocking startup
Settings
- Add an opt-in toggle in the Tools menu
- Persist the enabled/disabled preference
- Disabling the feature should clear stored session metadata
- Close Project should clear the stored session
Out of Scope
This feature must not persist or restore:
- Unsaved or dirty editor content
- Untitled tabs
- Undo/redo history
- Cursor selections or scroll positions
- Automatic writes to files on disk
- Crash-recovery snapshots
Users remain responsible for saving document changes normally.
Suggested Session Data
Store metadata only, scoped to the restored workspace:
{
"workspacePath": "...",
"openFiles": ["...", "..."],
"activeFile": "..."
}
Do not store document contents in localStorage.
Acceptance Criteria
Contributor Notes
The existing commented src/modules/file/autosave.js implementation is not suitable for this feature because it stores a single editor value. The implementation should integrate with the current workspace and tab models instead.
Description
Add an opt-in session restoration setting that reopens the user's last workspace and saved-file tabs when SnapDock starts.
This replaces the earlier autosave proposal. SnapDock should restore navigation state only and always reload file content from disk.
Expected Behavior
When session restoration is enabled, SnapDock should remember:
On the next launch, SnapDock should:
Settings
Out of Scope
This feature must not persist or restore:
Users remain responsible for saving document changes normally.
Suggested Session Data
Store metadata only, scoped to the restored workspace:
{ "workspacePath": "...", "openFiles": ["...", "..."], "activeFile": "..." }Do not store document contents in localStorage.
Acceptance Criteria
Contributor Notes
The existing commented
src/modules/file/autosave.jsimplementation is not suitable for this feature because it stores a single editor value. The implementation should integrate with the current workspace and tab models instead.