From de8535c38b26c1d21d76d1b7bc696b6d00aef7e0 Mon Sep 17 00:00:00 2001 From: Mohamed Boudra Date: Wed, 2 Sep 2026 11:42:39 +0200 Subject: [PATCH] Customize top-level sidebar items (#4203) * feat(app): customize top-level sidebar items Let users reorder and hide built-in and plugin sidebar rows from Appearance settings while keeping the preference device-local. Add Search as a first-class row and standardize section explanations as header info tooltips. * fix(app): preserve consecutive sidebar preference edits Derive each sidebar change from the latest cached settings and retain unavailable plugin slots while editing the visible list. Keep E2E interaction selectors tied to accessible control names. * test(app): isolate provider settings unit boundary Keep the legacy provider-section test focused on provider behavior now that its shared section shell can render the settings info control. --- docs/design.md | 3 + docs/glossary.md | 1 + .../metadata-generation-settings.spec.ts | 5 +- .../browser/plugin-workspace-panels.spec.ts | 10 +- .../e2e/browser/sidebar-nav-settings.spec.ts | 108 ++++++++ .../support/helpers/command-center-scroll.ts | 2 +- .../app/e2e/support/helpers/command-center.ts | 2 +- .../helpers/directory-bootstrap-scenario.ts | 2 +- .../support/helpers/sidebar-nav-settings.ts | 147 +++++++++++ packages/app/src/components/left-sidebar.tsx | 227 +--------------- .../components/sidebar/sidebar-nav-rows.tsx | 178 +++++++++++++ packages/app/src/hooks/use-settings/index.ts | 8 +- .../src/hooks/use-settings/storage.test.ts | 78 ++++++ .../app/src/hooks/use-settings/storage.ts | 14 +- packages/app/src/hooks/use-shortcut-keys.ts | 4 +- packages/app/src/i18n/resources/ar.ts | 7 + packages/app/src/i18n/resources/en.ts | 7 + packages/app/src/i18n/resources/es.ts | 8 + packages/app/src/i18n/resources/fr.ts | 7 + packages/app/src/i18n/resources/ja.ts | 7 + packages/app/src/i18n/resources/ko.ts | 7 + packages/app/src/i18n/resources/pt-BR.ts | 7 + packages/app/src/i18n/resources/ru.ts | 8 + packages/app/src/i18n/resources/zh-CN.ts | 7 + packages/app/src/plugins/index.ts | 1 - packages/app/src/plugins/sidebar-items.tsx | 35 +-- .../appearance/appearance-section.tsx | 2 + .../appearance/sidebar-nav-section.tsx | 178 +++++++++++++ .../settings/metadata-generation-page.tsx | 8 +- .../settings/providers-section.test.tsx | 4 + .../src/screens/settings/settings-group.tsx | 41 +-- .../screens/settings/settings-info-tip.tsx | 58 +++++ .../src/screens/settings/settings-section.tsx | 23 +- packages/app/src/sidebar-nav/model.test.ts | 243 ++++++++++++++++++ packages/app/src/sidebar-nav/model.ts | 161 ++++++++++++ .../src/sidebar-nav/use-sidebar-nav-items.ts | 71 +++++ packages/desktop/e2e/browser-tabs.e2e.mjs | 2 +- 37 files changed, 1370 insertions(+), 311 deletions(-) create mode 100644 packages/app/e2e/browser/sidebar-nav-settings.spec.ts create mode 100644 packages/app/e2e/support/helpers/sidebar-nav-settings.ts create mode 100644 packages/app/src/components/sidebar/sidebar-nav-rows.tsx create mode 100644 packages/app/src/screens/settings/appearance/sidebar-nav-section.tsx create mode 100644 packages/app/src/screens/settings/settings-info-tip.tsx create mode 100644 packages/app/src/sidebar-nav/model.test.ts create mode 100644 packages/app/src/sidebar-nav/model.ts create mode 100644 packages/app/src/sidebar-nav/use-sidebar-nav-items.ts diff --git a/docs/design.md b/docs/design.md index bd13192d34..b98e06cb72 100644 --- a/docs/design.md +++ b/docs/design.md @@ -120,6 +120,8 @@ Workspace and chat surfaces use the full width — these are working surfaces, n Sections sit apart. `` owns its own bottom margin; the next thing is wrapped in another ``. The agent-list `sectionHeading` carries the same `marginTop`/`marginBottom` rhythm (`packages/app/src/components/agent-list.tsx:511-517`). Adding `marginBottom` to a section is wrong. +A section or group explains itself through the `info` prop on `` or `` — an info icon beside the header that opens a tooltip (`packages/app/src/screens/settings/settings-info-tip.tsx`). A muted paragraph between the header and the card is wrong: it sits in the section's own gap, so it reads as a second heading rather than as prose belonging to the header. Explanatory copy that describes one row belongs to that row, as `settingsStyles.rowHint` inside the card. + Cards inside a section sit closer than sections. Rows inside a card touch — only the divider separates them. The rhythm is page → spacious; section → spacious; card → tight. Rows have generous vertical padding: roughly 16px of content plus 16px of vertical padding for settings rows, 8–12px for sidebar list items where many rows must fit. Compressing rows below the established density to fit more on the screen is wrong. Too many rows means more cards or more sections, not smaller rows. @@ -248,6 +250,7 @@ New status pills use ``. Identity, shortcut, and interactive link b - `fontWeight.medium` on row titles, body text, button labels, badge text, or `` titles. Medium is reserved for the structural-label tier described in §3 — section labels, modal/sheet titles, dense metadata emphasis, and tight action labels. Anything else is `normal`. `` is responsive `400/300` and is never overridden. - `` wrapping `` to make a button. `