@@ -58,7 +58,7 @@ export const MemoizedWorkflowItem = memo(
5858 onSelect : ( ) => void
5959 color : string
6060 name : string
61- folderPath ?: string
61+ folderPath ?: string [ ]
6262 isCurrent ?: boolean
6363 } ) {
6464 return (
@@ -71,13 +71,21 @@ export const MemoizedWorkflowItem = memo(
7171 backgroundClip : 'padding-box' ,
7272 } }
7373 />
74- < span className = 'truncate font-base text-[var(--text-body)]' >
75- { name }
76- { isCurrent && ' (current)' }
74+ < span className = 'flex min-w-0 max-w-[75%] flex-shrink-0 font-base text-[var(--text-body)]' >
75+ < span className = 'truncate' > { name } </ span >
76+ { isCurrent && < span className = 'flex-shrink-0 whitespace-pre' > (current)</ span > }
7777 </ span >
78- { folderPath && (
79- < span className = 'ml-auto min-w-0 truncate pl-2 font-base text-[var(--text-subtle)] text-small' >
80- { folderPath }
78+ { folderPath && folderPath . length > 0 && (
79+ < span className = 'ml-auto flex min-w-0 pl-2 font-base text-[var(--text-subtle)] text-small' >
80+ { folderPath . length > 1 && (
81+ < >
82+ < span className = 'min-w-0 truncate [flex-shrink:9999]' >
83+ { folderPath . slice ( 0 , - 1 ) . join ( ' / ' ) }
84+ </ span >
85+ < span className = 'flex-shrink-0 whitespace-pre' > / </ span >
86+ </ >
87+ ) }
88+ < span className = 'min-w-0 truncate' > { folderPath [ folderPath . length - 1 ] } </ span >
8189 </ span >
8290 ) }
8391 </ Command . Item >
@@ -87,8 +95,10 @@ export const MemoizedWorkflowItem = memo(
8795 prev . value === next . value &&
8896 prev . color === next . color &&
8997 prev . name === next . name &&
90- prev . folderPath === next . folderPath &&
91- prev . isCurrent === next . isCurrent
98+ prev . isCurrent === next . isCurrent &&
99+ ( prev . folderPath === next . folderPath ||
100+ ( prev . folderPath ?. length === next . folderPath ?. length &&
101+ ( prev . folderPath ?? [ ] ) . every ( ( segment , i ) => segment === next . folderPath ?. [ i ] ) ) )
92102)
93103
94104export const MemoizedTaskItem = memo (
@@ -127,9 +137,9 @@ export const MemoizedWorkspaceItem = memo(
127137 } ) {
128138 return (
129139 < Command . Item value = { value } onSelect = { onSelect } className = { COMMAND_ITEM_CLASSNAME } >
130- < span className = 'truncate font-base text-[var(--text-body)]' >
131- { name }
132- { isCurrent && ' (current)' }
140+ < span className = 'flex min-w-0 font-base text-[var(--text-body)]' >
141+ < span className = 'truncate' > { name } </ span >
142+ { isCurrent && < span className = 'flex-shrink-0 whitespace-pre' > (current)</ span > }
133143 </ span >
134144 </ Command . Item >
135145 )
0 commit comments