Repository navigation
feat(sidebar): workspace switcher with Platform's menu, links and avatar colors - #2026
PabloWiedemann wants to merge 10 commits into
Conversation
…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.
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the
|
There was a problem hiding this comment.
🔍 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 |
There was a problem hiding this comment.
🟠 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', () => { |
There was a problem hiding this comment.
🟠 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).
| const searchable = computed(() => store.workspaces.length > SEARCH_THRESHOLD) | ||
| const filteredWorkspaces = computed(() => { | ||
| const needle = query.value.trim().toLowerCase() | ||
| if (!needle) return store.workspaces |
There was a problem hiding this comment.
🟡 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).
…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
- 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.
|
Review follow-up. Branch: merged #2050 (be097fd). The wiring test from #1997 now also allows the panel-only Fixed (threads resolved)
Not changed (threads left open for the reviewer)
|
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
listWorkspacesmapping ofsubscription_tier. It does not touchDevPlatformWorkspaceSelector(still used by the performance test view) or how a workspace is selected (dashboardScopeStore).Stack (merge in order): … → #2027 → #2045 → #2050 → this PR
Changes
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.Button,PopoverContent,SearchInputandSkeleton, with reka-uiPopoverRoot/Trigger/Anchor(the design system does not export them).openSettingsPageIPC): the same pages Platform links to. Settings opens/settings/generalfor a team and/settings/peoplefor a personal workspace. Manage plan & credits opens/settings/billing. Each carries?workspace=(Platform'sworkspace-linkmiddleware switches to it) and usesPLATFORM_WEB_BASE_URL. The rows stay off until the workspace is known.WorkspaceAvatar.vue):workspaceAvatarStylefrom@comfyorg/design-system/workspaceAvatar, the helper Platform uses.listWorkspacesnow keeps anullplan, so Free gets the Free color and a missing plan stays neutral, as on Platform.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.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.workspaceAvatarStyle.showAppsfocuses 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. Fullvitest run: 344 files, 7944 pass.nullplan mapping, and the IPC handler.hiddenwhile the menu is open andvisibleafter it closes.coderabbit auth loginneeded).