Skip to content

Make CCB Truncate Button Text Before Trying to Squish Buttons#2265

Merged
cbowdoin merged 1 commit intomicrosoft:mainfrom
cbowdoin:user/cbowdoin/CCBTruncateTextBeforeButtonCompression
Apr 16, 2026
Merged

Make CCB Truncate Button Text Before Trying to Squish Buttons#2265
cbowdoin merged 1 commit intomicrosoft:mainfrom
cbowdoin:user/cbowdoin/CCBTruncateTextBeforeButtonCompression

Conversation

@cbowdoin
Copy link
Copy Markdown
Contributor

@cbowdoin cbowdoin commented Apr 16, 2026

Platforms Impacted

  • iOS
  • visionOS
  • macOS

Description of changes

This change makes it so titles in the CommandBar Buttons truncate before we start having to layout out buttons off the screen when the CommandBar is in a non scrollable mode.
To do this we set the content hugging priority of button with texts to be low leading to them getting truncated before buttons that do not have the capacity to be squished.

Binary change

(how is our binary size impacted -- see https://github.com/microsoft/fluentui-apple/wiki/Size-Comparison)

Verification

Scrolling CommandBar had no behavioral changes.
Tested with a resizable view to see titles with text getting shrinked before other buttons.

Visual Verification | Before | After | |----------------------------------------------|--------------------------------------------| | Screenshot or description before this change | Screenshot or description with this change |

Pull request checklist

This PR has considered:

  • Light and Dark appearances
  • iOS supported versions (all major versions greater than or equal current target deployment version)
  • VoiceOver and Keyboard Accessibility
  • Internationalization and Right to Left layouts
  • Different resolutions (1x, 2x, 3x)
  • Size classes and window sizes (iPhone vs iPad, notched devices, multitasking, different window sizes, etc)
  • iPad Pointer interaction
  • SwiftUI consumption (validation or new demo scenarios needed)
  • Objective-C exposure (provide it only if needed)
Microsoft Reviewers: Open in CodeFlow

@cbowdoin cbowdoin requested a review from a team as a code owner April 16, 2026 17:15
@joannaquu
Copy link
Copy Markdown
Contributor

can we revert the max width change now?

Comment thread Sources/FluentUI_iOS/Components/CommandBar/CommandBarButton.swift
@cbowdoin
Copy link
Copy Markdown
Contributor Author

can we revert the max width change now?

We may still need it around for scenario where we want to truncate a scrolling CommandBar

@cbowdoin cbowdoin merged commit 81c39c8 into microsoft:main Apr 16, 2026
7 checks 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.

3 participants