Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,14 @@ export const MemoizedWorkflowItem = memo(
onSelect,
color,
name,
folderPath,
isCurrent,
}: {
value: string
onSelect: () => void
color: string
name: string
folderPath?: string
isCurrent?: boolean
}) {
return (
Expand All @@ -73,13 +75,19 @@ export const MemoizedWorkflowItem = memo(
{name}
{isCurrent && ' (current)'}
</span>
{folderPath && (
<span className='ml-auto min-w-0 truncate pl-2 font-base text-[var(--text-subtle)] text-small'>
{folderPath}
</span>
)}
</Command.Item>
)
},
(prev, next) =>
prev.value === next.value &&
prev.color === next.color &&
prev.name === next.name &&
prev.folderPath === next.folderPath &&
prev.isCurrent === next.isCurrent
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,10 +163,11 @@ export const WorkflowsGroup = memo(function WorkflowsGroup({
{items.map((workflow) => (
<MemoizedWorkflowItem
key={workflow.id}
value={`${workflow.name} workflow-${workflow.id}`}
value={`${workflow.name} ${workflow.folderPath ?? ''} workflow-${workflow.id}`}
onSelect={() => onSelect(workflow)}
color={workflow.color}
name={workflow.name}
folderPath={workflow.folderPath}
isCurrent={workflow.isCurrent}
/>
))}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export interface WorkflowItem {
name: string
href: string
color: string
folderPath?: string
isCurrent?: boolean
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ import { useSession } from '@/lib/auth/auth-client'
import { SIM_RESOURCES_DRAG_TYPE } from '@/lib/copilot/resource-types'
import { cn } from '@/lib/core/utils/cn'
import { isMacPlatform } from '@/lib/core/utils/platform'
import { buildFolderTree } from '@/lib/folders/tree'
import { buildFolderTree, getFolderPath } from '@/lib/folders/tree'
import { captureEvent } from '@/lib/posthog/client'
import {
START_NAV_TOUR_EVENT,
Expand Down Expand Up @@ -613,14 +613,22 @@ export const Sidebar = memo(function Sidebar() {

const searchModalWorkflows = useMemo(
() =>
regularWorkflows.map((workflow) => ({
id: workflow.id,
name: workflow.name,
href: `/workspace/${workspaceId}/w/${workflow.id}`,
color: workflow.color,
isCurrent: workflow.id === workflowId,
})),
[regularWorkflows, workspaceId, workflowId]
regularWorkflows.map((workflow) => {
const folderPath = workflow.folderId
? getFolderPath(folderMap, workflow.folderId)
.map((folder) => folder.name)
.join(' / ')
: ''
return {
id: workflow.id,
name: workflow.name,
href: `/workspace/${workspaceId}/w/${workflow.id}`,
color: workflow.color,
folderPath: folderPath || undefined,
isCurrent: workflow.id === workflowId,
}
}),
[regularWorkflows, folderMap, workspaceId, workflowId]
)

const searchModalWorkspaces = useMemo(
Expand Down
Loading