CommunityToolkit / CommunityToolkit/Windows

Ugly resizing behavior for SettingsCard Header

Offen
#727 11 Kommentare 1 Reaktion 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
C#
Sterne
1.1k
Forks
166
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

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

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Beginne mit den im Bericht genannten SettingsCard-Layout-Elementen: SettingsCardWrapThreshold, PART_HeaderPresenter, HeaderPanel und PART_ContentPresenter. Reproduziere das Problem mit dem bereitgestellten XAML und einem langen Pfad ohne Umbruch, während du die Fenstergröße änderst; abgeschlossen ist es, wenn die Kopfzeile schrumpfen kann, aber nicht ausgeblendet wird und das Verhalten beim Ändern der Fenstergröße nicht mehr visuell fehlerhaft ist.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
csharp
Bereich
desktop, frontend
Issue-Typ
Bug
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.