Skip to content

feat(desktop): reply to PR comments in the app, under the comment - #8407

Open
AviPeltz wants to merge 5 commits into
mainfrom
pr-comment-reply
Open

AviPeltz wants to merge 5 commits into
mainfrom
pr-comment-reply

Conversation

@AviPeltz

@AviPeltz AviPeltz commented Oct 12, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

On a PR's Activity section, Reply now replies inside the app, in a box that opens directly under the comment being answered. Before, the Reply on a conversation comment or review was a link that opened GitHub.

  • Conversation comments and reviews. GitHub has no threads on these; its own Reply there is "Quote reply". Reply does the same: the box under the card starts from a quote of the comment and posts a new conversation comment. The quote is the reader's selection inside that comment when there is one, otherwise the comment's opening lines as rendered, cut short so a bot's long report does not flood the box. What posts is exactly what is in the box.
  • Review threads (workspace pane). The box under the thread's card starts empty and posts through the host's existing reply-to-thread procedure.
  • One box per card. Pressing Reply again while the box is open adds a fresh selection as another quote, or refocuses the box; it never opens a second one. Cancel closes it, and it closes itself once the reply posts.
  • No destination (the cloud route, an older host): Reply stays a link to the comment on GitHub.

The composer at the end of the section is only "Leave a comment" again. Its reply mode, the "Replying to …" strip and the per-destination drafts from #8398 are gone, along with two strings; the reply context now carries just the destination a reply posts to. Both cards share one Reply control.

No host or API changes: this uses pullRequests.addComment and pullRequests.replyToThread as they are.

Test plan

  • bun run typecheck in apps/desktop (exit 0), repo lint clean, 80 tests pass across the Pull requests route and the PR pane suites (new: quote builder, composer box, conversation card reply, thread card reply)
  • i18n: extraction only removes the two unused strings in all 17 catalogs; nothing new to translate
  • Driven over CDP in the dev app on a PR from the Pull requests route: a real click on Reply opens the box 8px under the card on the same edge and width, focused, caret after the quote; a real drag-select plus a second Reply adds the selection as another quote in the same box; Cancel closes it
  • Post a reply to a conversation comment and to a review thread (not exercised live; posting hits a real PR)
  • Review-thread reply box in the workspace pane, and the folded-row layout in a narrow pane (unit-tested, not driven live)

Summary by cubic

