CommunityToolkit / CommunityToolkit/Windows

Ugly resizing behavior for SettingsCard Header

Aperta
#727 11 commenti 1 reazione 0 assegnatari Vedi su GitHub
Lingua principale
C#
Stelle
1.1k
Fork
166
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

### 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.

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Inizia con gli elementi di layout di SettingsCard indicati nel report: SettingsCardWrapThreshold, PART_HeaderPresenter, HeaderPanel e PART_ContentPresenter. Riproduci il problema con lo XAML fornito e un percorso lungo che non va a capo mentre ridimensioni la finestra; il lavoro è completato quando l'intestazione può ridursi ma non viene nascosta e il comportamento durante il ridimensionamento non appare più visivamente errato.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
csharp
Ambito
desktop, frontend
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.