Repository navigation
feat(desktop): make PR badge clickable in sidebar - #877
Conversation
- Add hover state with 30% opacity background - Click opens PR in browser via shell.openExternal - Fix vertical centering with leading-none - Add shrink-0 to prevent layout shift
|
Caution Review failedThe pull request is closed. 📝 WalkthroughWalkthroughAdds an optional Changes
Sequence Diagram(s)sequenceDiagram
participant UI as WorkspaceStatusBadge (button)
participant Renderer as Renderer Main Process
participant Electron as electronTrpc.openUrl
participant Browser as External Browser
UI->>Renderer: onClick (prUrl)\nstopPropagation()
Renderer->>Electron: openUrl.mutate(prUrl)
Electron->>Browser: open(prUrl)
Browser-->>Electron: opened
Electron-->>Renderer: success
Renderer-->>UI: click handled (no further propagation)
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
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: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
apps/desktop/src/renderer/screens/main/components/WorkspaceSidebar/WorkspaceListItem/WorkspaceStatusBadge.tsx (1)
21-73: Add error handling foropenUrlmutation inWorkspaceStatusBadge.The mutation at line 72 silently fails without error logging. The procedure definition confirms the input expects a string (which
prUrlcorrectly provides), but errors are not caught at the call site. Add error handling following the codebase pattern:- const handleClick = (e: React.MouseEvent) => { - if (prUrl) { - e.stopPropagation(); - openUrl.mutate(prUrl); - } + const handleClick = (e: React.MouseEvent) => { + if (prUrl) { + e.stopPropagation(); + openUrl.mutate(prUrl, { + onError: (error) => { + console.error( + "[workspace-status-badge/open-url] Failed to open PR URL", + error, + ); + }, + }); + }Per coding guidelines, errors must not be swallowed and should include context-prefixed logging.
Remove conditions that hid branch subtitle when name matched branch or during rename - branch is now always visible for worktree workspaces.
🧹 Preview Cleanup CompleteThe following preview resources have been cleaned up:
Thank you for your contribution! 🎉 |
Summary
Test plan
Summary by CodeRabbit
New Features
Refactor
✏️ Tip: You can customize this high-level summary in your review settings.