Skip to content

feat(settings): the rail's groups fold, and stay as you left them - #301

Merged
thecodacus merged 2 commits into
mainfrom
feat/settings-rail-groups-fold
Oct 23, 2026
Merged

thecodacus merged 2 commits into
mainfrom
feat/settings-rail-groups-fold

Conversation

@thecodacus

@thecodacus thecodacus commented Oct 23, 2026 •

Copy link
Copy Markdown
Owner

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-expanded and aria-controls. The pages under it are a role="group" that is hidden while 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.
  • Kept per browser: the folded groups are saved as a list of their English names under pithagoras.settings.rail-closed, through local from 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.
  • Held open: the group that holds the page being shown stays open, the way the sidebar keeps its Extensions group open (feat: group the extensions' pages in the sidebar and on the rail #241). That covers a fixed tab (nav.id) and an extension's page (railSpec). While a group is held, its heading does nothing, has aria-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.
  • Search: no change. While something is typed, the search results take the rail's place, so a result from a folded group is listed as before.
  • Phone (Modal.tsx): on a phone, Modal's rail treated every button in it as "pick this page" and switched to the page view, so a fold heading would have left the rail. A button that says it folds something (aria-expanded) is now the one exception, and the rail stays in view.
  • Docs: docs/guide/settings.md now 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

  • It does not clear the search after a result is picked. The results stay in the rail's place until the search is cleared, as on main.
  • It does not keep a group open after you leave its page. A group folded by hand folds again, like the sidebar's group.
  • It does not change the order or grouping of the tabs, and it adds no "fold all" control.

Tests

New specs in tests/browser/settings.spec.mts:

  • Every group starts open, and aria-controls matches 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.
  • A page in a folded group, reached through search (a fixed page and an extension's page) or its address, shows its group open with the page marked aria-current. The held heading has aria-disabled and 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.
  • On a phone (390 px), folding a group keeps the rail (no Back button, the search still shows). Picking a page in a reopened group opens that page.
  • In German, none of the five headings is cut off: each label's scrollWidth is no more than its clientWidth. With the label's old truncate put 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 --noEmit for core/web, npm run build -w core/web, npm run check:boundaries: clean.
  • node --test for i18n, safe-storage-use, settings-search, aria-names, translated-text and check-boundaries: 37 passed.
  • Every browser spec file that opens Settings (57 files, core and extensions): 749 passed and 1 failed. The failure was 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.mts and mobile.spec.mts once more at the end: 46 passed.
  • After the heading fix (3f91d79): tsc --noEmit for core/web is clean. settings, language, settings-modes, translated-text, accessible-names, dialog-focus, focus-ring, extensions-settings, settings-choices and settings-discard specs: 126 of 128 passed. The two failures were focus-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's ConfigModal.tsx and Modal.tsx put back, it failed 8 of 10 runs; with this PR it failed 1 of 4.

Closes #268

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Settings navigation groups can now be folded, with their state remembered across Settings sessions and page reloads.
    • The group containing the current page stays open while that page is active. Search can still find pages in folded groups.
    • On phones, folding a group keeps the page list visible; selecting a page opens it.
  • Documentation
    • Updated the Settings guide with details about folding groups and navigating between pages.

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>
@coderabbitai

coderabbitai Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Warning

Review limit reached

You'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.

Check out review usage here.

View limit details

Limit details: You’ve used all 2 included reviews currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 7b65c130-2984-45fa-a9e5-0dca15427067
📥 Commits

Reviewing files that changed from the base of the PR and between 3ae1c26 and 3f91d79.

📒 Files selected for processing: 2
  • core/web/src/components/ConfigModal.tsx
  • tests/browser/settings.spec.mts

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 88d598ad-a7a5-45be-a03b-30e4e44bdeeb
📥 Commits

Reviewing files that changed from the base of the PR and between 2286642 and 3ae1c26.

📒 Files selected for processing: 4
  • core/web/src/components/ConfigModal.tsx
  • core/web/src/components/Modal.tsx
  • docs/guide/settings.md
  • tests/browser/settings.spec.mts

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 0 remain after this review.

📝 Walkthrough

Settings rail categories can now be collapsed, with folded state saved in browser storage. The category containing the active page stays open. Documentation and browser tests cover persistence, navigation, search, keyboard input, and phone-sized layouts.

Changes: Settings rail groups

Layer / File(s) Summary
Group state and rail interaction
core/web/src/components/ConfigModal.tsx, core/web/src/components/Modal.tsx
Rail groups can be folded, and their state is stored in browser storage. The active page’s group stays open. Expandable headings do not switch the rail to a section when clicked.
Document and test group behavior
docs/guide/settings.md, tests/browser/settings.spec.mts
The guide describes group folding and its behavior. Browser tests cover persistence, active-page navigation, search, keyboard toggles, and phone-sized layouts.

Priority: ⬇️ Low

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Feature

Suggested reviewers: piggidragon

Merge Risk: ⚪ Minimal · up to 3ae1c

The Settings rail change appears ready to merge after normal checks; no actionable issue remains.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 3 files. (1 skipped: 1… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly summarizes the primary change: Settings rail groups can fold and retain their state. It is concise and specific.
Linked Issues check Passed Issue #268 requires collapsible rail categories, persisted state, active-category usability, and search access to folded categories. ConfigModal.tsx adds button headings with aria-expanded and `ar…
Out of Scope Changes check Passed The changes stay within Issue #268. Modal.tsx only preserves the rail on phones when a group heading is activated. The documentation describes the new rail behavior, and the browser tests verify it.…
Full details: Linked Issues check

Explanation

Issue #268 requires collapsible rail categories, persisted state, active-category usability, and search access to folded categories. ConfigModal.tsx adds button headings with aria-expanded and aria-controls, hides folded group content, and stores folded English group names under pithagoras.settings.rail-closed. The active fixed-tab or extension group stays open and resists toggling. Search remains available and the tests cover folded-group search, direct navigation, persistence, keyboard input, and extension settings. The reported type, build, boundary, unit, and browser checks provide supporting automated-test evidence.

Full details: Out of Scope Changes check

Explanation

The changes stay within Issue #268. Modal.tsx only preserves the rail on phones when a group heading is activated. The documentation describes the new rail behavior, and the browser tests verify it. No unrelated product behavior or unrelated files appear in the reviewed changes.

Full details: Docstring Coverage

Explanation

Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 3 files. (1 skipped: 1 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

✨ Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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>
@thecodacus
thecodacus merged commit ee161c8 into main Oct 23, 2026
4 of 5 checks passed
@thecodacus thecodacus mentioned this pull request Oct 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Settings: make the rail categories collapsible/expandable

1 participant