Skip to content

[JEWEL-1061] Fix split button chevron getting squashed - #3283

Closed
Sebastiano Poggi (rock3r) wants to merge 1 commit into
JetBrains:masterfrom
rock3r:sebp/JEWEL-1061_fix-split-button-chevron
Closed

Sebastiano Poggi (rock3r) wants to merge 1 commit into
JetBrains:masterfrom
rock3r:sebp/JEWEL-1061_fix-split-button-chevron

Conversation

@rock3r

@rock3r Sebastiano Poggi (rock3r) commented Oct 17, 2025 •

Copy link
Copy Markdown
Collaborator

This fixes an issue with the secondary content (the chevron) getting squashed in split buttons, when there isn't enough space to show both the primary and secondary contents fully.

As a bonus, this also fixes:

  • The divider height is no longer capped, but scales correctly with the button's height
  • Colours were all sorts of wrong in standalone mode for buttons, especially in the disabled state (they are fine in bridge mode)
  • The semantics role of the secondary action is now the same as in Swing (button)
  • The modifier passed to split buttons is now applied in the right place, and the internal layout is simplified

The buttons showcase is also improved, now showing a space-constrained split button that did not use to work correctly, and putting all the content in flow rows so it scales better as the window is resized. The visual appearance is also tweaked to better represent the information hierarchy.

Screen.Recording.2025-10-17.at.19.20.41.mov

Before

  Screenshot
Light before light
Dark before dark

After

Swing Jewel
swing light jewel light after
swing dark jewel dark after

Release notes

Bug fixes

  • Fixed a bug with *SplitButtons where the chevron would get squashed if the button wasn't wide enough to fit both the main and secondary content
  • Fixed a bug with *SplitButtons where the divider height was limited, and would not grow with the button's height if it gets taller than the minimum height
  • Fixed several bugs with *Button colours in standalone, especially in the disabled state, to realign them with Swing
  • Fixed the semantics role of the secondary action in *SplitButtons to be the same as in Swing
  • Fixed the modifier passed to *SplitButtons being applied to the wrong level, causing all sorts of unexpected behaviour (e.g., if you set a height, the button's visual height would not grow)

Note

Fixes split button chevron width and divider scaling, refines standalone button colors (incl. disabled), and updates showcase plus tests.

  • Components (SplitButton & Button):
    • Ensure chevron width equals button min height; prevent squashing under width constraints and scale height with taller buttons.
    • Divider now scales with button height; secondary action has button role and disabled appearance.
    • Apply modifier at the correct level; simplify internal layout and give primary content weight when chevron present.
    • Popup width coerced to at least button width; key handling refactored in root container.
  • Styling (Standalone IntUI):
    • Tweak ButtonColors (light/dark): disabled backgrounds now Color.Unspecified; adjust disabled content/border shades.
    • Update SplitButtonStyle colors (light/dark): corrected divider, chevron, and disabled divider colors.
  • Samples (Showcase):
    • Rework buttons page: use FlowRow, add group headers, single-line texts with ellipsis, width/height-constrained split button demos, and blank-notice menu items.
  • Tests:
    • Add UI tests verifying popup sizing constraints and chevron width/height behavior under width/height constraints.

Written by Cursor Bugbot for commit bf3539a. This will update automatically on new commits. Configure here.

@rock3r

Copy link
Copy Markdown
Collaborator Author

(I'll rebase to get the Metalava fixes when I get the second review)

@rock3r

Copy link
Copy Markdown
Collaborator Author

Ready to merge

This fixes an issue with the secondary content (the chevron)
getting squashed in split buttons, when there isn't enough
space to show both the primary and secondary contents fully.

As a bonus, this also fixes:
 * The divider height is no longer capped, but scales
   correctly with the button's height
 * Colours were all sorts of wrong in standalone mode for
   buttons, especially in the disabled state (they are fine
   in bridge mode)
 * The semantics role of the secondary action is now the same
   as in Swing (button)
 * The modifier passed to split buttons is now applied in
   the right place, and the internal layout is simplified

The buttons showcase is also improved, now showing a space-
constrained split button that did not use to work correctly,
and putting all the content in flow rows so it scales better
as the window is resized. The visual appearance is also
tweaked to better represent the information hierarchy.
}
) {
content()
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Bug: Row height doesn't scale when button height increases

The Row inside ButtonImpl has an explicit .height(style.metrics.minSize.height) constraint but lacks fillMaxHeight(). When a button's height is increased via modifier (e.g., Modifier.height(80.dp)), the Row remains at the minimum height instead of scaling to fill the available space. This causes the chevron and divider to not scale with the button height, causing the "chevron and divider scale beyond the minimum button height" test to fail. The Row should include fillMaxHeight() to properly expand when the button becomes taller.

Additional Locations (1)

Fix in Cursor Fix in Web

@rock3r

Copy link
Copy Markdown
Collaborator Author

Spotted some issues I'll have to fix after the last rebase :((((

@rock3r

Copy link
Copy Markdown
Collaborator Author

Nevermind, it actually works fine. Go figure

@rock3r
Sebastiano Poggi (rock3r) deleted the sebp/JEWEL-1061_fix-split-button-chevron branch November 26, 2025 16:47
intellij-monorepo-bot pushed a commit that referenced this pull request Dec 19, 2025
This fixes an issue with the secondary content (the chevron)
getting squashed in split buttons, when there isn't enough
space to show both the primary and secondary contents fully.

As a bonus, this also fixes:
 * The divider height is no longer capped, but scales
   correctly with the button's height
 * Colours were all sorts of wrong in standalone mode for
   buttons, especially in the disabled state (they are fine
   in bridge mode)
 * The semantics role of the secondary action is now the same
   as in Swing (button)
 * The modifier passed to split buttons is now applied in
   the right place, and the internal layout is simplified

The buttons showcase is also improved, now showing a space-
constrained split button that did not use to work correctly,
and putting all the content in flow rows so it scales better
as the window is resized. The visual appearance is also
tweaked to better represent the information hierarchy.

closes #3283

(cherry picked from commit d642d70d7b31397d92b78e5c8fc044f8e4bcaad5)


(cherry picked from commit 642538ee94b8ec34ee38d0d2db45133a2be16557)

IJ-MR-185912

GitOrigin-RevId: 4d2e22d9d94dbcff4127d737d60e2d14944edf5a
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.

3 participants