Skip to content

Commit 52739a3

Browse files
committed
fix(mothership): restore integrations to useAvailableResources for @ mention
Integrations were fully removed from useAvailableResources which broke the @ mention menu since user-input shares the same hook. Now integrations are always included in the hook but excluded at the AddResourceDropdown component level, keeping them out of the sidebar + menu while remaining available for @ mention autocomplete.
1 parent c501c53 commit 52739a3

1 file changed

Lines changed: 15 additions & 12 deletions

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: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import type {
2525
MothershipResourceType,
2626
} from '@/app/workspace/[workspaceId]/home/types'
2727
import { formatDate } from '@/app/workspace/[workspaceId]/logs/utils'
28-
// import { listIntegrations } from '@/blocks/integration-matcher'
28+
import { listIntegrations } from '@/blocks/integration-matcher'
2929
import { useFolders } from '@/hooks/queries/folders'
3030
import { useKnowledgeBasesQuery } from '@/hooks/queries/kb/knowledge'
3131
import { useLogsList } from '@/hooks/queries/logs'
@@ -143,16 +143,16 @@ export function useAvailableResources(
143143
isOpen: existingKeys.has(`knowledgebase:${kb.id}`),
144144
})),
145145
},
146-
// {
147-
// type: 'integration' as const,
148-
// items: listIntegrations().map((integration) => ({
149-
// id: integration.blockType,
150-
// name: integration.name,
151-
// iconComponent: integration.icon,
152-
// bgColor: integration.bgColor,
153-
// isOpen: existingKeys.has(`integration:${integration.blockType}`),
154-
// })),
155-
// },
146+
{
147+
type: 'integration' as const,
148+
items: listIntegrations().map((integration) => ({
149+
id: integration.blockType,
150+
name: integration.name,
151+
iconComponent: integration.icon,
152+
bgColor: integration.bgColor,
153+
isOpen: existingKeys.has(`integration:${integration.blockType}`),
154+
})),
155+
},
156156
{
157157
type: 'task' as const,
158158
items: tasks.map((t) => ({
@@ -390,7 +390,10 @@ export function AddResourceDropdown({
390390
const [open, setOpen] = useState(false)
391391
const [search, setSearch] = useState('')
392392
const [activeIndex, setActiveIndex] = useState(0)
393-
const available = useAvailableResources(workspaceId, existingKeys, excludeTypes)
393+
const available = useAvailableResources(workspaceId, existingKeys, [
394+
...(excludeTypes ?? []),
395+
'integration',
396+
])
394397
const handleOpenChange = (next: boolean) => {
395398
setOpen(next)
396399
if (!next) {

0 commit comments

Comments
 (0)