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

AV
2mo ago
+931-436

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.

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.