Repository navigation
feat(settings): the rail's groups fold, and stay as you left them - #301
Conversation
Each group of Settings' rail (Models, Agent, Reach, Portal and Extension settings) has a heading that folds it: a button with a chevron, aria-expanded and aria-controls, pressed with the mouse, Enter or Space. Every group is open until it is folded by hand. What is folded is kept in this browser through safe-storage under pithagoras.settings.rail-closed, by the groups' English names. The group of the page showing is held open, as the sidebar holds its Extensions group: a search, a link or an address that goes to a page in a folded group finds it open, and it folds again once a page of another group is shown. While held, its heading does nothing and says why. The search's list stands in for the rail while something is typed, so it finds what is in a folded group as before. On a phone, a press on a heading keeps the rail: Modal's rail turns to the page for any button in it except one that says it folds something (aria-expanded). Closes #268 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 7 minutes. View limit details
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
The folding heading put its label in a `truncate` span, so German's "Einstellungen der Erweiterungen" was cut off at every desktop width, on the group the fold was made for. The label wraps again, as the plain heading before it did; the chevron stays at the right. A German spec checks that none of the rail's headings runs past the room it has. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
What was asked
#268: with a few extensions installed, Settings' rail is a long flat list. Each group in it (Models, Agent, Reach, Portal, Extension settings) should fold and open under its heading. The open or closed state should survive closing Settings and reloading. The active page's group should stay usable, and search should still find what is in a folded group.
The change
RailGroup(ConfigModal.tsx): the group's label is now a button with a chevron,aria-expandedandaria-controls. The pages under it are arole="group"that ishiddenwhile the group is folded. It works with a click, Enter or Space, since it is a plain button. A label wider than the rail goes on to a second line, as the plain heading before it did, so German's "Einstellungen der Erweiterungen" is shown whole at every width; the chevron stays at the right.pithagoras.settings.rail-closed, throughlocalfrom safe-storage (the same way the extension rail snapshot beside it is saved). Every group is open until someone folds one, so nobody's rail changes after this update.nav.id) and an extension's page (railSpec). While a group is held, its heading does nothing, hasaria-disabled, and shows the sidebar's existing tooltip "Open while one of its pages is showing" (already in de.ts). So a search hit, a link or an address that goes to a page in a folded group shows that group open with the page marked. The group folds again once you go to a page in another group. This also keeps the current page from being hidden while it has the focus.aria-expanded) is now the one exception, and the rail stays in view.docs/guide/settings.mdnow describes folding, what is remembered, the held group, search, and the phone.No new UI text: the group labels and the tooltip were already translated.
What it does not do
Tests
New specs in
tests/browser/settings.spec.mts:aria-controlsmatches its group. Folding Reach and Extension settings hides their pages, saves["Reach","Extension settings"], and the page being shown stays. After a reload they are still folded. Enter and Space open and fold a group and the focus stays on the heading. A group opened again is still open after a reload.aria-current. The held heading hasaria-disabledand the tooltip. Pressing it with Enter or a click changes nothing, including the saved list. The group folds again once a page of another group is shown.scrollWidthis no more than itsclientWidth. With the label's oldtruncateput back, it fails on "Einstellungen der Erweiterungen", at the default 1280 px width.Mutation check: each of these, applied alone, makes at least one of the three new specs fail: ignoring "held", not saving, folded by default, a held heading that still toggles, the extension group or the fixed groups never held, no
aria-expanded, Modal's old "any button" rule, and a save that drops the other groups' entries (9 of 9).Runs (macOS, node 22, Chromium):
tsc --noEmitfor core/web,npm run build -w core/web,npm run check:boundaries: clean.node --testfor i18n, safe-storage-use, settings-search, aria-names, translated-text and check-boundaries: 37 passed.composer-providers.spec.mts(the chat's model menu, which doesn't use Settings) while the machine was under heavy load. Rerun 3× with this change: 21/21 passed.settings.spec.mts,sidebar-extensions.spec.mtsandmobile.spec.mtsonce more at the end: 46 passed.tsc --noEmitfor core/web is clean.settings,language,settings-modes,translated-text,accessible-names,dialog-focus,focus-ring,extensions-settings,settings-choicesandsettings-discardspecs: 126 of 128 passed. The two failures werefocus-ring.spec.mts's "a field, a checkbox, a dropdown and a button show the focus" (light and dark) while the machine's load average was over 20. It also fails without this PR: with main'sConfigModal.tsxandModal.tsxput back, it failed 8 of 10 runs; with this PR it failed 1 of 4.Closes #268
🤖 Generated with Claude Code
Summary by CodeRabbit