@@ -24,7 +24,16 @@ type HistoryViewProps = {
2424type SortOption = "newest" | "oldest" | "mostExpensive" | "mostTokens" | "mostRelevant"
2525
2626const HistoryView = ( { onDone } : HistoryViewProps ) => {
27- const { tasks, searchQuery, setSearchQuery, sortOption, setSortOption, setLastNonRelevantSort } = useTaskSearch ( )
27+ const {
28+ tasks,
29+ searchQuery,
30+ setSearchQuery,
31+ sortOption,
32+ setSortOption,
33+ setLastNonRelevantSort,
34+ showAllWorkspaces,
35+ setShowAllWorkspaces,
36+ } = useTaskSearch ( )
2837 const { t } = useAppTranslation ( )
2938
3039 const [ deleteTaskId , setDeleteTaskId ] = useState < string | null > ( null )
@@ -147,21 +156,34 @@ const HistoryView = ({ onDone }: HistoryViewProps) => {
147156 </ VSCodeRadio >
148157 </ VSCodeRadioGroup >
149158
159+ < div className = "flex items-center gap-2" onClick = { ( ) => setShowAllWorkspaces ( ! showAllWorkspaces ) } >
160+ < VSCodeCheckbox
161+ checked = { showAllWorkspaces }
162+ onChange = { ( e ) => setShowAllWorkspaces ( ( e . target as HTMLInputElement ) . checked ) }
163+ />
164+ < span className = "text-vscode-foreground" > { t ( "history:showAllWorkspaces" ) } </ span >
165+ </ div >
166+
150167 { /* Select all control in selection mode */ }
151168 { isSelectionMode && tasks . length > 0 && (
152169 < div className = "flex items-center py-1 px-2 bg-vscode-editor-background rounded" >
153- < VSCodeCheckbox
154- checked = { tasks . length > 0 && selectedTaskIds . length === tasks . length }
155- onChange = { ( e ) => toggleSelectAll ( ( e . target as HTMLInputElement ) . checked ) }
156- />
157- < span className = "ml-2 text-vscode-foreground" >
158- { selectedTaskIds . length === tasks . length
159- ? t ( "history:deselectAll" )
160- : t ( "history:selectAll" ) }
161- </ span >
162- < span className = "ml-auto text-vscode-descriptionForeground text-xs" >
163- { t ( "history:selectedItems" , { selected : selectedTaskIds . length , total : tasks . length } ) }
164- </ span >
170+ < div className = "flex items-center gap-2" >
171+ < VSCodeCheckbox
172+ checked = { tasks . length > 0 && selectedTaskIds . length === tasks . length }
173+ onChange = { ( e ) => toggleSelectAll ( ( e . target as HTMLInputElement ) . checked ) }
174+ />
175+ < span className = "text-vscode-foreground" >
176+ { selectedTaskIds . length === tasks . length
177+ ? t ( "history:deselectAll" )
178+ : t ( "history:selectAll" ) }
179+ </ span >
180+ < span className = "ml-auto text-vscode-descriptionForeground text-xs" >
181+ { t ( "history:selectedItems" , {
182+ selected : selectedTaskIds . length ,
183+ total : tasks . length ,
184+ } ) }
185+ </ span >
186+ </ div >
165187 </ div >
166188 ) }
167189 </ div >
@@ -214,33 +236,42 @@ const HistoryView = ({ onDone }: HistoryViewProps) => {
214236
215237 < div className = "flex-1" >
216238 < div className = "flex justify-between items-center" >
217- < span className = "text-vscode-descriptionForeground font-medium text-sm uppercase" >
218- { formatDate ( item . ts ) }
219- </ span >
220- < div className = "flex flex-row" >
221- { ! isSelectionMode && (
222- < Button
223- variant = "ghost"
224- size = "sm"
225- title = { t ( "history:deleteTaskTitle" ) }
226- data-testid = "delete-task-button"
227- onClick = { ( e ) => {
228- e . stopPropagation ( )
229-
230- if ( e . shiftKey ) {
231- vscode . postMessage ( {
232- type : "deleteTaskWithId" ,
233- text : item . id ,
234- } )
235- } else {
236- setDeleteTaskId ( item . id )
237- }
238- } } >
239- < span className = "codicon codicon-trash" />
240- { item . size && prettyBytes ( item . size ) }
241- </ Button >
239+ < div className = "flex items-center gap-4" >
240+ < span className = "text-vscode-descriptionForeground font-medium text-sm uppercase" >
241+ { formatDate ( item . ts ) }
242+ </ span >
243+ { item . workspace && (
244+ < span className = "text-xs text-vscode-descriptionForeground flex items-center gap-1" >
245+ < span className = "codicon codicon-folder" />
246+ < span
247+ className = "truncate max-w-[300px]"
248+ dangerouslySetInnerHTML = { { __html : item . workspace } }
249+ />
250+ </ span >
242251 ) }
243252 </ div >
253+ { ! isSelectionMode && (
254+ < Button
255+ variant = "ghost"
256+ size = "sm"
257+ title = { t ( "history:deleteTaskTitle" ) }
258+ data-testid = "delete-task-button"
259+ onClick = { ( e ) => {
260+ e . stopPropagation ( )
261+
262+ if ( e . shiftKey ) {
263+ vscode . postMessage ( {
264+ type : "deleteTaskWithId" ,
265+ text : item . id ,
266+ } )
267+ } else {
268+ setDeleteTaskId ( item . id )
269+ }
270+ } } >
271+ < span className = "codicon codicon-trash" />
272+ { item . size && prettyBytes ( item . size ) }
273+ </ Button >
274+ ) }
244275 </ div >
245276 < div
246277 style = { {
0 commit comments