Skip to content

feat(client): add thread deletion and question comments - #482

Open
NitrousOX wants to merge 1 commit into
yoshiko-pg:mainfrom
NitrousOX:feat/comment-delete-and-questions
Open

NitrousOX wants to merge 1 commit into
yoshiko-pg:mainfrom
NitrousOX:feat/comment-delete-and-questions

Conversation

@NitrousOX

Copy link
Copy Markdown

Motivation

  • Deleting a comment isn't discoverable. The only way to remove a root comment is the ✓ Resolve button, which is not obviously a delete action.
  • There's no way to ask the agent a question. Every comment in the copied prompt reads as a change request, so agents tend to edit code even when the reviewer only wanted an explanation.

Changes

Delete thread

  • The root message of a thread now has a 🗑 Delete thread button next to ✓ Resolve.
  • It uses the same inline confirmation pattern as reply deletion ("Delete?", with Escape and click-outside to cancel).
  • Internally, ThreadMessageItem now tracks which action is pending (primary | delete) instead of a single boolean.

Question comments

  • New optional isQuestion flag on DiffCommentThread / CommentThread.
  • It's persisted with the thread, preserved by cloneThread (comment imports/merge), and propagated by the server's toCommentThread.
  • You can set it in two places:
    • a Question checkbox on the new-comment form (only for new comments, not replies or edits; opt-in via showQuestionToggle)
    • a ? toggle in the thread card header (onSetThreadQuestion, passed down the same way as onUpdateMessage)
  • Question threads show a blue Question badge.
  • formatCommentThreadPrompt adds a marker line after the location:
    src/foo.ts:L10
    [QUESTION — answer, don't change code]
    Why is this cached here?
    
    This applies to Copy Prompt, copy-all, and server/CLI comment output.

Verification

  • pnpm check, pnpm test, pnpm build, and knip pass.
  • New tests:
    • prompt marker (commentFormatting.test.ts)
    • form question checkbox (CommentForm.test.tsx)
    • delete confirmation and question toggle (CommentThreadCard.test.tsx)
  • Updated DiffChunk.test.tsx assertions for the new options argument to onAddComment.
  • Manual check with pnpm dev .:
    1. Add a comment with Question checked and confirm the badge appears.
    2. Toggle ? on an existing thread.
    3. Click Copy Prompt and confirm the marker line appears.
    4. Delete a thread via 🗑 → Delete, and confirm ✓ Resolve still works.

Screenshots to follow.

Not included

A --question flag for difit comment add is not part of this PR. Happy to add it here or in a follow-up.

🤖 Generated with Claude Code

- Add a Delete button (with inline confirmation) to the root message of a
  thread, alongside Resolve, so removing a comment is discoverable.
- Add an optional `isQuestion` flag to comment threads. It can be set via a
  "Question" checkbox when creating a comment, or toggled on existing
  threads from the card header. Question threads show a badge.
- Question threads are emitted in prompts with a
  "[QUESTION — answer, don't change code]" marker so coding agents answer
  instead of editing code. This applies to single-thread copy, copy-all,
  and server/CLI comment output.

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

This branch has not been deployed

No deployments
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.

1 participant