CommunityToolkit / CommunityToolkit/Windows

Ugly resizing behavior for SettingsCard Header

Open
#727 11 comments 1 reaction 0 assignees View on GitHub
Dominant language
C#
Stars
1.1k
Forks
166
PR merge metrics
No merged PRs in 30d

Description

### Describe the bug

- **SettingsCardWrapThreshold** _might_ never be reached because the minimum width of the window
- there is no minimum width for **PART_HeaderPresenter**
- **HeaderPanel** uses `` while the other columns use **Auto**.
- **PART_ContentPresenter** has no **TextWrapping** property, the header and description do

Therefore the header will _always_ give way to the content, even if you set wrapping on a textblock in the content. This combination can lead to very ugly resizing behavior.

### Steps to reproduce

Use a SettingsCard with a Content with a very long piece of text that doesn't wrap (like a file path). You can set the property directly or with a TextBlock, it doesn't matter. Then resize the window, so that the width decreases. Watch the Header.

```xaml






```

### Expected behavior

Header can shrink, but not be hidden.

### Screenshots

![SettingsCard Wrap Threshold](https://github.com/user-attachments/assets/38bf8660-b7aa-4460-9713-34450c3f3cc2)

![SettingsCard Wrap Fail](https://github.com/user-attachments/assets/cdc80f61-c494-4ad8-94dd-69f58d1c9ddb)

### Code Platform

- [ ] UWP
- [x] WinAppSDK / WinUI 3
- [ ] Web Assembly (WASM)
- [ ] Android
- [ ] iOS
- [ ] MacOS
- [ ] Linux / GTK

### Windows Build Number

- [ ] Windows 10 1809 (Build 17763)
- [ ] Windows 10 1903 (Build 18362)
- [ ] Windows 10 1909 (Build 18363)
- [ ] Windows 10 2004 (Build 19041)
- [ ] Windows 10 20H2 (Build 19042)
- [ ] Windows 10 21H1 (Build 19043)
- [ ] Windows 10 21H2 (Build 19044)
- [ ] Windows 10 22H2 (Build 19045)
- [ ] Windows 11 21H2 (Build 22000)
- [x] Other (specify)

### Other Windows Build number

24H2

### App minimum and target SDK version

- [ ] Windows 10, version 1809 (Build 17763)
- [ ] Windows 10, version 1903 (Build 18362)
- [ ] Windows 10, version 1909 (Build 18363)
- [ ] Windows 10, version 2004 (Build 19041)
- [ ] Windows 10, version 2104 (Build 20348)
- [ ] Windows 11, version 22H2 (Build 22000)
- [ ] Other (specify)

### Device form factor

Desktop

### Additional context

- Most basic: set a minimum width on the header/column?
- (and/or) Add **TextWrapping** to **PART_ContentPresenter** ? But then ColumnWidth `*` will _still_ always give way to `Auto`. So it wouldn't fix it.
- Something else?

### Help us help you

Yes, but only if others can assist.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.