Skip to content

Fix Command Bar Title Compression#2268

Open
cbowdoin wants to merge 1 commit intomicrosoft:mainfrom
cbowdoin:user/cbowdoin/CommandBarTitleCompression
Open

Fix Command Bar Title Compression#2268
cbowdoin wants to merge 1 commit intomicrosoft:mainfrom
cbowdoin:user/cbowdoin/CommandBarTitleCompression

Conversation

@cbowdoin
Copy link
Copy Markdown
Contributor

@cbowdoin cbowdoin commented Apr 29, 2026

Platforms Impacted

  • iOS
  • visionOS
  • macOS

Description of changes

Fixed truncation logic in CommandBar by switching from low contentHuggingPriority to low contentCompressionResistancePriority. We want compression resistance because we want titles to shrink before we try and push other buttons off the screen.

Binary change

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

Verification

Validated in test app that titles shrink correctly.

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 marked this pull request as ready for review April 29, 2026 22:08
@cbowdoin cbowdoin requested a review from a team as a code owner April 29, 2026 22:08
@cbowdoin cbowdoin changed the title Fixed title compression Fix Command Bar Title Compression Apr 29, 2026

if item.title != nil {
setContentHuggingPriority(.defaultLow, for: .horizontal)
setContentCompressionResistancePriority(.defaultLow, for: .horizontal)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Do we still also need the hugging priority, in addition to the compression resistance, to keep the title from stretching?

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.

2 participants