Compare commits

...

1 Commits

Author SHA1 Message Date
dante01yoon
311c492085 fix: show file extensions in workflow sidebar
Use node.key to derive leaf labels instead of node.label, which loses
the file extension after PrimeVue Tree processing. Remove unused
getFilenameDetails import.

Fixes #10409
2026-04-03 09:58:10 +09:00
2 changed files with 27 additions and 6 deletions

View File

@@ -164,11 +164,7 @@ import {
} from '@/platform/workflow/management/stores/workflowStore'
import { useWorkspaceStore } from '@/stores/workspaceStore'
import type { TreeExplorerNode, TreeNode } from '@/types/treeExplorerTypes'
import {
ensureWorkflowSuffix,
getFilenameDetails,
getWorkflowSuffix
} from '@/utils/formatUtil'
import { ensureWorkflowSuffix, getWorkflowSuffix } from '@/utils/formatUtil'
import { buildTree, sortedTree } from '@/utils/treeUtil'
const { title, filter, searchSubject, dataTestid, hideLeafIcon } = defineProps<{
@@ -328,7 +324,9 @@ const renderTreeNode = (
}
: { handleClick }
const label = node.leaf ? getFilenameDetails(node.label).filename : node.label
const label = node.leaf
? (node.key.split('/').pop() ?? node.label)
: node.label
return {
key: node.key,

View File

@@ -65,6 +65,29 @@ describe('buildTree', () => {
})
})
describe('buildTree workflow keys preserve file extensions', () => {
it('should set leaf label to full filename including extension', () => {
const workflows = [
{ key: 'Workflow-A.json' },
{ key: 'subfolder/Workflow-B.json' },
{ key: 'my-app.app.json' }
]
const tree = buildTree(workflows, (w) => w.key.split('/'))
const leafLabels = (node: TreeNode): string[] =>
node.leaf
? [node.key.split('/').pop()!]
: (node.children ?? []).flatMap(leafLabels)
expect(leafLabels(tree)).toEqual([
'Workflow-A.json',
'Workflow-B.json',
'my-app.app.json'
])
})
})
describe('sortedTree', () => {
const createNode = (label: string, leaf = false): TreeNode => ({
key: label,