Skip to content

feat(desktop): add Appearance setting to show the Workspaces sidebar tab - #5901

Closed
MacKevinroe wants to merge 1 commit into
ParadevAI:mainfrom
MacKevinroe:feat/workspaces-tab-setting
Closed

MacKevinroe wants to merge 1 commit into
ParadevAI:mainfrom
MacKevinroe:feat/workspaces-tab-setting

Conversation

@MacKevinroe

@MacKevinroe MacKevinroe commented Jul 23, 2026 •

Copy link
Copy Markdown

Summary

The Workspaces sidebar entry is gated behind a hardcoded constant, so today the /v2-workspaces list 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.md records the intent:

Workspaces tab hidden, not deleted — SHOW_WORKSPACES_TAB = false flag; flip to true to restore.

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

  • New sidebar-workspaces-tab store (persisted zustand, renderer/stores/), mirroring the existing sidebar-workspaces-collapse sidebar store.
  • DashboardSidebarHeader reads it in place of the constant. Both gated blocks — collapsed rail and expanded row — are otherwise untouched.
  • Registered in settings-search as APPEARANCE_WORKSPACES_TAB, variant v2 (the /v2-workspaces route is a v2 concept).
  • Rendered as an Appearance section, following MarkdownStyleSection.

Nothing behind the gate changed: handleWorkspacesClick and the /v2-workspaces route were already live and are what the command palette already navigates to.

Why renderer-side and not the settings table

#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-preferences pattern 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 check on all changed files — clean.
  • tsc --noEmit for apps/desktop: 69 errors before, 69 after, none in the changed files. The pre-existing errors are all missing-routeTree.gen.ts route-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 install fails on this machine at the @electron/rebuild step for native-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 the Switch + Label pattern from BehaviorSettings verbatim. 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-workspaces list from the sidebar. Addresses #5881.

  • New Features
    • Added persisted zustand store sidebar-workspaces-tab for visibility state.
    • Added Appearance → “Show Workspaces tab” switch; registered as APPEARANCE_WORKSPACES_TAB (variant v2) in settings search.
    • Sidebar header now reads the store to conditionally render the Workspaces entry; no route or handler changes.

Written for commit e33f632. Summary will update on new commits.

Review in cubic

Summary by CodeRabbit

  • New Features
    • Added an Appearance setting to show or hide the Workspaces tab.
    • The Workspaces tab visibility preference is saved and applied throughout the sidebar.
    • Added the setting to Appearance search results with descriptive help text.
    • Sidebar layouts now consistently reflect the selected visibility preference.

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

coderabbitai Bot commented Jul 23, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The 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.

Changes

Workspaces tab visibility

Layer / File(s) Summary
Persistent visibility state
apps/desktop/src/renderer/stores/sidebar-workspaces-tab.ts
Adds a persisted Zustand store with hooks for reading and updating Workspaces tab visibility.
Appearance setting and registration
apps/desktop/src/renderer/routes/_authenticated/settings/utils/settings-search/settings-search.ts, apps/desktop/src/renderer/routes/_authenticated/settings/appearance/components/AppearanceSettings/...
Registers the v2-only setting and renders a switch that updates the persisted visibility state.
Sidebar rendering integration
apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/components/DashboardSidebarHeader/DashboardSidebarHeader.tsx
Uses store-driven visibility for Workspaces buttons in collapsed and expanded sidebar layouts.

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
Loading

Possibly related PRs

Suggested reviewers: kitenite

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise, conventional, and accurately summarizes the main change: adding an Appearance setting for the Workspaces sidebar tab.
Description check ✅ Passed The description follows the template well with Summary, Motivation, How it works, and Testing details; only the checklist is left unfilled.
Linked Issues check ✅ Passed The PR addresses #5881 by restoring a supported sidebar access path for Workspaces via a user-controlled Appearance toggle.
Out of Scope Changes check ✅ Passed The changes stay focused on the Workspaces tab visibility setting, its store, settings entry, and sidebar rendering.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 win

Add 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

📥 Commits

Reviewing files that changed from the base of the PR and between f313df2 and e33f632.

📒 Files selected for processing (6)
  • apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/components/DashboardSidebarHeader/DashboardSidebarHeader.tsx
  • apps/desktop/src/renderer/routes/_authenticated/settings/appearance/components/AppearanceSettings/AppearanceSettings.tsx
  • apps/desktop/src/renderer/routes/_authenticated/settings/appearance/components/AppearanceSettings/components/WorkspacesTabSection/WorkspacesTabSection.tsx
  • apps/desktop/src/renderer/routes/_authenticated/settings/appearance/components/AppearanceSettings/components/WorkspacesTabSection/index.ts
  • apps/desktop/src/renderer/routes/_authenticated/settings/utils/settings-search/settings-search.ts
  • apps/desktop/src/renderer/stores/sidebar-workspaces-tab.ts

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.

Workspaces nav item missing from left sidebar

1 participant