Commit 8e1d0e9
authored
fix(dotcom): hide section header when sidebar has a single section (tldraw#9416)
In order to avoid a redundant group header when the sidebar file list
only has one time-based group (e.g. only "Today", or only "Older"), this
PR hides the solo section's title via CSS.
Each section renders as a `sidebarFileSectionWrapper` element directly
inside the file list container, and empty groups render as `null` rather
than empty nodes. So "only one section is present" is exactly
`:only-child`, and a single CSS rule hides that section's header. As
soon as a second section appears, all headers return.
Closes tldraw#9412
### Change type
- [x] `improvement`
### Test plan
1. Open tldraw.com with an account whose files all fall into a single
time group (e.g. all created today).
2. Confirm the sidebar shows the file list with no "Today" header.
3. Create or open an older file so a second group appears.
4. Confirm both group headers ("Today", "Older", etc.) are now shown.
### Release notes
- Hide the sidebar file-group header when only one group is present.
### Code changes
| Section | LOC change |
| ------- | ---------- |
| Apps | +6 / -0 |1 parent f504e0d commit 8e1d0e9
1 file changed
Lines changed: 6 additions & 0 deletions
Lines changed: 6 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
425 | 425 | | |
426 | 426 | | |
427 | 427 | | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
428 | 434 | | |
429 | 435 | | |
430 | 436 | | |
| |||
0 commit comments