fix(desktop): clean up review sidebar UI and remove redundant states#2989
Conversation
- Replace inline AlertDialogs with reusable DiscardConfirmDialog component - Simplify ReviewPanel loading skeleton to match app-wide pattern - Flatten comment layout: show active comments directly, Resolved as own section - Remove redundant review label that duplicated badge text - Remove redundant PR state text already conveyed by icon color - Remove duplicate comment count between parent and child sections - Align collapsible trigger styles (padding, hover, chevron sizes) with CategorySection - PR header: compact layout with hover-to-reveal external link - Add section dividers between PR header, checks, and comments - Push comment age to far right, absolutely position hover actions - Clean up unused imports
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughConsolidated discard confirmation dialogs in ChangesView into a shared Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In
`@apps/desktop/src/renderer/screens/main/components/WorkspaceView/RightSidebar/ChangesView/components/ReviewPanel/ReviewPanel.tsx`:
- Line 134: The badge uses the total comments count but the panel shows only
activeComments; change the computation of commentsCountLabel in ReviewPanel
(where isCommentsLoading, comments and activeComments are referenced) to show
"..." when isCommentsLoading is true and otherwise use activeComments.length
(falling back to 0 if undefined) so the “Comments” badge reflects only
active/unresolved comments instead of comments.length.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 7ab7c172-d794-42e8-83d8-2c8e909ec496
📒 Files selected for processing (2)
apps/desktop/src/renderer/screens/main/components/WorkspaceView/RightSidebar/ChangesView/ChangesView.tsxapps/desktop/src/renderer/screens/main/components/WorkspaceView/RightSidebar/ChangesView/components/ReviewPanel/ReviewPanel.tsx
| const commentsCountLabel = isCommentsLoading | ||
| ? "..." | ||
| : countOpenPullRequestComments(comments); | ||
| const commentsCountLabel = isCommentsLoading ? "..." : comments.length; |
There was a problem hiding this comment.
Use active-comment count for the “Comments” badge.
Line 134 uses total comments (comments.length), but this section renders only activeComments. This can show a non-zero count while displaying “No comments yet.” when all comments are resolved.
💡 Suggested fix
- const commentsCountLabel = isCommentsLoading ? "..." : comments.length;
+ const commentsCountLabel = isCommentsLoading ? "..." : activeComments.length;📝 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.
| const commentsCountLabel = isCommentsLoading ? "..." : comments.length; | |
| const commentsCountLabel = isCommentsLoading ? "..." : activeComments.length; |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In
`@apps/desktop/src/renderer/screens/main/components/WorkspaceView/RightSidebar/ChangesView/components/ReviewPanel/ReviewPanel.tsx`
at line 134, The badge uses the total comments count but the panel shows only
activeComments; change the computation of commentsCountLabel in ReviewPanel
(where isCommentsLoading, comments and activeComments are referenced) to show
"..." when isCommentsLoading is true and otherwise use activeComments.length
(falling back to 0 if undefined) so the “Comments” badge reflects only
active/unresolved comments instead of comments.length.
There was a problem hiding this comment.
1 issue found across 2 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="apps/desktop/src/renderer/screens/main/components/WorkspaceView/RightSidebar/ChangesView/components/ReviewPanel/ReviewPanel.tsx">
<violation number="1" location="apps/desktop/src/renderer/screens/main/components/WorkspaceView/RightSidebar/ChangesView/components/ReviewPanel/ReviewPanel.tsx:418">
P3: The empty-state uses `activeComments.length`, so if all comments are resolved the UI still shows “No comments yet.” Update the check to only show the empty state when there are truly no comments.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
…w/RightSidebar/ChangesView/components/ReviewPanel/ReviewPanel.tsx Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
🧹 Preview Cleanup CompleteThe following preview resources have been cleaned up:
Thank you for your contribution! 🎉 |
Summary
DiscardConfirmDialogcomponent (-80 lines of duplication)CategorySectionpattern used in Diffs tabTest plan
Summary by cubic
Cleaned up the Review sidebar UI and removed redundant states to make the panel clearer and consistent with the Diffs tab. Simplifies the PR header, checks, and comments with flatter grouping and fewer labels.
@superset/ui/alert-dialogwith a reusableDiscardConfirmDialog.CategorySection, added section dividers, and simplified loading to a single line.Written for commit c5ae344. Summary will update on new commits.
Summary by CodeRabbit