Skip to content

Commit ef82001

Browse files
bjaggclaude
andcommitted
dev-integration: header tweaks — badge to far right, use display_name
Two changes only relevant once PR #944 (header badge) and PR #947 (display_name on WorkspaceItem) are both present: 1. Move workspace badge to the right of the user dropdown so it's the rightmost element. Matches "where am I?" reading order — identity first, current-context last. 2. Use `display_name ?? group` for the badge label instead of `group` alone, mirroring what the picker (Workspaces.tsx, PR #947) already does. With #947 deployed, this means the badge now shows the user's email for their personal tenant instead of `eval-<sub>`. NOT applied to PR #944's branch directly — its `WorkspaceItem` doesn't yet include `display_name` (that comes from #947), so a TypeScript error blocks the change there. After both #944 + #947 merge to main, a small follow-up PR will land these two tweaks on main as the canonical home. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent d0aedc1 commit ef82001

1 file changed

Lines changed: 25 additions & 17 deletions

File tree

  • frontends/mdr-frontend/src/components/Header

frontends/mdr-frontend/src/components/Header/Header.tsx

Lines changed: 25 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -83,24 +83,11 @@ const Header: React.FC = () => {
8383
</NavLink>
8484
</nav>
8585

86-
{/* Current-workspace indicator + user menu */}
86+
{/* User menu + current-workspace indicator. Indicator sits to the
87+
right of the user dropdown so it's the rightmost element in the
88+
header — matches a "where am I?" reading order (identity first,
89+
current context last). */}
8790
<Flex align="center" gap="3">
88-
{currentWorkspace && (
89-
<Badge
90-
color="iris"
91-
variant="soft"
92-
size="2"
93-
title={`Schema: ${currentWorkspace.tenant_schema}`}
94-
>
95-
<LayersIcon />
96-
<Flex direction="column" align="start" gap="0">
97-
<Text size="2" weight="medium">{currentWorkspace.group}</Text>
98-
<Text size="1" color="gray" style={{ fontFamily: "monospace" }}>
99-
{currentWorkspace.tenant_schema}
100-
</Text>
101-
</Flex>
102-
</Badge>
103-
)}
10491
<DropdownMenu.Root>
10592
<DropdownMenu.Trigger>
10693
<Button variant="ghost" size="2">
@@ -130,6 +117,27 @@ const Header: React.FC = () => {
130117
</DropdownMenu.Item>
131118
</DropdownMenu.Content>
132119
</DropdownMenu.Root>
120+
{currentWorkspace && (
121+
<Badge
122+
color="iris"
123+
variant="soft"
124+
size="2"
125+
title={`Schema: ${currentWorkspace.tenant_schema}`}
126+
>
127+
<LayersIcon />
128+
<Flex direction="column" align="start" gap="0">
129+
{/* display_name (#943) — email for personal tenants, group
130+
name for shared. Falls back to group during any window
131+
where the backend hasn't shipped display_name yet. */}
132+
<Text size="2" weight="medium">
133+
{currentWorkspace.display_name ?? currentWorkspace.group}
134+
</Text>
135+
<Text size="1" color="gray" style={{ fontFamily: "monospace" }}>
136+
{currentWorkspace.tenant_schema}
137+
</Text>
138+
</Flex>
139+
</Badge>
140+
)}
133141
</Flex>
134142
</div>
135143
</header>

0 commit comments

Comments
 (0)