Repository navigation
fix(github): complete PR reactions for CodeRabbit reviews - #13456
Conversation
📝 WalkthroughWalkthroughGitHub 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)
✅ Passed checks (4 passed)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
src/main/github/client.test.ts (1)
4626-4629: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAssert the selected mutation.
The assertion passes if this path sends
removeReaction, because both mutations includesubjectIdandcontent. Assert thatquerycontainsaddReaction. 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
📒 Files selected for processing (25)
src/main/github/client.test.tssrc/main/github/client.tssrc/main/github/comment-reactions.test.tssrc/main/github/comment-reactions.tssrc/main/ipc/github.test.tssrc/main/ipc/github.tssrc/main/runtime/orca-runtime.tssrc/main/runtime/rpc/methods/github.test.tssrc/main/runtime/rpc/methods/github.tssrc/main/runtime/runtime-rpc.tssrc/preload/api-types.tssrc/preload/index.tssrc/renderer/src/components/github/CommentReactions.tsxsrc/renderer/src/components/right-sidebar/ChecksPanel.tsxsrc/renderer/src/components/right-sidebar/checks-panel-content.tsxsrc/renderer/src/i18n/locales/en.jsonsrc/renderer/src/store/slices/github.test.tssrc/renderer/src/store/slices/github.tssrc/renderer/src/store/slices/pr-comment-reaction-state.test.tssrc/renderer/src/store/slices/pr-comment-reaction-state.tssrc/renderer/src/web/web-preload-api.test.tssrc/renderer/src/web/web-preload-api.tssrc/shared/types.tstests/e2e/helpers/pr-comments-sidebar-fixture.tstests/e2e/pr-comments-sidebar-cards.spec.ts
| 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) | ||
| ) | ||
| } | ||
| ) | ||
|
|
There was a problem hiding this comment.
🎯 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.
| 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) | |
| ) | |
| } | |
| ) |
|
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. |
…e-with-open-mouth
…e-with-open-mouth
…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)
…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
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
Proof
Before
The CodeRabbit comment starts with the compact Add reaction control.
GitHub-style picker
The picker exposes every GitHub reaction.
After
The selected 🚀 reaction appears as a count pill and can be activated again to remove it.
Interaction video
The exact final implementation passed three repeated recorded Electron runs.
[email protected]
Verification
git diff --checkpassed.Review loop
9 sub-agent review loops total: 5 feature-review loops followed by 4 readiness-checklist loops. Final code verdict: CLEAN.
mainand reduced this PR to the missing follow-up fixes.Compatibility notes