Skip to content

Commit 8e1d0e9

Browse files
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

File tree

apps/dotcom/client/src/tla/components/TlaSidebar/sidebar.module.css

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -425,6 +425,12 @@
425425
margin-bottom: 28px;
426426
}
427427

428+
/* When a section is the only one rendered (e.g. just "Today" or just "Older"),
429+
its header is redundant, so hide it. */
430+
.sidebarFileSectionWrapper:only-child .sidebarFileSectionTitle {
431+
display: none;
432+
}
433+
428434
.sidebarFileSection {
429435
position: relative;
430436
background: var(--tla-color-sidebar);

0 commit comments

Comments
 (0)