Constrain right sidebar primary action widths#5249
Conversation
Introduce min-width constraints, truncation, and content-width layouts for primary actions in the right sidebar and PR dialogs. This prevents buttons from shifting layout dramatically when labels morph dynamically as git and review state changes.
ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThis PR consolidates styling for right-sidebar action buttons by introducing a new shared constants module and refactoring components to use it. The 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
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
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 8e32d25f-7696-41d5-aaf6-d8afe40f10dc
📒 Files selected for processing (1)
src/renderer/src/components/right-sidebar/SourceControl.tsx
There was a problem hiding this comment.
Caution
Inline review comments failed to post. This is likely due to GitHub's internal server error or limits when posting large numbers of comments. If you are seeing this consistently it is likely a permissions issue. Please check "Moderation" -> "Code review limits" under your organization settings.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 8e32d25f-7696-41d5-aaf6-d8afe40f10dc
📒 Files selected for processing (1)
src/renderer/src/components/right-sidebar/SourceControl.tsx
🛑 Comments failed to post (1)
src/renderer/src/components/right-sidebar/SourceControl.tsx (1)
241-264: 🛠️ Refactor suggestion | 🟠 Major | 🏗️ Heavy lift
Extract the new generation-record orchestration out of
SourceControl.tsx.This PR adds another large state machine for commit/PR generation snapshots, hydration, cancellation, and pruning into a file that's already under a
max-linessuppression. Please move this new logic into focused hooks/modules instead of growingSourceControl.tsxfurther.As per coding guidelines, “Never add a
max-linesdisable comment (eslint-disable max-lines,oxlint-disable max-lines, or line-specific variants). Split the file, extract focused modules, move fixtures/builders into named files, or otherwise reduce the counted lines instead.”Also applies to: 895-948, 1342-1790, 2118-2419, 4752-4815
Source: Coding guidelines
Summary\n- make right-sidebar primary action widths preferred/shrinkable instead of hard minimums\n- let tooltip wrapper spans shrink so split-button chevrons stay inside narrow sidebars\n- add a guardrail test for the split-action sizing contract\n\n## Validation\n- pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/components/right-sidebar/right-sidebar-primary-action-layout.test.ts src/renderer/src/components/right-sidebar/CommitArea.test.tsx src/renderer/src/components/right-sidebar/CommitArea.generate.test.tsx src/renderer/src/components/right-sidebar/CommitArea.chevron-spinner.test.tsx src/renderer/src/components/right-sidebar/CommitArea.primary-icons.test.tsx src/renderer/src/components/right-sidebar/PullRequestComposer.generate-tooltip.test.tsx src/renderer/src/components/right-sidebar/ChecksPanel.review-header.test.tsx\n- pnpm exec oxlint src/renderer/src/components/GitHubItemDialog.tsx src/renderer/src/components/PullRequestPage.tsx src/renderer/src/components/feature-wall/review-animated-visual-ship-styles.tsx src/renderer/src/components/right-sidebar/CreateHostedReviewComposer.tsx src/renderer/src/components/right-sidebar/HostedReviewActions.tsx src/renderer/src/components/right-sidebar/HostedReviewStateActions.tsx src/renderer/src/components/right-sidebar/SourceControl.tsx src/renderer/src/components/right-sidebar/right-sidebar-primary-action-layout.ts src/renderer/src/components/right-sidebar/right-sidebar-primary-action-layout.test.ts\n- pnpm run typecheck:web