fix(comments): clear highlight on resolve; harden window-close guard#66
Merged
Conversation
Resolving a comment left a dotted underline on the text — the mark was re-stamped `resolved` rather than removed. Worse, when an accepted track-change replaced the commented span, the inserted text inherited the comment mark, so the underline landed on text the user never commented on. Resolve now removes the mark outright (text goes plain); unresolve re-stamps it from the comment's stored range via the new `setCommentRange` command (the mark is gone, so the stored from/to is the only range source). Replaces `setCommentResolved`. Also harden the native window-close guard: the async onCloseRequested registration could be torn down before it resolved (StrictMode), leaking a duplicate listener; and a throw in the dirty branch could prevent the close without ever showing the Save dialog — leaving the red X dead on a dirty document. The listener is now reliably installed-or-discarded, and a failure in the dirty path destroys the window rather than swallowing the close silently. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The resolve fix removes the comment mark on resolve rather than re-stamping it as resolved, so the in-text highlight is gone. Update the e2e assertion (which still expected a lingering mark.comment-resolved) to match: no comment mark of any kind survives resolution. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Merged
sam-powers
added a commit
that referenced
this pull request
Jun 16, 2026
Patch release: resolve clears the comment highlight; window-close guard hardened for unsaved-changes prompt (#66). Bumps version in package.json, Cargo.toml, tauri.conf.json, Cargo.lock; adds release notes draft. Co-authored-by: Claude Opus 4.8 <noreply@anthropic.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.
Two fixes from live bug reports.
1. Resolved-comment highlight persisted
Repro: comment on text →
@claudeedits with track changes → accept → resolve → highlight stays.Cause: resolving re-stamped the comment mark as
resolved(CSS dotted underline) instead of removing it. When the accepted track-change replaced the commented span, the inserted text inherited the comment mark, so the underline ended up on text that was never commented on.Fix: resolve now removes the mark outright — the text goes fully plain (matching delete's behavior). Unresolve re-stamps it from the comment's stored
from/tovia a newsetCommentRangecommand (the live mark is gone, so the stored range is the only source). ReplacessetCommentResolved.2. Red X did nothing on a dirty document
Repro: make changes (dirty doc) → click the red traffic-light X → nothing happens, window stays open, no Save dialog.
Cause: the dirty branch of
onCloseRequestedcallsevent.preventDefault()thensetDiscardGuard(...)to show the Save / Don't Save / Cancel dialog. The dialog machinery itself is sound (covered bydata-safety.spec.tsfor Cmd+N/Cmd+O) — the X is the one untested trigger. Its async listener registration could be torn down before resolving (StrictMode double-mount), leaking a duplicate listener, and a throw in the dirty branch could prevent the close without surfacing the dialog — a dead X.Fix: the listener is now reliably installed-or-discarded (no leaked duplicate), and a failure in the dirty path destroys the window rather than swallowing the close silently.
Checks
data-safety.spec.tse2e 7/7 ✓ (dirty-guard dialog intact)🤖 Generated with Claude Code