@@ -4,12 +4,12 @@ import { BatchDeleteTaskDialog } from "./BatchDeleteTaskDialog"
44import prettyBytes from "pretty-bytes"
55import { Virtuoso } from "react-virtuoso"
66
7- import { VSCodeTextField , VSCodeRadioGroup , VSCodeRadio , VSCodeCheckbox } from "@vscode/webview-ui-toolkit/react"
7+ import { VSCodeTextField , VSCodeRadioGroup , VSCodeRadio } from "@vscode/webview-ui-toolkit/react"
88
99import { vscode } from "@/utils/vscode"
1010import { formatLargeNumber , formatDate } from "@/utils/format"
1111import { cn } from "@/lib/utils"
12- import { Button } from "@/components/ui"
12+ import { Button , Checkbox } from "@/components/ui"
1313import { useAppTranslation } from "@/i18n/TranslationContext"
1414
1515import { Tab , TabContent , TabHeader } from "../common/Tab"
@@ -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,36 @@ const HistoryView = ({ onDone }: HistoryViewProps) => {
147156 </ VSCodeRadio >
148157 </ VSCodeRadioGroup >
149158
159+ < div className = "flex items-center gap-2" onClick = { ( ) => setShowAllWorkspaces ( ! showAllWorkspaces ) } >
160+ < Checkbox
161+ checked = { showAllWorkspaces }
162+ onCheckedChange = { ( checked ) => setShowAllWorkspaces ( checked === true ) }
163+ variant = "description"
164+ />
165+ < span className = "text-vscode-foreground" > { t ( "history:showAllWorkspaces" ) } </ span >
166+ </ div >
167+
150168 { /* Select all control in selection mode */ }
151169 { isSelectionMode && tasks . length > 0 && (
152170 < 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 >
171+ < div className = "flex items-center gap-2" >
172+ < Checkbox
173+ checked = { tasks . length > 0 && selectedTaskIds . length === tasks . length }
174+ onCheckedChange = { ( checked ) => toggleSelectAll ( checked === true ) }
175+ variant = "description"
176+ />
177+ < span className = "text-vscode-foreground" >
178+ { selectedTaskIds . length === tasks . length
179+ ? t ( "history:deselectAll" )
180+ : t ( "history:selectAll" ) }
181+ </ span >
182+ < span className = "ml-auto text-vscode-descriptionForeground text-xs" >
183+ { t ( "history:selectedItems" , {
184+ selected : selectedTaskIds . length ,
185+ total : tasks . length ,
186+ } ) }
187+ </ span >
188+ </ div >
165189 </ div >
166190 ) }
167191 </ div >
@@ -203,11 +227,12 @@ const HistoryView = ({ onDone }: HistoryViewProps) => {
203227 onClick = { ( e ) => {
204228 e . stopPropagation ( )
205229 } } >
206- < VSCodeCheckbox
230+ < Checkbox
207231 checked = { selectedTaskIds . includes ( item . id ) }
208- onChange = { ( e ) =>
209- toggleTaskSelection ( item . id , ( e . target as HTMLInputElement ) . checked )
232+ onCheckedChange = { ( checked ) =>
233+ toggleTaskSelection ( item . id , checked === true )
210234 }
235+ variant = "description"
211236 />
212237 </ div >
213238 ) }
@@ -407,6 +432,13 @@ const HistoryView = ({ onDone }: HistoryViewProps) => {
407432 ) }
408433 </ div >
409434 ) }
435+
436+ { showAllWorkspaces && item . workspace && (
437+ < div className = "flex flex-row gap-1 text-vscode-descriptionForeground text-xs" >
438+ < span className = "codicon codicon-folder scale-80" />
439+ < span > { item . workspace } </ span >
440+ </ div >
441+ ) }
410442 </ div >
411443 </ div >
412444 </ div >
0 commit comments