* fix(notes): protect title IME, surface persist failures, harden paste
Note titles rewrote controlled value during CJK composition (Sogou Wubi).
Notes localStorage writes ignored QuotaExceededError so restarts lost
content. Markdown paste intercept could preventDefault with a no-op insert
(fixes#2783).
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix(notes): commit title draft on blur for IME composition
IME-only title entry never called onCommit until compositionend; blur
could flush an empty draftTitle and then adopt the stale external value.
Commit the local draft on blur before parent flushNoteDraft.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix(notes): stash IME title drafts in refs without controlled rewrite
Composition updates now live-stash into draftTitleRef for teardown and
note-switch flushes, while onCommit still waits for idle IME. Blur syncs
superseded external titles before flush so stale drafts cannot overwrite.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix(notes): clear stashed title when IME composition is superseded
compositionEnd now live-stashes the adopted external title so pagehide
and note-switch flushes cannot persist rejected composed text.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix(notes): cancel draft flush during IME title stash
Prior idle commits could still debounce-flush mid-composition and rewrite
the controlled title. Stash now clears the timer, and external supersede
in the adopt effect live-stashes the authoritative title.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix(notes): dedupe quota failure toasts during autosave
Debounced draft flushes can hit QuotaExceededError repeatedly; rate-limit
the error toast so users are not spammed every 300ms.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
---------
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>