feat(dashboard): show org name in sidebar, move org picker from header#902
Merged
feat(dashboard): show org name in sidebar, move org picker from header#902
Conversation
nhopeatall
approved these changes
Mar 16, 2026
Collaborator
nhopeatall
left a comment
There was a problem hiding this comment.
Summary
LGTM — Clean feature relocation with correct data plumbing.
The change moves the org picker/name display from the header to the sidebar, adds orgName to the auth.me API response, and wires it through the OrgProvider context. The implementation is well-structured:
- Backend: The extra
getOrganizationcall inauth.meis a simple indexed lookup, and while slightly redundant for superadmins (who already getavailableOrgs), it correctly providesorgNamefor regular users who don't receive the full org list. Pragmatic tradeoff. - Frontend context:
orgNamederivation correctly usesavailableOrgsfor superadmins (to reflect the switched-to org) andme.orgNamefor regular users. This handles the org-switching scenario whereeffectiveOrgIddiffers fromme.orgId. - Sidebar:
OrgBrandingcorrectly gates the dropdown onisSuperadmin && availableOrgs.length > 1, falling back to static display for single-org superadmins and regular users. Mobile sidebar inherits this via component reuse. - Header cleanup: All removed imports and variables are confirmed unused in the final state.
- Tests: Both admin and superadmin cases assert
orgNameand verifygetOrganizationis called with the correct ID. Mock cleanup is handled by vitest's globalclearMocks: true.
All CI checks pass.
🕵️ claude-code · claude-opus-4-6 · run details
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
auth.meAPI to returnorgNamefor all users (not just superadmins viaavailableOrgs)OrgProviderto exposeorgNamein context, derived fromavailableOrgsfor superadmins and fromme.orgNamefor regular usersSelectdropdown org picker (for superadmins with multiple orgs)Card: https://trello.com/c/pySGhfyj/428-instead-of-cascade-name-in-the-upper-left-corner-of-the-screen-in-dashboard-ui-we-should-show-currently-logged-in-to-displayed-o
Changes
Backend (
src/api/routers/auth.ts)getOrganizationfromsettingsRepositoryctx.effectiveOrgIdand includeorgNamein allmeresponsesFrontend Context (
web/src/lib/org-context.tsx)orgName: string | nulltoOrgContextValueinterfaceorgName?: string | nulltoMeDatainterfaceorgNamein provider: fromavailableOrgslookup for superadmins, fromme.orgNamefor regular usersorgNamein context valueSidebar (
web/src/components/layout/sidebar.tsx)OrgBrandingsub-component: renders<Select>dropdown for superadmins with multiple orgs; static org name withBuilding2icon for all other usersLayoutDashboardicon and "CASCADE" textSelect,SelectContent,SelectItem,SelectTrigger,SelectValue,Building2,useOrgContextHeader (
web/src/components/layout/header.tsx)<Select>block and static org name fallbackSelect*,Building2,useOrgContextorgNamelocal variable computationTests (
tests/unit/api/routers/auth.test.ts)mockGetOrganizationmockorgName: 'Org One'is returnedgetOrganizationis called with the effective org IDTest plan
🤖 Generated with Claude Code
🕵️ claude-code · claude-sonnet-4-6 · run details