Skip to content

fix(github): complete PR reactions for CodeRabbit reviews - #13456

Merged
nwparker merged 7 commits into
stablyai:mainfrom
nwparker:nwparker/gh-react-face-with-open-mouth
Aug 10, 2026
Merged

nwparker merged 7 commits into
stablyai:mainfrom
nwparker:nwparker/gh-react-face-with-open-mouth

Conversation

@nwparker

@nwparker nwparker commented Aug 10, 2026 •

Copy link
Copy Markdown
Contributor

ELI5

Orca now uses a GitHub-style picker for all eight GitHub reactions (👍 👎 😄 😕 ❤️ 🎉 🚀 👀) on pull request comments. This follow-up makes the control work on review-summary comments such as CodeRabbit reviews too, and keeps keyboard focus in a safe place while a reaction is being changed or rolled back.

What changed

  • Fetches review summaries through GraphQL with their reaction subject IDs, counts, and the current viewer's reaction state.
  • Keeps the existing REST review-summary path as a fallback when GraphQL is unavailable.
  • Moves focus to the persistent Add reaction control before optimistically removing the only selected reaction.
  • Prevents duplicate mutations without native-disable focus loss, and preserves focus when a slow remote mutation fails.
  • Covers a CodeRabbit-style bot comment, all eight picker choices, keyboard removal, pending state, failure rollback, and focus retention.

Proof

Before

The CodeRabbit comment starts with the compact Add reaction control.

reaction-before.png

GitHub-style picker

The picker exposes every GitHub reaction.

reaction-picker.png

After

The selected 🚀 reaction appears as a count pill and can be activated again to remove it.

reaction-after.png

Interaction video

The exact final implementation passed three repeated recorded Electron runs.

[email protected]

Verification

  • 506 focused unit/API/runtime/store tests passed across 9 files.
  • Both focused Electron reaction E2Es passed on the final head.
  • Visual-proof recording passed 3/3 repeated runs on the final head.
  • Full TypeScript typecheck passed.
  • Changed-code quality, type-aware quality, and React Doctor passed with 0 findings.
  • Max-lines ratchet, localization catalog/extraction/coverage, and git diff --check passed.
  • Readiness checklist verdict: CLEAN with no P0, P1, or P2 findings.

Review loop

9 sub-agent review loops total: 5 feature-review loops followed by 4 readiness-checklist loops. Final code verdict: CLEAN.

  1. NOT CLEAN — fixed cache reconciliation for colliding numeric comment IDs and adopted the shadcn button primitive.
  2. CLEAN — the original thumbs-only implementation had no remaining findings.
  3. NOT CLEAN — fixed pending focus loss, duplicate mutations, and accessible count labels for all reactions.
  4. NOT CLEAN — stabilized the pending/failure focus E2E.
  5. CLEAN — the full-reaction implementation passed feature review.
  6. NOT CLEAN — added review-summary reaction subjects, preserved REST node IDs on new comments, and fixed sole-pill focus handoff.
  7. NOT READY — reconciled the branch with the independently merged reaction implementation on main and reduced this PR to the missing follow-up fixes.
  8. NOT CLEAN — moved focus before optimistic sole-pill removal so a slow failure cannot leave focus on the document body.
  9. CLEAN — independent backend and renderer re-review found no correctness, security, accessibility, performance, compatibility, or platform issues.

Compatibility notes

  • The change reuses the existing optional reaction subject ID, so older remote hosts continue to decode comments and simply omit unsupported mutation controls.
  • Local worktrees, folder workspaces, SSH, WSL, remote runtimes, GitHub.com, and GHES continue through the established execution routing.
  • No persisted state, dependency, native module, mobile-facing contract, or remote-wire opcode changed.

@nwparker
nwparker requested a review from brennanb2025 as a code owner August 10, 2026 03:32
@coderabbitai

coderabbitai Bot commented Aug 10, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

GitHub pull-request comments now include GraphQL node IDs and viewer reaction state. The GitHub client supports adding and removing reactions with rate-limit handling. IPC, runtime RPC, preload, and web APIs expose the mutation. The renderer adds reaction pickers, asynchronous state, optimistic updates, failure feedback, and localized labels. Tests cover GraphQL mapping, transport routing, cache updates, UI behavior, and end-to-end reaction flows.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 23.81% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
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.
Title check ✅ Passed The title clearly identifies the main change: completing GitHub PR reactions for CodeRabbit review comments.
Description check ✅ Passed The description covers the change, UI evidence, testing, AI review, compatibility, and follow-up risks, but it lacks an explicit Security Audit section.

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.

@nwparker nwparker changed the title feat(github): react to PR comments with thumbs up or down feat(github): react to PR comments with any GitHub reaction Aug 10, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (1)
src/main/github/client.test.ts (1)

4626-4629: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Assert the selected mutation.

The assertion passes if this path sends removeReaction, because both mutations include subjectId and content. Assert that query contains addReaction. Add a matching remove-reaction test.

Proposed test assertion
     expect(ghExecFileAsyncMock).toHaveBeenCalledWith(
-      expect.arrayContaining(['subjectId=PRRC_1', 'content=THUMBS_UP']),
+      expect.arrayContaining([
+        expect.stringContaining('addReaction'),
+        'subjectId=PRRC_1',
+        'content=THUMBS_UP'
+      ]),
       expect.any(Object)
     )

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 17930339-7877-49f6-8e59-97a532e10346

