Skip to content

fix(docked): add min width on icon elements#8431

Merged
mcoker merged 3 commits into
patternfly:mainfrom
jcmill:bug/8333-menu-toggle-button-icon-width
Jun 8, 2026
Merged

fix(docked): add min width on icon elements#8431
mcoker merged 3 commits into
patternfly:mainfrom
jcmill:bug/8333-menu-toggle-button-icon-width

Conversation

@jcmill

@jcmill jcmill commented May 26, 2026

Copy link
Copy Markdown
Contributor

Closes: #8333

Sets min-width: 1lh on icon elements. This mimics the nav component's icon spacing pattern for docked navigation.

Summary by CodeRabbit

  • Style
    • Enforced a minimum icon width in docked/text-expanded button layouts to keep icons aligned and prevent layout shifts when text visibility changes.
    • Applied the same minimum-width constraint to menu toggle icons in docked/text-expanded layouts for more consistent spacing and visual balance across controls.

Review Change Stack

@jcmill jcmill requested a review from mcoker May 26, 2026 20:28
@coderabbitai

coderabbitai Bot commented May 26, 2026

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Run ID: af3d4701-08d7-407c-b88d-8e1a725846f7

📥 Commits

Reviewing files that changed from the base of the PR and between a7e2f7a and 1d89c63.

📒 Files selected for processing (2)
  • src/patternfly/components/Button/button.scss
  • src/patternfly/components/MenuToggle/menu-toggle.scss
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/patternfly/components/Button/button.scss

Walkthrough

Adds min-width: 1lh to Button and MenuToggle icon elements when in .pf-m-docked (and related .pf-m-text-expanded) states to constrain icon horizontal sizing.

Changes

Icon spacing in docked nav

Layer / File(s) Summary
Add min-width constraint for docked icons
src/patternfly/components/Button/button.scss, src/patternfly/components/MenuToggle/menu-toggle.scss
Button and MenuToggle icon elements receive min-width: 1lh inside the .pf-m-docked (and .pf-m-text-expanded where applicable) rules.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested labels

released on @prerelease``

Suggested reviewers

  • mcoker
  • thatblindgeye
  • kmcfaul
🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title follows conventional commit format with 'fix' prefix and clearly describes the main change of adding min-width to icon elements in docked state.
Linked Issues check ✅ Passed The PR successfully implements the requirement from #8333 by adding min-width: 1lh to button and menu-toggle icon elements in the docked state.
Out of Scope Changes check ✅ Passed All changes are directly related to the stated objective of adding min-width styling to icon elements in docked components; no extraneous modifications detected.

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

Warning

Review ran into problems

🔥 Problems

Git: Failed to clone repository. Please run the @coderabbitai full review command to re-trigger a full review. If the issue persists, set path_filters to include or exclude specific files.


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.

@patternfly-build

patternfly-build commented May 26, 2026

Copy link
Copy Markdown
Collaborator

@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/patternfly/components/MenuToggle/menu-toggle.scss (1)

467-468: ⚡ Quick win

Remove commented-out code for clarity.

The commented-out selector pattern suggests an alternative implementation approach was considered but not pursued. Since the decision has been made to nest the icon constraint within the @at-root block above (lines 462-464), this commented code should be removed to keep the codebase clean.

🧹 Remove commented code
     .#{$menu-toggle}__icon {
       min-width: 1lh;
     }
   }
-
-  // &:where(.pf-m-docked, .pf-m-text-expanded) {
-  // }
 }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/patternfly/components/MenuToggle/menu-toggle.scss` around lines 467 -
468, Remove the leftover commented selector block in menu-toggle.scss — delete
the two commented lines containing "&:where(.pf-m-docked, .pf-m-text-expanded) {
}" (the commented-out selector immediately below the `@at-root` icon constraint)
so the file no longer contains that unused commented code and stays clean.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@src/patternfly/components/MenuToggle/menu-toggle.scss`:
- Around line 467-468: Remove the leftover commented selector block in
menu-toggle.scss — delete the two commented lines containing
"&:where(.pf-m-docked, .pf-m-text-expanded) { }" (the commented-out selector
immediately below the `@at-root` icon constraint) so the file no longer contains
that unused commented code and stays clean.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Run ID: c0650984-a4b4-4cfb-a644-e65a41f3644c

📥 Commits

Reviewing files that changed from the base of the PR and between 15eec94 and 36ca8c1.

📒 Files selected for processing (2)
  • src/patternfly/components/Button/button.scss
  • src/patternfly/components/MenuToggle/menu-toggle.scss

Comment thread src/patternfly/components/Button/button.scss Outdated
Comment thread src/patternfly/components/MenuToggle/menu-toggle.scss Outdated
@coderabbitai

coderabbitai Bot commented May 28, 2026

Copy link
Copy Markdown
Contributor

Actionable comments posted: 0

@jcmill jcmill requested a review from mcoker May 28, 2026 14:01

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

🚀

@mcoker mcoker merged commit 29ff711 into patternfly:main Jun 8, 2026
6 checks passed
@patternfly-build

Copy link
Copy Markdown
Collaborator

🎉 This PR is included in version 6.6.0-prerelease.5 🎉

The release is available on:

Your semantic-release bot 📦🚀

@jcmill jcmill deleted the bug/8333-menu-toggle-button-icon-width branch June 12, 2026 14:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug - button/menu-toggle - update icon width for docked nav

3 participants