Repository navigation
feat(desktop): add Appearance setting to show the Workspaces sidebar tab - #5901
MacKevinroe wants to merge 1 commit into
Conversation
The Workspaces sidebar entry is gated behind a hardcoded SHOW_WORKSPACES_TAB = false constant, so the /v2-workspaces list is reachable only via the command palette. Replace the constant with a persisted, device-local preference and surface it as an Appearance toggle, defaulting to false so shipped behaviour is unchanged. Closes ParadevAI#5881
📝 WalkthroughWalkthroughThe PR adds persisted Workspaces tab visibility state, exposes it through a new Appearance setting, registers the setting for search and v2 gating, and uses the state to control Workspaces buttons in both sidebar layouts. ChangesWorkspaces tab visibility
Estimated code review effort: 2 (Simple) | ~10 minutes Sequence Diagram(s)sequenceDiagram
participant User
participant AppearanceSettings
participant WorkspacesTabStore
participant DashboardSidebarHeader
User->>AppearanceSettings: toggle Show Workspaces Tab
AppearanceSettings->>WorkspacesTabStore: setVisible(isVisible)
WorkspacesTabStore-->>DashboardSidebarHeader: provide visibility state
DashboardSidebarHeader-->>User: show or hide Workspaces button
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/components/DashboardSidebarHeader/DashboardSidebarHeader.tsx (1)
173-190: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winAdd an accessible name to the collapsed Workspaces button.
The icon-only button has no
aria-label, so screen readers can announce it as a generic button. Keep the Tooltip for sighted users and expose the workspaces name to assistive technology.Proposed fix
<button type="button" + aria-label="Workspaces" onClick={handleWorkspacesClick}🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/components/DashboardSidebarHeader/DashboardSidebarHeader.tsx` around lines 173 - 190, Add an accessible name to the icon-only Workspaces button in the showWorkspacesTab block by setting an aria-label that identifies it as “Workspaces.” Keep the existing Tooltip, click handler, styling, and icon unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In
`@apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/components/DashboardSidebarHeader/DashboardSidebarHeader.tsx`:
- Around line 173-190: Add an accessible name to the icon-only Workspaces button
in the showWorkspacesTab block by setting an aria-label that identifies it as
“Workspaces.” Keep the existing Tooltip, click handler, styling, and icon
unchanged.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 7286558b-92f1-43b7-bbe0-baa2d55292f6
📒 Files selected for processing (6)
apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/components/DashboardSidebarHeader/DashboardSidebarHeader.tsxapps/desktop/src/renderer/routes/_authenticated/settings/appearance/components/AppearanceSettings/AppearanceSettings.tsxapps/desktop/src/renderer/routes/_authenticated/settings/appearance/components/AppearanceSettings/components/WorkspacesTabSection/WorkspacesTabSection.tsxapps/desktop/src/renderer/routes/_authenticated/settings/appearance/components/AppearanceSettings/components/WorkspacesTabSection/index.tsapps/desktop/src/renderer/routes/_authenticated/settings/utils/settings-search/settings-search.tsapps/desktop/src/renderer/stores/sidebar-workspaces-tab.ts
Summary
The Workspaces sidebar entry is gated behind a hardcoded constant, so today the
/v2-workspaceslist is reachable only through the command palette. This replaces the constant with a persisted, device-local preference and surfaces it as an Appearance → Show Workspaces tab toggle.The default is
false, so nothing changes for anyone unless they turn it on. This is deliberate — the tab was hidden on purpose in the sidebar/header reorg, and this PR is not trying to relitigate that. It just gives users who relied on the entry point a supported way back, instead of it being unreachable in a shipped build.Closes #5881.
Motivation
Reported in #5881.
apps/desktop/plans/20260721-sidebar-header-reorg-notes.mdrecords the intent:That flag is a build-time constant, so "flip to true to restore" isn't available to anyone running a released build — it requires compiling from source. Since the const is module-scope and the guards are
{FLAG && …}, both blocks are constant-folded out of the production bundle entirely, so there is no in-app or patch-level workaround either. A one-bit device preference seemed like the smallest thing that closes that gap without touching the default.How it works
sidebar-workspaces-tabstore (persisted zustand,renderer/stores/), mirroring the existingsidebar-workspaces-collapsesidebar store.DashboardSidebarHeaderreads it in place of the constant. Both gated blocks — collapsed rail and expanded row — are otherwise untouched.APPEARANCE_WORKSPACES_TAB, variantv2(the/v2-workspacesroute is a v2 concept).MarkdownStyleSection.Nothing behind the gate changed:
handleWorkspacesClickand the/v2-workspacesroute were already live and are what the command palette already navigates to.Why renderer-side and not the
settingstable#5303 used the local-db tier for a comparable sidebar toggle (schema column + migration + tRPC procedures — 9 files, ~1.6k lines with the drizzle snapshot). This is purely device-local renderer UI state with no main-process consumer, so it follows the lighter
MarkdownStyleSection/markdown-preferencespattern instead: no migration, no IPC. Happy to move it to the settings table if you'd rather have it alongside the other behaviour toggles — it's a contained change.Testing
biome checkon all changed files — clean.tsc --noEmitforapps/desktop: 69 errors before, 69 after, none in the changed files. The pre-existing errors are all missing-routeTree.gen.tsroute-id errors from not having run codegen locally.bun test settings-search.test.ts— 8 pass / 0 fail.No screenshot, and I want to be upfront about why rather than leave it implied:
bun installfails on this machine at the@electron/rebuildstep fornative-keymap(headless Linux, no X11 headers), so I could not launch the desktop app. What limits the visual risk is that this PR adds no new sidebar markup — the restored button JSX is exactly the markup already in the file, and the settings row reuses theSwitch+Labelpattern fromBehaviorSettingsverbatim. Glad to add a capture if a maintainer wants one before merging.Summary by cubic
Add an Appearance toggle to show the Workspaces tab in the sidebar, replacing the build-time flag with a device-local setting. Default is off, so existing behavior is unchanged; users can enable it to access the
/v2-workspaceslist from the sidebar. Addresses #5881.zustandstoresidebar-workspaces-tabfor visibility state.APPEARANCE_WORKSPACES_TAB(variantv2) in settings search.Written for commit e33f632. Summary will update on new commits.
Summary by CodeRabbit