fix(team): keep launch loader for runtime-pending members

This commit is contained in:
777genius 2026-04-23 01:56:38 +03:00
parent 15f7219997
commit 53d45c5e30
2 changed files with 40 additions and 2 deletions

View file

@ -124,6 +124,7 @@ export const MemberCard = ({
const runtimeAdvisoryTitle = launchPresentation.runtimeAdvisoryTitle;
const presenceLabel = launchPresentation.presenceLabel;
const spawnCardClass = launchPresentation.cardClass;
const launchVisualState = launchPresentation.launchVisualState;
const launchStatusLabel = launchPresentation.launchStatusLabel;
const colors = getTeamColorSet(memberColor);
const { isLight } = useTheme();
@ -148,7 +149,12 @@ export const MemberCard = ({
!activityTask &&
!runtimeSummary;
const showLaunchBadge =
!isRemoved && !activityTask && (presenceLabel === 'starting' || presenceLabel === 'connecting');
!isRemoved &&
!activityTask &&
!runtimeAdvisoryLabel &&
(presenceLabel === 'starting' ||
presenceLabel === 'connecting' ||
launchVisualState === 'runtime_pending');
const launchBadgeLabel =
presenceLabel === 'starting' ? presenceLabel : (launchStatusLabel ?? presenceLabel);
const showRuntimeAdvisoryBadge =
@ -271,7 +277,7 @@ export const MemberCard = ({
<span className="flex shrink-0 items-center gap-1">
<Loader2
className="size-3.5 shrink-0 animate-spin text-[var(--color-text-muted)]"
aria-label={presenceLabel}
aria-label={launchBadgeLabel}
/>
<Badge
variant="secondary"

View file

@ -267,6 +267,38 @@ describe('MemberCard starting-state visuals', () => {
});
});
it('shows a connecting badge while runtime bootstrap is still pending after the process comes online', async () => {
vi.stubGlobal('IS_REACT_ACT_ENVIRONMENT', true);
const host = document.createElement('div');
document.body.appendChild(host);
const root = createRoot(host);
await act(async () => {
root.render(
React.createElement(MemberCard, {
member,
memberColor: 'blue',
runtimeSummary: 'Gemini · flash · Medium',
isTeamAlive: true,
isTeamProvisioning: false,
spawnStatus: 'online',
spawnLaunchState: 'runtime_pending_bootstrap',
spawnRuntimeAlive: true,
})
);
await Promise.resolve();
});
expect(host.textContent).toContain('connecting');
expect(host.textContent).not.toContain('ready');
expect(host.querySelector('[aria-label="connecting"]')).not.toBeNull();
await act(async () => {
root.unmount();
await Promise.resolve();
});
});
it('shows ready instead of idle for confirmed teammates while launch is still settling', async () => {
vi.stubGlobal('IS_REACT_ACT_ENVIRONMENT', true);
const host = document.createElement('div');