feat(editor): add auto-save with debounce, conflict detection#1089
Merged
Conversation
perber
commented
May 31, 2026
Owner
- Debounced auto-save (2s) watches content, tags, and frontmatter fields
- Silent saves skip the global progress bar
- Version conflict pauses auto-save and prompts manual resolution
- Status indicator in editor title bar (Saving… / Saved ✓ / Auto-save paused)
- Auto-save toggle button in toolbar (Cloud/CloudOff icon, persisted to localStorage)
- Auto-save skipped when slug changes (requires manual save)
Contributor
There was a problem hiding this comment.
Pull request overview
Adds client-side editor auto-save with persisted enable/disable state, silent saves, conflict-pausing behavior, and title-bar save status feedback.
Changes:
- Adds an
autoSaveeditor preference persisted in localStorage and a toolbar toggle button. - Introduces
useAutoSavewith debounced silent saves, metadata validation skipping, slug-change skipping, and conflict pause handling. - Updates save plumbing to support silent saves and displays auto-save status in the editor title bar.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
ui/leafwiki-ui/src/stores/editor.ts |
Persists the auto-save preference and toggle action. |
ui/leafwiki-ui/src/features/editor/useToolbarActions.tsx |
Adds the toolbar control for enabling/disabling auto-save. |
ui/leafwiki-ui/src/features/editor/useAutoSave.ts |
Implements debounced auto-save and shared status state. |
ui/leafwiki-ui/src/features/editor/pageEditorStore.ts |
Adds silent save support and a save mutex. |
ui/leafwiki-ui/src/features/editor/PageEditor.tsx |
Wires the auto-save hook into the editor lifecycle. |
ui/leafwiki-ui/src/features/editor/EditorTitleBar.tsx |
Displays Saving/Saved/Paused auto-save status. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
perber
force-pushed
the
feature/auto-save
branch
4 times, most recently
from
June 2, 2026 10:02
8b1ea22 to
ab8c501
Compare
…olbar toggle - Debounced auto-save (2s) watches content, tags, and frontmatter fields - Silent saves skip the global progress bar - Version conflict pauses auto-save and prompts manual resolution - Status indicator in editor title bar (Saving… / Saved ✓ / Auto-save paused) - Auto-save toggle button in toolbar (Cloud/CloudOff icon, persisted to localStorage) - Auto-save skipped when slug changes (requires manual save) Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Limit the navigation guard to blocked transitions and clean up the dialog state when leaving the editor. Add an end-to-end test for the Leave anyway flow so the regression stays covered.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.