Skip to content

Commit dee8932

Browse files
fix(agentex-ui): show disabled empty account picker while loading
Replace the account picker's loading skeleton with a disabled, empty picker (building icon only) — a plain skeleton block read as odd once the picker moved into the footer between Give Feedback and Log out. Keeps the row stable and reads as "loading account selector". Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent d97bc97 commit dee8932

1 file changed

Lines changed: 22 additions & 9 deletions

File tree

agentex-ui/components/account-picker/account-picker.tsx

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import {
1313
SelectTrigger,
1414
SelectValue,
1515
} from '@/components/ui/select';
16-
import { Skeleton } from '@/components/ui/skeleton';
1716
import { useUserInfo, userInfoKey } from '@/hooks/use-user-info';
1817
import { cn } from '@/lib/utils';
1918

@@ -63,16 +62,30 @@ export function AccountPicker({
6362
}, [profiles, selectedId, setSelectedAccountId, refetchAccountScoped]);
6463

6564
if (!accountsEnabled) return null;
66-
// Reserve the picker's height while accounts load so New Chat doesn't jump when it
67-
// appears. Once loaded with no accounts, render nothing.
65+
// While accounts load, show a disabled, empty picker (building icon only) rather than
66+
// a bare skeleton block — keeps the footer row stable and reads as "account selector,
67+
// loading". Once loaded with no accounts, render nothing.
6868
if (isLoading) {
69+
if (collapsed) {
70+
return (
71+
<div
72+
className={cn('flex size-9 items-center justify-center', className)}
73+
>
74+
<Building2 className="text-muted-foreground size-5 shrink-0" />
75+
</div>
76+
);
77+
}
6978
return (
70-
<Skeleton
71-
className={cn(
72-
collapsed ? 'size-9 rounded-md' : 'h-9 w-full rounded-md',
73-
className
74-
)}
75-
/>
79+
<Select disabled>
80+
<SelectTrigger
81+
aria-label="Account"
82+
className={cn('w-full gap-2 rounded-md font-medium', className)}
83+
>
84+
<span className="flex flex-1 items-center gap-2 overflow-hidden text-left">
85+
<Building2 className="text-muted-foreground size-5 shrink-0" />
86+
</span>
87+
</SelectTrigger>
88+
</Select>
7689
);
7790
}
7891
if (profiles.length === 0) return null;

0 commit comments

Comments
 (0)