Skip to content

fix(sidebar): restyle section headers as inline dividers - #1992

Merged
l0gicgate merged 5 commits into
lgse:mainfrom
wmfeht:fix/1991-sidebar-section-header-toggles
Nov 2, 2026
Merged

l0gicgate merged 5 commits into
lgse:mainfrom
wmfeht:fix/1991-sidebar-section-header-toggles

Conversation

@wmfeht

@wmfeht wmfeht commented Nov 1, 2026 •

Copy link
Copy Markdown
Collaborator

Description

Restyles the Pinned and Devices section headers added in #1390 as inline dividers and fixes their interaction problems:

  • Inline divider layout: each header shows the title, a thin rule filling the remaining width, the item count (only while the section is collapsed and has items), and a trailing chevron that points down when expanded and right when collapsed. The title lines up with the row icons, and the chevron lines up with the eject buttons.
  • No standalone divider in the full sidebar: the separator above each section is now transparent spacing because the header's rule replaces it. The icon rail hides the headers, so it still draws the separator.
  • Size: the header is 24 px tall with no padding, down from 30 px plus padding, the same height as the sidebar rows. The hover fill uses the same width and rounding as a row's.
  • No focus ring after a click: the toggle no longer takes focus on click, so focus stays in the listing. The outline uses :focus-visible, so keyboard focus still shows it.

Visual evidence

image image image

How to test

  1. Pin a few folders and connect a removable drive so both the Pinned and Devices sections show.
  2. Compare the headers with the rows: the title starts at the row icons, the rule fills the space, and the chevron sits at the right edge.
  3. Click PINNED to collapse it, then click it again to expand it.
  4. Turn on the compact sidebar (icon rail).

Expected result: Expanded sections show TITLE ─── ˅ with no count. A collapsed section shows its item count before a › chevron. Clicking toggles the section without leaving an accent outline, and keyboard focus stays in the file listing. In the icon rail the headers are hidden and a thin divider still separates the sections.

Related issue

Closes #1991

… ring

Size the Pinned and Devices header toggles like sidebar rows, stretch
them across the sidebar and up to the divider above so the hover fill
meets the divider lines, and stop them taking focus on click. The focus
outline now shows only for keyboard focus.

Fixes lgse#1991
@github-actions github-actions Bot added the fix label Nov 1, 2026
Lay out the Pinned and Devices headers as the title, an inline rule, the
item count while collapsed, and a trailing chevron. The full sidebar
drops the standalone divider above each section in favour of the inline
rule; the icon rail, which hides headers, still draws it.

Refs lgse#1991
@wmfeht wmfeht changed the title fix(sidebar): tighten section header toggles and drop the click focus ring fix(sidebar): restyle section headers as inline dividers Nov 1, 2026
Size the chevron like a device action and inset it by the device row's
right padding, so it lines up with the eject column at every text size.

Refs lgse#1991
A CSS-rotated icon is not pixel-snapped, so under GL rendering and
fractional scaling the expanded chevron drifted about a pixel right of
the eject column. Show a Lucide chevron-down while expanded and the
right chevron while collapsed instead.

Refs lgse#1991
@wmfeht

wmfeht commented Nov 1, 2026

Copy link
Copy Markdown
Collaborator Author

Review

No bugs found in the PR head (5f4afb2f).

Checked:

  • Header state: each header gets the right chevron and count badge when it is built (Pinned and Devices), and toggling a section updates both. The chevron stays registered for theme recoloring.
  • Count badge: the new item_count > 0 condition only affects Devices, since Pinned cannot collapse while empty. A Devices section with no countable rows now shows no badge instead of 0.
  • Transparent section spacer: both append_separator callers add a section header immediately after it, so no gap is left without a rule. When Pinned is empty, its spacer is still hidden with the section and shown during file drags.
  • Icon rail: .sidebar-rail .sidebar-section-separator outranks .sidebar-section-separator, so the divider still shows in the rail.
  • Sidebar traversal: the new rule is inside the header button, so rail visibility syncing and row navigation are unaffected.
  • Existing tests: sidebar_sections.rs still holds; the expanded class is still set even though the rotation CSS is gone.
  • Icon and padding: strata-chevron-down.svg matches Lucide's chevron-down geometry and the fallback color of strata-chevron-right.svg, and is in the gresource. The title's left padding now comes from the theme token as intended.

Minor: no regression coverage for the focus fix

.focus_on_click(false) (src/ui/window.rs:2585) is the main fix for #1991, but nothing exercises it. The tests in sidebar_sections.rs use emit_clicked(), which bypasses click focus handling, so they would still pass if the line were removed. Covering it would need a real pointer click, for example a QA scenario that clicks the Pinned header and asserts focus stays in the listing. Low severity: a regression would only bring back the outline and focus jump.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(sidebar): section header toggles are oversized, not flush with dividers, and keep a focus ring after clicking

2 participants