Merge pull request 'polish: real role in user chip' (#10) from feat/login-methods into goutamnextflow

This commit was merged in pull request #10.
This commit is contained in:
2026-07-12 21:33:24 +00:00
2 changed files with 6 additions and 4 deletions
+3 -2
View File
@@ -69,13 +69,14 @@ export const NAV_ITEMS: NavItem[] = NAV_GROUPS.flatMap((g) => g.items);
export function Sidebar({ active, onSelect }: { active: string; onSelect: (k: string) => void }) {
const router = useRouter();
const { user: me, logout } = useAuth();
const { user: me, logout, context } = useAuth();
const [menuOpen, setMenuOpen] = useState(false);
// Real signed-in identity from the App Context Envelope; fall back to the static
// demo user only when the Shell isn't wired.
const roleLabel = context?.scope?.role ? context.scope.role.charAt(0).toUpperCase() + context.scope.role.slice(1) : "";
const name = me?.displayName || user.name;
const initials = me ? initialsOf(me.displayName) : user.initials;
const secondary = me?.email || user.role;
const secondary = me?.email || roleLabel || user.role;
async function signOut() {
setMenuOpen(false);
+3 -2
View File
@@ -15,11 +15,12 @@ export function Topbar({ theme, onToggle, title, subtitle }: { theme: "dark" | "
// When signed in through the Shell, show the real identity from the App Context
// Envelope; otherwise fall back to the static demo user.
const router = useRouter();
const { user: me, logout } = useAuth();
const { user: me, logout, context } = useAuth();
const [menuOpen, setMenuOpen] = useState(false);
const roleLabel = context?.scope?.role ? context.scope.role.charAt(0).toUpperCase() + context.scope.role.slice(1) : "";
const name = me?.displayName || user.name;
const initials = me ? initialsOf(me.displayName) : user.initials;
const secondary = me?.email || user.role;
const secondary = me?.email || roleLabel || user.role;
async function signOut() {
setMenuOpen(false);