Replying to a PR comment in the Activity section now opens a reply box directly under that comment, instead of routing to the composer at the end or opening GitHub.

  • Conversation comments and reviews open the box starting from a quote of the comment (GitHub's "Quote reply" behavior): the reader's selection is quoted when there is one, otherwise the comment's opening lines, truncated so a bot's long report does not flood the box.
  • Review threads open an empty box that posts through the existing reply-to-thread procedure.
  • Pressing Reply again while the box is open adds a fresh selection as another quote into the same box, or refocuses it; Cancel closes it, and it closes after posting.
  • The box and its draft survive folding a resolved or outdated thread and crossing into the narrow-pane layout; Cancel stays disabled while a reply posts.
  • Where nothing can take a reply (the cloud route, an older host), Reply stays a link to the comment on GitHub.
  • The composer is a one-line pill again (GitHub chip, round send button); it now grows with the draft, wrapped lines included, up to six lines. A reply box adds a close button.
  • The composer at the end of the section is only "Leave a comment" again; its reply mode, the "Replying to…" strip, per-destination drafts, and two unused i18n strings are removed.

Written for commit e357757. Summary will update on new commits.

View guided diff Turn on auto-fix

Summary by CodeRabbit

  • New Features
    • Reply to pull request comments inline, with the reply box opening beneath the comment.
    • Start a reply with a quote of selected text, or an excerpt of the full comment when no text is selected. Select more text to append quotes to the same draft.
    • Selecting Reply again focuses the open reply box. Cancel closes it and clears the draft.
    • When in-app replies aren’t available, Reply links to the comment on GitHub.
  • Improvements
    • Replies to conversation comments now appear beneath their comment card.

On a PR's Activity section only review threads replied in the app. The
Reply on a conversation comment or a review was a link, so answering one
meant going to GitHub in a browser.

GitHub has no threads on conversation comments; its own Reply there is
"Quote reply", which puts the comment into the comment box as a quote and
posts a new conversation comment. Reply now does the same against the
composer at the end of the section: the reader's selection inside that
comment is quoted when there is one, otherwise the comment's opening
lines, cut short so a bot's long report does not flood the box. The quote
goes after any draft already written, the composer takes focus with the
caret after the quote, and what posts is exactly what is in the box.

The quote is read from the rendered comment, not its markdown source, so
a body made of badges, tables and folded details quotes as the text the
reader saw. Review threads keep GitHub's real threaded reply. Where no
composer can take a reply (the cloud route, an older host) Reply stays a
link to the comment.

Both cards now share one Reply control, and the reply context carries the
two ways to reach the composer: answer a thread, or quote into the
conversation.
Reply sent the reader to the composer at the end of the Activity
section, which on a long PR is screens away from the comment being
answered. Each card now opens its own reply box directly beneath itself:
a conversation comment's box starts from the quote, a review thread's
box posts into the thread. The box takes focus, offers Cancel, and
closes once the reply posts.

Pressing Reply again while the box is open does not open a second one:
with a fresh selection in the comment it adds that quote to the draft,
otherwise it brings the box back into focus.

This removes the machinery the shared composer needed. The composer at
the end of the section is only "Leave a comment" again, with one draft
and no reply mode, and the reply context shrinks from a pair of actions
to the destination a reply posts to. The "Replying to ..." strip and its
two strings go with it; a box under the comment it answers does not
need to say whom it answers.
@coderabbitai

coderabbitai Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 1807eb31-3395-480d-825f-e7fc97714fe9
📥 Commits

Reviewing files that changed from the base of the PR and between c47c93f and e357757.

📒 Files selected for processing (7)
  • apps/desktop/src/renderer/routes/_authenticated/_dashboard/pull-requests/components/PullRequestActivity/PullRequestActivity.tsx
  • apps/desktop/src/renderer/routes/_authenticated/_dashboard/pull-requests/components/PullRequestActivity/components/PullRequestTimelineStop/PullRequestTimelineStop.test.tsx
  • apps/desktop/src/renderer/routes/_authenticated/_dashboard/pull-requests/components/PullRequestActivity/components/PullRequestTimelineStop/PullRequestTimelineStop.tsx
  • apps/desktop/src/renderer/routes/_authenticated/_dashboard/pull-requests/components/PullRequestConversationComposer/PullRequestConversationComposer.test.tsx
  • apps/desktop/src/renderer/routes/_authenticated/_dashboard/pull-requests/components/PullRequestConversationComposer/PullRequestConversationComposer.tsx
  • apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/hooks/usePaneRegistry/components/PullRequestPane/components/PullRequestCommentCard/PullRequestCommentCard.test.tsx
  • apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/hooks/usePaneRegistry/components/PullRequestPane/components/PullRequestCommentCard/PullRequestCommentCard.tsx

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

📝 Walkthrough

Pull request activity and workspace comment cards now open inline reply composers when an in-app reply target is available. The composer supports quoted text, comment submission, and thread replies. Reply falls back to a GitHub link when an in-app target is unavailable.

Changes: Inline pull request replies

Layer / File(s) Summary
Composer and quote handling
apps/desktop/src/renderer/routes/_authenticated/_dashboard/pull-requests/components/PullRequestConversationComposer/*, apps/desktop/src/renderer/routes/_authenticated/_dashboard/pull-requests/utils/quotePullRequestComment/*
The composer uses one draft, exposes focus and quote actions, and submits thread replies by comment ID. Quote helpers format selected text or comment excerpts and append quotes to a draft. Tests cover quote formatting, appending, and comment or thread-reply submission.
Activity comment replies
apps/desktop/src/renderer/routes/_authenticated/_dashboard/pull-requests/components/PullRequestActivity/*, apps/desktop/src/renderer/routes/_authenticated/_dashboard/pull-requests/components/PullRequestReplyAction/*, apps/desktop/src/renderer/routes/_authenticated/_dashboard/pull-requests/providers/PullRequestActivityReplyProvider/*
Activity comments open a composer with a quote of selected text or comment content. The reply provider supplies a comment target. Reply links to GitHub when in-app replies are unavailable. Activity timeline items use PullRequestTimelineStop with its rail disabled outside card layout.
Workspace comment replies
apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/hooks/usePaneRegistry/components/PullRequestPane/components/PullRequestCommentCard/*, packages/i18n/locales/*/messages.po
Workspace comment cards open a composer below the card when a reply target and comment database ID are available. Tests cover opening, focus, repeated activation, and retaining the draft when a resolved thread is folded. Locale catalogs remove the “Cancel reply” and “Replying to {replyingTo}” entries.

Priority: ➖ Normal

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant Reviewer
  participant PullRequestActivityComment
  participant quotePullRequestComment
  participant PullRequestConversationComposer
  Reviewer->>PullRequestActivityComment: Select text and activate Reply
  PullRequestActivityComment->>quotePullRequestComment: Format selection or comment excerpt
  quotePullRequestComment-->>PullRequestActivityComment: Return quote
  PullRequestActivityComment->>PullRequestConversationComposer: Set initial draft or append quote
  PullRequestConversationComposer-->>Reviewer: Show focused reply textbox
Loading
Merge Risk: ⚪ Minimal · up to e3577

This adds inline replies under pull request comment cards and falls back to a GitHub link when no in-app target is available. No concrete merge-blocking risk was found in the supplied changes.

Pre-merge checks · Passed 4 · Failed 1

Failed Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 22 functions across 16 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks (4 passed)
Check name Status Explanation
Title check Passed The title uses conventional commit format and clearly states the main change: in-app replies to pull request comments under the comment.
Description check Passed The description clearly explains what changed, why it changed, fallback behavior, testing performed, and known untested cases. It does not reproduce the template's separate Checklist section, but it i…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

Copy link
Copy Markdown
Contributor

🚀 Preview Deployment

🔗 Preview Links

Service Status Link
Neon Database (Neon) ✅ View Branch
Vercel API (Vercel) ✅ Open Preview
Vercel Web (Vercel) ✅ Open Preview
Vercel Marketing (Vercel) ✅ Open Preview
Vercel Docs (Vercel) ✅ Open Preview

Preview updates automatically with new commits

@expo

expo Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

Preview update published for development build 44d37656 (fingerprint 52085cf7de79). Open the build on your phone and scan:

Update group 539e4c70

# Conflicts:
#	apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/hooks/usePaneRegistry/components/PullRequestPane/components/PullRequestCommentCard/PullRequestCommentCard.test.tsx
#	apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/hooks/usePaneRegistry/components/PullRequestPane/components/PullRequestCommentCard/PullRequestCommentCard.tsx
@greptile-apps

greptile-apps Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 2/5

[Medium impact] Adds reply-to-comment UI in the pull request activity view.

Fix the blocked narrow-pane replies and draft-loss paths before merging.

Findings

  1. P1 Folding breaks thread replies ▶
  2. P1 Earlier replies erase new drafts ▶
  3. P1 Resizing erases reply drafts ▶
Fix with agent prompt
### Issue 1
apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/hooks/usePaneRegistry/components/PullRequestPane/components/PullRequestCommentCard/PullRequestCommentCard.tsx:223
`!collapsed` prevents replies to resolved or outdated threads in a narrow pane. `PullRequestActivityCard` ignores `collapsed` in row layout, so users can expand the row and click Reply, but no box appears. In card layout, collapsing a thread with an open reply removes the box and loses its draft.

Keep the composer mounted while replying; folding the card should not discard the draft.

### Issue 2
apps/desktop/src/renderer/routes/_authenticated/_dashboard/pull-requests/components/PullRequestConversationComposer/PullRequestConversationComposer.tsx:164-167
Cancel stays enabled while a reply posts. If the user cancels, reopens Reply on the same card, and starts another draft before the first request finishes, the old `onSuccess` still calls the card's `onClose`. That closes the new box and loses its draft.

Disable Cancel while posting, or make completion close only the reply box that started the request.

### Issue 3
apps/desktop/src/renderer/routes/_authenticated/_dashboard/pull-requests/components/PullRequestActivity/components/PullRequestActivityComment/PullRequestActivityComment.tsx:137-143
Moving the reply composer into each timeline card makes resizing the pane erase unfinished replies. Below 30rem, `PullRequestActivity` replaces `PullRequestTimelineStop` with `li`, which removes and recreates the card and its composer. Crossing that width while writing loses the draft and closes the box. Review-thread reply boxes are affected too.

Keep reply state above the layout switch, or keep the same component tree across both layouts.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Summary

Reply now opens a composer under each conversation comment or review thread.

  • Conversation comments and reviews open a quoted reply box beneath the card.
  • Review threads open an empty reply box beneath their card.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Click Reply] --> B{Destination available?}
  B -->|No| C[Open GitHub]
  B -->|Yes| D{Review thread?}
  D -->|No| E[Build quote]
  E --> F[Open composer under card]
  D -->|Yes| F
  F --> G[Post reply]
  G --> H{Review thread?}
  H -->|Yes| I[pullRequests.replyToThread]
  H -->|No| J[pullRequests.addComment]
  I --> K[Close box and refresh]
  J --> K
