Fix note title autofill while editing - #769
Conversation
Autosave normalized empty and spaced titles while the input was still focused, then cleared the local edit. Keep that draft until blur or editor teardown, while continuing to save body edits and non-empty titles. Cover delayed saves and unmounts with regression tests for hardbeat920#768.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (2)
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review. 📝 WalkthroughWalkthroughThe title editor now preserves blank or whitespace drafts while focused during saves. When focus leaves the input, the draft clears and the saved title can use the body-derived fallback. Tests cover autosaves, blur, refocus, and unmount. ChangesTitle draft handling
Priority: ➖ Normal Estimated code review effort: 3 (Moderate) | ~20 minutes Change: Bug fix · Severity of issue fixed: Medium Suggested reviewers: Merge Risk: ⚪ Minimal · up to Clearing a note title no longer gets overwritten while the title field is focused, and the fallback title is applied on blur or when the editor closes. No merge-blocking risk is visible from the supplied evidence. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@Umupa looks good to me! thank you |
What changed
Keep the note title draft intact while its input is focused, including empty titles and surrounding spaces. Autosave still writes non-empty titles and other note fields; the existing title fallback is committed on blur or editor teardown.
Why
Fixes #768. The 400 ms autosave normalized the title and cleared its local edit while the user was still typing. A save that starts during title editing now preserves the draft for the final queued save, including when the editor unmounts before the earlier request finishes.
UI
No layout changes. Verified in a native macOS app with an isolated Tauri identifier and SQLite database: clear and pause, type a replacement, clear a custom title, and blur to commit the generated fallback. Confirmed the saved title and body directly in SQLite.
Before
After clearing the title, autosave fills the focused input with the first line of the body.
After
The cleared title draft stays empty while the input is focused. The grey
Untitledis a placeholder, not a generated title.Validation
npm run checkpassed. Finalnpm run check:web: 4,265 passed, 13 existing skips. Rust: 539 passed, 1 existing ignored test.Checklist
npm run checkSummary by CodeRabbit