Repository navigation
fix(sidebar): unify the rail rule, scale rail rows, and add a compact toggle - #1606
Merged
Merged
Conversation
… toggle The icon rail was decided by four callers with two thresholds, so showing the sidebar where only the preview rule wanted the rail expanded it to full width and then snapped it back. One fit rule now serves the preview tick, the header toggle, and the chooser, and a pure RailPolicy turns fit changes into an edge-triggered automatic rail that an explicit choice overrides. Rail rows and the update row take the scaled header-control size from code instead of a fixed 24 px CSS minimum, so the rail icons stay under the header toggle at every text size. A button at the foot of the sidebar switches between the full sidebar and the rail and persists as the new sidebar_compact preference; on an automatic rail it expands the window's sidebar without changing the preference, so open, compact, and closed are all reachable at any width. Closes #1602
The toggle no longer flips visibility: a click or Ctrl+B steps the sidebar from full to the icon rail to hidden and back, with the tooltip naming the next step, so one control reaches every mode. The rail step persists as sidebar_compact and the footer button is gone. The preview's fit rule now treats an unallocated window as unknown rather than short, and only measures the content paned's room while the sidebar shows, so a hidden sidebar in a second window no longer rails itself before it is first shown.
This comment has been minimized.
This comment has been minimized.
…es the step Assistive technology and the E2E suite find the header toggle by name, so the name stays "Toggle sidebar" in every mode and only the tooltip announces the next step. The tenxer keyboard scenario now steps through the rail before hiding.
…get cannot latch it
IKurokami
added a commit
to IKurokami/strata
that referenced
this pull request
Oct 13, 2026
Apply changes from lgse/strata@d0f7028 onto the Windows fork without discarding fork commits. Includes the sidebar rail fit policy, three-state toggle, preferences, translations, documentation and tests.
This was referenced Oct 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The sidebar's icon rail was decided in four places with two different thresholds: the window-only rule (
preferred sidebar + one column) in the layout tick, the header toggle, and the preview's rail release, and the preview's own rule (sidebar + navigated columns + preview minimum, with hysteresis) in its split sync. Showing the sidebar in a window where only the preview rule wanted the rail opened it at full width and then snapped it back to the rail. Rail rows also kept a hard-coded 24 px minimum from CSS while the header toggle scales with the text size, so below 100 % the rail icons drifted off the toggle's axis. And the rail was purely automatic: no way to see the full sidebar in a narrow window, or to keep the rail in a wide one.PreviewDrawer::sidebar_fitapplies the preview rule whenever a preview, placeholder, or reserved Columns slot is present and the window rule otherwise; the preview tick, the header toggle, and the chooser all ask it. The separate layout tick andrelease_sidebar_railare gone.RailPolicyturns fit observations into an edge-triggered automatic rail: a change in fit compacts an expanded sidebar once, space that returns releases only what it compacted, and an explicit choice overrides either way. It is pure and unit-tested.Ctrl+B(andCtrl+Nin 10xer mode) take the same step, and the tooltip names the next one. The rail step persists as the newsidebar_compactpreference, which existing windows bind to live; stepping from hidden to full asks for the full sidebar even where space railed it automatically, so all three modes are reachable at any width. The chooser keeps its steps for the dialog only.Visual evidence
Pending owner upload. Local captures (private Xvfb, Cairo renderer):
evidence/before-rail-text-sizes-9-11-13-16.pngevidence/after-rail-text-sizes-9-11-13-16.pngevidence/after-toggle-steps-720px.pngevidence/after-toggle-steps-1200px.pngHow to test
Ctrl+B(or click the header toggle) four times. The sidebar hides, comes back at full width and stays there, compacts to the rail, then hides again; the toggle's tooltip names the next step each time.Ctrl+Bonce, then open a second window: both show the rail, andsidebar_compact = trueis insettings.toml. Press it twice more in either window: both hide, then both expand.Expected result: the sidebar never expands and snaps back; rail icons align with the toggle at every text size; one toggle reaches open, compact, and closed, and the compact step follows every window like the expanded one.
Related issue
Closes #1602