feat(editor): add mobile auto-save toggle with i18n and cleanup fixes#1152
Merged
Conversation
perber
commented
Jun 10, 2026
Owner
- Add auto-save toggle to mobile MarkdownToolbar dropdown (DropdownMenuCheckboxItem)
- Show 'paused' badge next to auto-save label on version conflict
- Share autoSaveStatus via useEditorStore (non-persisted) to avoid prop drilling
- Fix: unmount cleanup now resets store autoSaveStatus to 'idle'
- Fix: remove dead 'saved' member from AutoSaveStatus union
- Fix: add comment explaining local useState is a load-bearing effect dependency
- Translate all toolbar tooltip labels, aria-labels and table picker strings (editor ns)
- Translate useAutoSave toast messages via useTranslation hook
- Add auto-save toggle to mobile MarkdownToolbar dropdown (DropdownMenuCheckboxItem) - Show 'paused' badge next to auto-save label on version conflict - Share autoSaveStatus via useEditorStore (non-persisted) to avoid prop drilling - Fix: unmount cleanup now resets store autoSaveStatus to 'idle' - Fix: remove dead 'saved' member from AutoSaveStatus union - Fix: add comment explaining local useState is a load-bearing effect dependency - Translate all toolbar tooltip labels, aria-labels and table picker strings (editor ns) - Translate useAutoSave toast messages via useTranslation hook
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a mobile-friendly auto-save control and broader editor i18n coverage, while centralizing auto-save status in the editor store to reduce prop drilling and improve UI feedback (e.g., “paused” on version conflict).
Changes:
- Introduces
autoSaveStatus(non-persisted) inuseEditorStore, and syncs it fromuseAutoSave. - Localizes editor toolbar tooltips/labels (including table picker aria-labels) and auto-save toast messages via the
editori18n namespace. - Adds mobile dropdown checkbox items for line wrap and auto-save, including a “paused” badge when a version conflict pauses auto-save.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| ui/leafwiki-ui/src/stores/editor.ts | Adds AutoSaveStatus and exposes autoSaveStatus/setAutoSaveStatus in the Zustand editor store (non-persisted via partialize). |
| ui/leafwiki-ui/src/locales/en/editor.json | Adds editor.toolbar.* strings and localized auto-save toast strings. |
| ui/leafwiki-ui/src/features/editor/useAutoSave.ts | Removes dead 'saved' status, localizes toast messages, and mirrors status into the editor store; resets store status on unmount. |
| ui/leafwiki-ui/src/features/editor/MarkdownToolbar.tsx | Localizes tooltips/labels/aria-labels and adds mobile dropdown checkbox toggles for line wrap + auto-save with a paused indicator. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.