fix(remark): cancel empty annotation on outside click; replace clear-all two-click with undo toast#83
Merged
xicilion merged 1 commit intoMay 15, 2026
Conversation
…all two-click with undo toast - Bug 1: clicking outside popup without interacting now silently removes the annotation instead of leaving an empty entry; annotation is kept only if user explicitly chose a color or typed a note - Bug 3: clear-all no longer uses a confusing two-click confirmation; single click clears immediately with a 5-second undo toast (consistent with single-item delete behaviour) - i18n: add remark_all_cleared key, remove unused remark_confirm_clear Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.
Fixes two issues reported by @xicilion in #74 after PR #76 was merged.
Bug 1: Clicking outside popup without annotating leaves empty annotation
Root cause: The annotation was created immediately on text selection, and
outsideHandlersaved it regardless of whether the user did anything.Fix: Track whether the user interacted (changed a color or typed a note). If they click outside without any interaction, the annotation is silently removed — same as clicking Cancel.
Bug 3: Clear all button doesn't work (two-click UX too hidden)
Root cause: The two-click confirmation (first click →⚠️ , second click → delete) was invisible to users. They'd click once, see the icon change, and wait for it to reset — appearing broken.
Fix: Single click clears immediately + shows a 5-second undo toast (same pattern as single-item delete). Consistent, discoverable, reversible.
Bug 2 (multiple annotations per block with whole-block selection) is a design question — left for a follow-up discussion.