mirror of
https://github.com/simstudioai/sim.git
synced 2026-09-24 15:45:35 +08:00
fix(home): restore folder search in @-mention and plus-menu dropdown (#4403)
This commit is contained in:
+4
-5
@@ -80,13 +80,12 @@ export const PlusMenuDropdown = React.memo(
|
||||
const q = rawQuery.toLowerCase().trim()
|
||||
// In mention mode always render a flat filtered list — empty query = show everything.
|
||||
if (!isMention && !q) return null
|
||||
// Folders organize resources but aren't a valid mention/insertable target — drop them
|
||||
// from the flat list (matches the nested rendering, which also excludes them).
|
||||
const flatGroups = availableResources.filter(({ type }) => type !== 'folder')
|
||||
if (isMention && !q) {
|
||||
return flatGroups.flatMap(({ type, items }) => items.map((item) => ({ type, item })))
|
||||
return availableResources.flatMap(({ type, items }) =>
|
||||
items.map((item) => ({ type, item }))
|
||||
)
|
||||
}
|
||||
return flatGroups.flatMap(({ type, items }) =>
|
||||
return availableResources.flatMap(({ type, items }) =>
|
||||
items.filter((item) => item.name.toLowerCase().includes(q)).map((item) => ({ type, item }))
|
||||
)
|
||||
}, [isMention, mentionQuery, search, availableResources])
|
||||
|
||||
+1
-1
@@ -554,7 +554,7 @@ export function FolderItem({
|
||||
</span>
|
||||
{folder.locked && (
|
||||
<Lock
|
||||
className='h-[12px] w-[12px] flex-shrink-0 pointer-events-none text-[var(--text-icon)]'
|
||||
className='pointer-events-none h-[12px] w-[12px] flex-shrink-0 text-[var(--text-icon)]'
|
||||
aria-label='Folder is locked'
|
||||
/>
|
||||
)}
|
||||
|
||||
+1
-1
@@ -470,7 +470,7 @@ export function WorkflowItem({
|
||||
)}
|
||||
{!isEditing && workflow.locked && (
|
||||
<Lock
|
||||
className='h-[12px] w-[12px] flex-shrink-0 pointer-events-none text-[var(--text-icon)]'
|
||||
className='pointer-events-none h-[12px] w-[12px] flex-shrink-0 text-[var(--text-icon)]'
|
||||
aria-label='Workflow is locked'
|
||||
/>
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user