Skip to content

Commit e2fc80c

Browse files
committed
fix(chat): show a loading row while a workspace resource menu hydrates
1 parent 434db43 commit e2fc80c

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

  • apps/sim/app/workspace/[workspaceId]/home/components/mothership-view/components/add-resource-dropdown

‎apps/sim/app/workspace/[workspaceId]/home/components/mothership-view/components/add-resource-dropdown/add-resource-dropdown.tsx‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,13 @@ function WorkspaceResourceMenuContent({
420420
? resource
421421
: { ...resource, workspaceId }
422422
)
423-
const menu = <ResourceMenuSections sections={sections} groups={groups} onSelect={select} />
423+
/** Lists fill in as they load, so a trailing row keeps a loading workspace from reading as empty. */
424+
const menu = (
425+
<>
426+
<ResourceMenuSections sections={sections} groups={groups} onSelect={select} />
427+
{isHydrating && <DropdownMenuItem disabled>Loading resources…</DropdownMenuItem>}
428+
</>
429+
)
424430
return searchable ? (
425431
<ResourceMenuSearch groups={groups} isHydrating={isHydrating} onSelect={select}>
426432
{menu}

0 commit comments

Comments
 (0)