Skip to content

feat(github): add PR comment reactions - #13470

Merged
Jinwoo-H merged 2 commits into
mainfrom
react-emoji-gh-comment
Aug 10, 2026
Merged

Jinwoo-H merged 2 commits into
mainfrom
react-emoji-gh-comment

Conversation

@Jinwoo-H

@Jinwoo-H Jinwoo-H commented Aug 10, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Adds a GitHub-style reaction picker to right-sidebar PR comments with all eight supported reactions: 👍, 👎, 😄, 😕, ❤️, 🎉, 🚀, and 👀.
  • Existing reaction chips become accessible toggles and update optimistically with targeted rollback on failure.
  • Supports both PR conversation comments and inline review-thread comments, including comments created during the current session.
  • Routes mutations through the established local Electron, paired-web, runtime, WSL, and SSH execution paths.
  • Keeps GitLab behavior unchanged and makes the GraphQL reaction subject ID optional for mixed-version client/host compatibility.

Related work

This supersedes #13456 functionally: that PR exposes permanent 👍/👎 controls, while this implementation matches GitHub's add-reaction picker, supports all eight reactions, and keeps newly posted comments immediately reactable without a refresh.

Proof

GitHub-style reaction picker in the PR comments sidebar

Verification

  • 505 focused unit/API/IPC/runtime/preload/store tests passed across 9 files.
  • Electron PR-comments sidebar suite passed: 5/5.
  • Reaction interaction passed repeatedly while capturing visual proof.
  • Full TypeScript typecheck passed.
  • Changed-code quality, type-aware quality, and React Doctor: 0 new findings.
  • Max-lines ratchet passed with no new bypasses.
  • Localization catalog, extraction, and coverage checks passed.
  • git diff --check passed.

Internal review

Three review/fix rounds:

  1. NOT CLEAN — preserved REST node_id for newly created conversation/review comments and changed failed optimistic mutations to roll back only the attempted reaction.
  2. NOT CLEAN — the final Electron run exposed a pre-existing workspace-activation race in the shared openChecks helper; the helper now opens Checks through the rendered control and waits for route reconciliation to stabilize.
  3. CLEAN — no correctness, security, maintainability, design-system, accessibility, cross-platform, SSH/folder-workspace, provider-separation, mixed-version, or performance findings remain.

Security and compatibility

  • Reaction content is restricted to GitHub's supported enum at the runtime boundary.
  • Subject IDs are passed as gh argv fields, not shell-interpolated commands.
  • Local IPC retains registered-repository validation; runtime execution resolves the target repository on the executing host.
  • New clients paired with older hosts receive no optional subject ID and show reactions read-only; older clients safely ignore fields published by newer hosts.

@Jinwoo-H
Jinwoo-H requested a review from brennanb2025 as a code owner August 10, 2026 04:33
@coderabbitai

coderabbitai Bot commented Aug 10, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

GitHub PR comments now include GraphQL reaction subject IDs and viewer reaction state. A guarded client mutation adds or removes reactions with rate-limit tracking. IPC, runtime RPC, preload, and web APIs expose the mutation. Renderer state applies optimistic updates and restores prior state on failure. Comment rows now provide interactive reaction buttons and a picker with localized labels. Unit, integration, and end-to-end tests cover mapping, transport, state updates, rollback, and UI behavior.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 17.65% 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 primary change: adding pull request comment reactions.
Description check ✅ Passed The description covers the user-visible change, visual proof, testing, AI review, security, compatibility, and follow-up details.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch

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.

@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.

🧹 Nitpick comments (1)
src/renderer/src/components/github/CommentReactions.tsx (1)

65-69: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Use hash-based locale keys, not descriptive names. Both files use 10-character SHA-1-hash keys everywhere else (for example a18f669c7a, 7fad8509fe). The new reaction-related keys use descriptive names instead, breaking the convention that localize-renderer-strings.mjs relies on to generate and match keys.

  • src/renderer/src/components/github/CommentReactions.tsx#L65-L69: replace the key 'auto.components.github.CommentReactions.addReaction' with the 10-character SHA-1 hash of <filePath>:Add reaction.
  • src/renderer/src/components/github/CommentReactions.tsx#L152-L164: replace the keys 'auto.components.github.CommentReactions.removeNamedReaction' and 'auto.components.github.CommentReactions.addNamedReaction' with their corresponding hash-based keys.
  • src/renderer/src/components/right-sidebar/ChecksPanel.tsx#L2980-L2985: replace the key 'auto.components.right.sidebar.ChecksPanel.updateReactionFailed' with the 10-character SHA-1 hash of <filePath>:Failed to update reaction..