📥 Commits

Reviewing files that changed from the base of the PR and between 9ccec55 and 30c61a9.

📒 Files selected for processing (25)
  • src/main/github/client.test.ts
  • src/main/github/client.ts
  • src/main/github/comment-reactions.test.ts
  • src/main/github/comment-reactions.ts
  • src/main/ipc/github.test.ts
  • src/main/ipc/github.ts
  • src/main/runtime/orca-runtime.ts
  • src/main/runtime/rpc/methods/github.test.ts
  • src/main/runtime/rpc/methods/github.ts
  • src/main/runtime/runtime-rpc.ts
  • src/preload/api-types.ts
  • src/preload/index.ts
  • src/renderer/src/components/github/CommentReactions.tsx
  • src/renderer/src/components/right-sidebar/ChecksPanel.tsx
  • src/renderer/src/components/right-sidebar/checks-panel-content.tsx
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/store/slices/github.test.ts
  • src/renderer/src/store/slices/github.ts
  • src/renderer/src/store/slices/pr-comment-reaction-state.test.ts
  • src/renderer/src/store/slices/pr-comment-reaction-state.ts
  • src/renderer/src/web/web-preload-api.test.ts
  • src/renderer/src/web/web-preload-api.ts
  • src/shared/types.ts
  • tests/e2e/helpers/pr-comments-sidebar-fixture.ts
  • tests/e2e/pr-comments-sidebar-cards.spec.ts

Comment thread src/main/ipc/github.ts
Comment on lines +702 to +728
ipcMain.handle(
'gh:setPRCommentReaction',
async (
_event,
args: {
repoPath: string
repoId?: string | null
sourceContext?: TaskSourceContext | null
subjectId: string
content: GitHubReactionContent
add: boolean
prRepo?: GitHubOwnerRepo | null
}
) => {
const repo = assertRegisteredRepo(args, store)
return setPRCommentReaction(
repo.path,
args.subjectId,
args.content,
args.add,
repoConnectionId(repo),
args.prRepo ?? null,
...localGitOptionArgs(store, repo)
)
}
)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Reject non-boolean add values at the IPC boundary.

TypeScript annotations do not validate values received by ipcMain. The client selects removeReaction whenever add is falsy, so a missing value can remove a reaction. A truthy non-boolean selects addReaction. Reject non-boolean values before dispatching.

Proposed guard
       const repo = assertRegisteredRepo(args, store)
+      if (typeof args.add !== 'boolean') {
+        return false
+      }
       return setPRCommentReaction(
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
ipcMain.handle(
'gh:setPRCommentReaction',
async (
_event,
args: {
repoPath: string
repoId?: string | null
sourceContext?: TaskSourceContext | null
subjectId: string
content: GitHubReactionContent
add: boolean
prRepo?: GitHubOwnerRepo | null
}
) => {
const repo = assertRegisteredRepo(args, store)
return setPRCommentReaction(
repo.path,
args.subjectId,
args.content,
args.add,
repoConnectionId(repo),
args.prRepo ?? null,
...localGitOptionArgs(store, repo)
)
}
)
ipcMain.handle(
'gh:setPRCommentReaction',
async (
_event,
args: {
repoPath: string
repoId?: string | null
sourceContext?: TaskSourceContext | null
subjectId: string
content: GitHubReactionContent
add: boolean
prRepo?: GitHubOwnerRepo | null
}
) => {
const repo = assertRegisteredRepo(args, store)
if (typeof args.add !== 'boolean') {
return false
}
return setPRCommentReaction(
repo.path,
args.subjectId,
args.content,
args.add,
repoConnectionId(repo),
args.prRepo ?? null,
...localGitOptionArgs(store, repo)
)
}
)

@Jinwoo-H

Jinwoo-H commented Aug 10, 2026 •

Copy link
Copy Markdown
Contributor

Superseded by #13470, which has now landed. Both implementations converged on the full eight-reaction picker and local/SSH/remote mutation routing. The landed version also preserves GitHub's returned node IDs so newly posted comments are immediately reactable, and uses optimistic updates with targeted rollback. Thanks for putting this together—the overlap was useful for validating the picker, node-identity, and remote-routing paths.

@Jinwoo-H Jinwoo-H closed this Aug 10, 2026
@nwparker nwparker reopened this Aug 10, 2026
@nwparker nwparker changed the title feat(github): react to PR comments with any GitHub reaction fix(github): complete PR reactions for CodeRabbit reviews Aug 10, 2026
@nwparker
nwparker merged commit 016df33 into stablyai:main Aug 10, 2026
47 checks passed
mephraums pushed a commit to mephraums/orca that referenced this pull request Aug 12, 2026
…3456)

* feat(github): add PR comment reaction controls

* feat(github): add full PR comment reaction picker

* fix(github): cover all reactable PR comment paths

* fix(github): reconcile comment reactions with main

* fix(github): preserve focus on failed reaction removal

(cherry picked from commit 016df33)
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
…3456)

* feat(github): add PR comment reaction controls

* feat(github): add full PR comment reaction picker

* fix(github): cover all reactable PR comment paths

* fix(github): reconcile comment reactions with main

* fix(github): preserve focus on failed reaction removal
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.

2 participants