Loading

Reviews (1) · Last reviewed commit: "Merge remote-tracking branch 'origin/mai..." · Reviewed by Greptile

The comment box at the end of the Activity section had grown into a
three-row card with a square send button, and the reply box under a card
inherited it. Both are the small rounded pill the page started with: the
GitHub mark in a chip, one line of text, a round send button. A reply box
adds a close button beside it.

The pill now grows with the draft itself, wrapped lines included, up to
six lines, and the chip and buttons stay on the last line. Before, only
typed line breaks added rows.

Enter still sends and Shift+Enter breaks a line. Two tests post through a
local stand-in for the host, one for a comment and one for a thread
reply, since the send path had no test.
…posts

- Folding a resolved or outdated thread hid its reply box and dropped
  the draft, and in the narrow layout, which ignores folding, Reply
  opened nothing. The box now stays open whether or not the card is
  folded.
- Crossing the narrow-pane width swapped each card's wrapper element,
  which remounted the card and its reply box and lost the draft. A
  timeline stop now keeps one element tree in both layouts and only
  drops the rail in the narrow one.
- Cancel stays disabled while a reply posts, so a request that finishes
  after the box was cancelled and reopened cannot close the new box.

This branch was previously deployed

1 inactive deployment
preview — e3577573 Deployed Oct 13, 2026 by AviPeltz via Deploy Web #11825
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