Based on learnings, "generate locale keys as the first 10 characters of the SHA-1 hash of <filePath>:<text>, matching localize-renderer-strings.mjs. Reuse the same generated key whenever identical source text appears in the same context." Please confirm with localize-renderer-strings.mjs whether it requires this exact hash format to pick up and manage these strings, or whether descriptive keys are tolerated.

Source: Learnings


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 20298944-28c1-4868-b3b2-927c9f4a23cc

📥 Commits

Reviewing files that changed from the base of the PR and between 4cca31f and f47267b.

📒 Files selected for processing (24)
  • 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/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/lib/pr-comment-reactions.test.ts
  • src/renderer/src/lib/pr-comment-reactions.ts
  • src/renderer/src/store/slices/github.test.ts
  • src/renderer/src/store/slices/github.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

@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.

🧹 Nitpick comments (1)
tests/e2e/helpers/source-control-ai-generation.ts (1)

49-57: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick win

Avoid repeated clicks inside expect.poll.

expect.poll can invoke the callback more than once. If the tab transition takes longer than 250 ms, this code clicks checksButton again before the first state update is observed. If the button has toggle behavior, the second click can close the sidebar. Click once after the sidebar is ready, then poll only rightSidebarTab.

If repeated clicks are intentional, verify that the Checks control is idempotent during a delayed tab transition.

Proposed polling flow
 const checksButton = page.getByRole('button', { name: 'Checks', exact: true })
-await expect
-  .poll(
-    async () => {
-      if ((await page.evaluate(() => window.__store?.getState().rightSidebarTab)) !== 'checks') {
-        await checksButton.click()
-      }
-      await page.waitForTimeout(250)
-      return page.evaluate(() => window.__store?.getState().rightSidebarTab)
-    },
-    { timeout: 10_000 }
-  )
-  .toBe('checks')
+await expect(checksButton).toBeVisible({ timeout: 10_000 })
+await checksButton.click()
+await expect
+  .poll(
+    () => page.evaluate(() => window.__store?.getState().rightSidebarTab),
+    { timeout: 10_000 }
+  )
+  .toBe('checks')

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 0d157b12-1ef1-4620-aee3-63358cb3c07a

📥 Commits

Reviewing files that changed from the base of the PR and between f47267b and 6f5d544.

📒 Files selected for processing (10)
  • src/main/github/client-pr-local-runtime.test.ts
  • src/main/github/client.ts
  • src/main/github/issues.test.ts
  • src/main/github/issues.ts
  • src/renderer/src/components/right-sidebar/ChecksPanel.tsx
  • src/renderer/src/lib/pr-comment-reactions.test.ts
  • src/renderer/src/lib/pr-comment-reactions.ts
  • src/renderer/src/store/slices/github.test.ts
  • src/renderer/src/store/slices/github.ts
  • tests/e2e/helpers/source-control-ai-generation.ts
🚧 Files skipped from review as they are similar to previous changes (5)
  • src/renderer/src/lib/pr-comment-reactions.test.ts
  • src/renderer/src/components/right-sidebar/ChecksPanel.tsx
  • src/renderer/src/store/slices/github.ts
  • src/main/github/client.ts
  • src/renderer/src/store/slices/github.test.ts

@Jinwoo-H
Jinwoo-H merged commit 158212b into main Aug 10, 2026
47 checks passed
mephraums pushed a commit to mephraums/orca that referenced this pull request Aug 12, 2026
* feat(github): add PR comment reactions

* fix(github): harden comment reaction updates

---------

Co-authored-by: Jinwoo-H <[email protected]>
(cherry picked from commit 158212b)
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
* feat(github): add PR comment reactions

* fix(github): harden comment reaction updates

---------

Co-authored-by: Jinwoo-H <[email protected]>
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