diff --git a/frontend/src/lib/components/copilot/chat/ChatContextPicker.svelte b/frontend/src/lib/components/copilot/chat/ChatContextPicker.svelte index 87147906ed..608eb6a06e 100644 --- a/frontend/src/lib/components/copilot/chat/ChatContextPicker.svelte +++ b/frontend/src/lib/components/copilot/chat/ChatContextPicker.svelte @@ -28,6 +28,7 @@ Content is materialized at message-prep time by `AIChatManager` — see PR #9216 import type { DrillBranch, DrillIcon, DrillLeaf, DrillNode } from '$lib/components/drillPicker' import { workspaceItemDisplayPath, + workspaceItemMentionPath, type WorkspaceItem, type WorkspaceItemKind } from '$lib/components/workspacePicker' @@ -301,7 +302,7 @@ Content is materialized at message-prep time by `AIChatManager` — see PR #9216 const element: WorkspaceScriptElement & { deletable: boolean } = { type: 'workspace_script', path: d.path, - title: workspaceItemDisplayPath(d), + title: workspaceItemMentionPath(d), summary: d.summary, deletable: true } @@ -310,7 +311,7 @@ Content is materialized at message-prep time by `AIChatManager` — see PR #9216 const element: WorkspaceFlowElement & { deletable: boolean } = { type: 'workspace_flow', path: d.path, - title: workspaceItemDisplayPath(d), + title: workspaceItemMentionPath(d), summary: d.summary, deletable: true } @@ -320,7 +321,7 @@ Content is materialized at message-prep time by `AIChatManager` — see PR #9216 const element: WorkspaceAppElement & { deletable: boolean } = { type: 'workspace_app', path: d.path, - title: workspaceItemDisplayPath(d), + title: workspaceItemMentionPath(d), summary: d.summary, deletable: true } diff --git a/frontend/src/lib/components/copilot/chat/WorkspaceMentionPicker.svelte b/frontend/src/lib/components/copilot/chat/WorkspaceMentionPicker.svelte index cb1d1619b4..38b2b66c7a 100644 --- a/frontend/src/lib/components/copilot/chat/WorkspaceMentionPicker.svelte +++ b/frontend/src/lib/components/copilot/chat/WorkspaceMentionPicker.svelte @@ -11,6 +11,7 @@ at the workspace root because the parent menu item already names the scope. import type { DrillBranch, DrillLeaf, DrillNode } from '$lib/components/drillPicker' import { workspaceItemDisplayPath, + workspaceItemMentionPath, type WorkspaceItem, type WorkspaceItemKind } from '$lib/components/workspacePicker' @@ -64,7 +65,7 @@ at the workspace root because the parent menu item already names the scope. return { type: 'workspace_script', path: item.path, - title: workspaceItemDisplayPath(item), + title: workspaceItemMentionPath(item), summary: item.summary, deletable: true } satisfies WorkspaceScriptElement & { deletable: boolean } @@ -73,7 +74,7 @@ at the workspace root because the parent menu item already names the scope. return { type: 'workspace_flow', path: item.path, - title: workspaceItemDisplayPath(item), + title: workspaceItemMentionPath(item), summary: item.summary, deletable: true } satisfies WorkspaceFlowElement & { deletable: boolean } @@ -82,7 +83,7 @@ at the workspace root because the parent menu item already names the scope. return { type: 'workspace_app', path: item.path, - title: workspaceItemDisplayPath(item), + title: workspaceItemMentionPath(item), summary: item.summary, deletable: true } satisfies WorkspaceAppElement & { deletable: boolean } @@ -140,7 +141,8 @@ at the workspace root because the parent menu item already names the scope. onPick={handlePick} {leafIcon} {branchIcon} - leafSecondary={(leaf, scope) => relativizeWorkspacePath(workspaceItemDisplayPath(leaf.data), scope)} + leafSecondary={(leaf, scope) => + relativizeWorkspacePath(workspaceItemDisplayPath(leaf.data), scope)} onScopeChange={handleScopeChange} onFilterChange={loader.onFilterChange} rootLoading={WORKSPACE_KINDS.some((k) => !loader.loaded[k] && loader.loadingKind[k])} diff --git a/frontend/src/lib/components/workspacePicker.ts b/frontend/src/lib/components/workspacePicker.ts index c33ad36843..3abaa2fb7d 100644 --- a/frontend/src/lib/components/workspacePicker.ts +++ b/frontend/src/lib/components/workspacePicker.ts @@ -29,6 +29,15 @@ export function workspaceItemDisplayPath(item: Pick +): string { + return item.draftOnly ? workspaceItemDisplayPath(item) : item.path +} + /** Display label for kinds — used in the picker rows and search section headers. */ export const KIND_LABEL: Record = { flow: 'Flows',