Skip to content

Constrain right sidebar primary action widths#5249

Merged
AmethystLiang merged 3 commits into
mainfrom
max-width-to-right-side-buttons
Jun 12, 2026
Merged

Constrain right sidebar primary action widths#5249
AmethystLiang merged 3 commits into
mainfrom
max-width-to-right-side-buttons

Conversation

@AmethystLiang

Copy link
Copy Markdown
Contributor

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

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

coderabbitai Bot commented Jun 12, 2026

Copy link
Copy Markdown

Review Change Stack

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 8e32d25f-7696-41d5-aaf6-d8afe40f10dc

📥 Commits

Reviewing files that changed from the base of the PR and between 8c5b3a7 and 2734cd7.

📒 Files selected for processing (1)
  • src/renderer/src/components/right-sidebar/SourceControl.tsx

📝 Walkthrough

Walkthrough

This PR consolidates styling for right-sidebar action buttons by introducing a new shared constants module and refactoring components to use it. The right-sidebar-primary-action-layout.ts module exports Tailwind class constants for split action rows, primary buttons, and label containers. Tests validate that these constants include proper shrink constraints and width utilities. HostedReviewActions is refactored to import and apply these constants for its merge button layout, including the split row wrapper and label span. SourceControl is updated to improve label sizing with additional truncation utilities.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description lacks required sections from the template including Screenshots, Testing checklist details, AI Review Report, Security Audit, and Notes sections. Add missing template sections: Screenshots (or state 'No visual change'), complete Testing checklist with explanations, include AI Review Report covering cross-platform compatibility, provide Security Audit summary, and add Notes section for platform-specific behavior.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: constraining right sidebar primary action widths instead of using hard minimums, which is the core objective of this PR.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 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 and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 8e32d25f-7696-41d5-aaf6-d8afe40f10dc

📥 Commits

Reviewing files that changed from the base of the PR and between 8c5b3a7 and 2734cd7.

📒 Files selected for processing (1)
  • src/renderer/src/components/right-sidebar/SourceControl.tsx

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 8c5b3a7 and 2734cd7.

📒 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-lines suppression. Please move this new logic into focused hooks/modules instead of growing SourceControl.tsx further.

As per coding guidelines, “Never add a max-lines disable 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

@AmethystLiang AmethystLiang merged commit 4278fdc into main Jun 12, 2026
1 check passed
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