Skip to content

feat(sidebar): workspace switcher with Platform's menu, links and avatar colors - #2026

Open
PabloWiedemann wants to merge 10 commits into
claude/app-local-show-in-finder-1c9e83from
claude/workspace-switcher-platform
Open

PabloWiedemann wants to merge 10 commits into
claude/app-local-show-in-finder-1c9e83from
claude/workspace-switcher-platform

Conversation

@PabloWiedemann

@PabloWiedemann PabloWiedemann commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

TL;DR: The sidebar workspace switcher now has the Developer Platform switcher's items, behavior, keyboard handling, links and avatar colors, built with Desktop's design system.
Why: Desktop's menu had different items, no plan or role, no settings or billing links, and its own gradient avatars, so a workspace looked different in Desktop and on Platform.
Can affect: the account area at the bottom of the sidebar, the Apps page while that menu is open, and the listWorkspaces mapping of subscription_tier. It does not touch DevPlatformWorkspaceSelector (still used by the performance test view) or how a workspace is selected (dashboardScopeStore).

Stack (merge in order): … → #2027 → #2045 → #2050 → this PR

Changes

  • Menu (SidebarWorkspaceSwitcher.vue): a header with the avatar, name and plan • role line (e.g. CREATOR • OWNER). The switch icon opens the workspace list beside the menu. Then Workspace settings, Manage plan & credits, the email and Log Out. Add workspace is left out. The list has avatar, name, plan, a check on the current one, search above 6, two loading rows, and error and empty text, as on Platform.
  • Keyboard: Enter opens the menu on the header. Enter on the header opens the list on the current workspace. Escape closes one level and returns focus. Built on design-system Button, PopoverContent, SearchInput and Skeleton, with reka-ui PopoverRoot/Trigger/Anchor (the design system does not export them).
  • Links (openSettingsPage IPC): the same pages Platform links to. Settings opens /settings/general for a team and /settings/people for a personal workspace. Manage plan & credits opens /settings/billing. Each carries ?workspace= (Platform's workspace-link middleware switches to it) and uses PLATFORM_WEB_BASE_URL. The rows stay off until the workspace is known.
  • Avatar colors (WorkspaceAvatar.vue): workspaceAvatarStyle from @comfyorg/design-system/workspaceAvatar, the helper Platform uses. listWorkspaces now keeps a null plan, so Free gets the Free color and a missing plan stays neutral, as on Platform.
  • Over an open app (AppsView.vue, comfy-apps:capture): the app view is a native view above the panel, so the menu opened under it. While the menu is open, the app shows as a still and its view hides, as the outputs dialog does.
  • Noticed and left:
    • Platform parity over Desktop rules: a popover, not the design-system Menu (its submenu opens on hover and Escape closes everything); "Log Out" with a capital O; the no-plan tile is the popover color; no arrow keys in the list.
    • The tile could move into the design system next to workspaceAvatarStyle.
    • The performance test view still uses the old selector and gradient avatars.
    • With an app open, the menu can show under the app for the time the still takes (a few frames).
    • Closing the menu with Escape over an open app gives focus to the app, not the trigger (showApps focuses an uncovered view).

Screens

Captured from the dev app with the real workspace list (same five workspaces and colors as Platform's switcher). Screenshots still need to be added here by hand: the CLI cannot upload images.

Testing

  • pnpm run typecheck, lint, format:check (pre-commit): pass. Full vitest run: 344 files, 7944 pass.
  • New tests: menu items, list order, plans and check, avatar colors against the helper, selection, Escape one level at a time, each link and its page, links off before the workspace is known, loading, error and retry, empty, search, blur, collapsed trigger, the app cover, the null plan mapping, and the IPC handler.
  • Dev app over CDP: Enter and Escape flows as above. With an app open, the app page reports hidden while the menu is open and visible after it closes.
  • Reviews: an independent code review, a cold design review, and a fresh review of the fixes (no P0 or P1). Their fixes are in the second and third commits. CodeRabbit could not run (coderabbit auth login needed).
  • Not tested: the real Platform pages in a browser (the links would open Pablo's browser); signing in for real, because the dev instance's session was rejected, so the menu was shown with the real workspace list loaded into the store; light theme; the window by eye (no screen recording).

…tar colors

The sidebar account menu now has the same items and behavior as the
Developer Platform workspace switcher: a header row with the workspace
avatar, name and plan/role line that opens the workspace list beside the
menu, Workspace settings, Manage plan & credits, the signed-in email and
Log Out. Add workspace is left out.

- Workspace settings opens /settings/general for a team workspace and
  /settings/people for a personal one; Manage plan & credits opens
  /settings/billing. Both carry ?workspace= so Platform opens the same
  workspace, and both use the configured Platform web base URL.
- Avatars use workspaceAvatarStyle from @comfyorg/design-system, the
  helper Platform uses. The workspace list keeps a null plan apart from
  a missing one so a Free workspace gets the Free color.
- Built with the design-system Button, PopoverContent, SearchInput and
  Skeleton on reka-ui popovers.
…s links

- While the sidebar workspace menu is open, the Apps page covers an
  open app with a still of it and hides its native view, the same way
  the outputs dialog does. Without this the menu and the workspace list
  open under the app view and cannot be seen or clicked. Main gets a
  comfy-apps:capture call that returns the still for the panel's app.
- Workspace settings and Manage plan & credits stay off until the
  workspace is known, and main refuses a settings page with no
  workspace, as it does for Builds. An unscoped link would open the
  page in whichever workspace Platform last used.
- The trigger passes a missing plan through as-is, so it matches its
  list row, as Platform does. The fallback name is Platform's
  "Workspace". The trigger text is 13px like the other sidebar rows.
- Tests cover loading, error and retry, empty, search above six
  workspaces, window blur, the collapsed trigger and the app cover.
- Drop the two account strings nothing uses any more.
- The switcher always tells the sidebar its menu closed when it goes
  away, so a sign-out in the same tick as a close cannot leave an app
  covered.
- An empty capture gives no still instead of a broken image.
- The trigger uses the text-ui token, and the fallback name reuses the
  existing Workspace string.
- Tests: the still is taken before the view hides, a still that comes
  back after the menu closed does not cover the app, and signing out
  with the menu open reports it closed.
@coderabbitai

coderabbitai Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 1675aa7d-7d5b-45e6-8066-76f846a5e857

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@PabloWiedemann PabloWiedemann added the cursor-review Trigger multi-model Cursor code review label Nov 12, 2026

@github-actions github-actions 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.

🔍 Cursor Review — Consolidated panel

Triggered by @PabloWiedemann.

Found 10 finding(s).

Severity Count
🟠 High 2
🟡 Medium 5
🟢 Low 3

Panel: 8/8 reviewers contributed findings.

if (backdrop) {
sidebarBackdropUrl.value = URL.createObjectURL(new Blob([backdrop], { type: 'image/jpeg' }))
}
coveredBySidebar.value = true

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.

🟠 High — coveredBySidebar is set to true even when captureApps() resolves null (capture failed, view destroyed, or image.isEmpty()), so AppsHost hides the native app view with no backdrop and the panel area goes blank until the menu closes. This is reachable on a normal path — if the output dialog already hid the apps view, capturing the hidden view returns an empty image. Only set coveredBySidebar.value = true when a backdrop was produced. Raised by 2 of 8 reviewers (claude-opus-5-thinking-max edge-case, kimi-k2.7-code edge-case).

const query = ref('')
const workspaceFlyout = useTemplateRef<HTMLElement>('workspaceFlyout')

useEventListener(window, 'blur', () => {

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.

🟠 High — scopeId collapses any workspace that isPersonalWorkspace accepts onto PERSONAL_WORKSPACE_ID, and that helper matches on the name 'personal workspace' as well as type === 'personal'. A team literally named "Personal Workspace" therefore renders as checked alongside the real personal workspace, currentWorkspace's find returns whichever comes first, and clicking that team selects the personal scope — so settings and billing can open against the wrong workspace id. Raised by 3 of 8 reviewers (gpt-5.6-sol-max adversarial, claude-opus-5-thinking-max edge-case, gpt-5.6-sol-max edge-case).

Comment thread src/main/apps/appsView.ts Resolved
const searchable = computed(() => store.workspaces.length > SEARCH_THRESHOLD)
const filteredWorkspaces = computed(() => {
const needle = query.value.trim().toLowerCase()
if (!needle) return store.workspaces

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.

🟡 Medium — The option list is built purely from store.workspaces, so when the API returns an empty or team-only catalog there is no personal row at all. A user currently scoped to a team then has no way back to the Personal dashboard, whereas the selector this replaces always offered that option. Raised by 1 of 8 reviewers (gpt-5.6-sol-max edge-case).

Comment thread src/main/apps/appsView.ts Resolved
Comment thread src/renderer/src/panel/AppsView.vue Resolved
Comment thread src/main/cloud/workspaces.ts Resolved
Comment thread src/renderer/src/panel/AppsView.vue Resolved
vqt123 and others added 2 commits November 12, 2026 14:43
…switcher-platform

# Conflicts:
#	src/main/apps/appsView.ts
#	src/renderer/src/panel/AppsView.test.ts
#	src/renderer/src/panel/AppsView.vue
#	src/renderer/src/panel/PanelApp.vue
…1c9e83' into HEAD

# Conflicts:
#	src/main/apps/appsView.ts
@PabloWiedemann
PabloWiedemann changed the base branch from claude/apps-open-loading-99f753 to claude/app-local-show-in-finder-1c9e83 November 13, 2026 16:31
@PabloWiedemann
PabloWiedemann marked this pull request as ready for review November 13, 2026 16:31
@PabloWiedemann
PabloWiedemann requested review from a team as code owners November 13, 2026 16:31
- Apps cover: the panel waits at most 1.5 s for the still of the open
  app, then hides the app without one, so a stuck capture cannot leave
  the app above the open menu.
- Apps cover: an output dialog that opens with no still of its own
  makes its own copy of the sidebar still, so closing the menu no
  longer removes the still behind the dialog.
- Main only captures the app for the panel's main frame while an app
  is open, and shares one capture between requests that overlap.
- A workspace plan that is not text or null is dropped, so it reads
  as unknown and never reaches the menu or the avatar.
- Picking the current workspace again closes the menu, like every
  other row.
- The workspace avatar uses the first whole character of the trimmed
  name, and keeps it as is when its upper case is two letters.
@PabloWiedemann

Copy link
Copy Markdown
Contributor Author

Review follow-up.

Branch: merged #2050 (be097fd). The wiring test from #1997 now also allows the panel-only comfy-apps:capture handler. Typecheck, lint, format and unit tests pass.

Fixed (threads resolved)

  • Overlapping capture requests share one capture per window (34df480).
  • Capture needs the panel's main frame and an open app (34df480).
  • The dialog makes its own copy of the sidebar still (34df480).
  • A plan that is not text or null is dropped, with a test (34df480).
  • The capture gives up after 1.5 s and hides the app without a still (34df480).
  • Picking the current workspace again closes the menu, with a test (34df480).
  • The initial is the first whole character of the trimmed name, with a test (34df480).

Not changed (threads left open for the reviewer)

  • The app must hide or it covers the menu, so an empty area is the safer fallback.
  • The switcher uses the shared isPersonalWorkspace rule; changing it affects the whole app.
  • Main expects every Cloud account to have a personal workspace; an empty list shows the empty state.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cursor-review Trigger multi-model Cursor code review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants