Skip to content

Comment on suggestions; icon card actions (#45) - #47

Merged
philphilphil merged 2 commits into
mainfrom
suggestion-comments
Sep 23, 2026
Merged

philphilphil merged 2 commits into
mainfrom
suggestion-comments

Conversation

@philphilphil

Copy link
Copy Markdown
Owner

Closes #45.

  • A comment sitting directly after an addition, deletion or substitution (only spaces/tabs between) is now that suggestion's rationale. The panel shows one suggestion card with the messages and a Reply box inside it, instead of two cards. Threads on suggestions aren't counted as comments in the header; their numbers still match the chips in the editor.
  • Accept/Reject removes the rationale thread along with the change, in the panel and in the cursor commands. The change and its thread are a single edit, so if the note drifted, the action is skipped rather than half-applied.
  • Deleting a comment never touches the change: deleting the last message turns the card back into a plain suggestion card. (Highlight anchors from "insert comment" also adds highlighting if text is selected? #41 still go with their last message.)
  • Suggestions without a thread get a Comment action that writes a comment right after the mark, stamped like a reply.
  • Card actions are now icon buttons with tooltips: check, x, message-square-plus, eraser, trash-2. Reply stays a text button.
  • docs/SKILL.md, CLAUDE.md and README.md are updated.

Existing notes change behaviour: a comment already sitting right after a suggestion now belongs to it and is removed when the suggestion is resolved.

Testing

npm run build and npm test pass. New parser tests cover anchoring for all three change kinds, gaps, AI-added text and highlight precedence. New operations tests cover appendComment, accept/reject taking the thread, rebasing after drift, the cursor commands, deleting a comment leaving the change alone, and finalize.

Not yet tested manually in Obsidian. The test note is TestingNotes/track-changes/suggestion-comments.md.

🤖 Generated with Claude Code

philphilphil and others added 2 commits September 23, 2026 20:38
A comment directly after an addition, deletion or substitution is now that
suggestion's rationale: the panel shows it inside the suggestion card, and
accept/reject removes it with the change. Suggestions without one get a
Comment action. Card actions become icon buttons.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…hreads

- Thread.changeIndex holds a change anchor; anchorIndex is highlight-only again
- Resolving a change also removes the whitespace before its thread
- Panel Accept/Reject confirms (per confirmBeforeDelete) when the thread has replies
- Reuse isChangeNode / anchor maps instead of recomputing

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@philphilphil
philphilphil merged commit 9d7a799 into main Sep 23, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Comment on suggestions (insertions, deletions, substitutions)

1 participant