@@ -3,10 +3,9 @@ import { DeleteTaskDialog } from "./DeleteTaskDialog"
33import { BatchDeleteTaskDialog } from "./BatchDeleteTaskDialog"
44import { Virtuoso } from "react-virtuoso"
55
6- import { VSCodeTextField , VSCodeRadioGroup , VSCodeRadio } from "@vscode/webview-ui-toolkit/react"
6+ import { VSCodeTextField } from "@vscode/webview-ui-toolkit/react"
77
8- import { cn } from "@/lib/utils"
9- import { Button , Checkbox } from "@/components/ui"
8+ import { Button , Checkbox , Select , SelectContent , SelectItem , SelectTrigger , SelectValue } from "@/components/ui"
109import { useAppTranslation } from "@/i18n/TranslationContext"
1110
1211import { Tab , TabContent , TabHeader } from "../common/Tab"
@@ -95,7 +94,7 @@ const HistoryView = ({ onDone }: HistoryViewProps) => {
9594 </ div >
9695 < div className = "flex flex-col gap-2" >
9796 < VSCodeTextField
98- style = { { width : "100%" } }
97+ className = "w-full"
9998 placeholder = { t ( "history:searchPlaceholder" ) }
10099 value = { searchQuery }
101100 data-testid = "history-search-input"
@@ -107,62 +106,83 @@ const HistoryView = ({ onDone }: HistoryViewProps) => {
107106 setSortOption ( "mostRelevant" )
108107 }
109108 } } >
110- < div
111- slot = "start"
112- className = "codicon codicon-search"
113- style = { { fontSize : 13 , marginTop : 2.5 , opacity : 0.8 } }
114- />
109+ < div slot = "start" className = "codicon codicon-search mt-0.5 opacity-80 text-sm!" />
115110 { searchQuery && (
116111 < div
117- className = "input-icon-button codicon codicon-close"
112+ className = "input-icon-button codicon codicon-close flex justify-center items-center h-full "
118113 aria-label = "Clear search"
119114 onClick = { ( ) => setSearchQuery ( "" ) }
120115 slot = "end"
121- style = { {
122- display : "flex" ,
123- justifyContent : "center" ,
124- alignItems : "center" ,
125- height : "100%" ,
126- } }
127116 />
128117 ) }
129118 </ VSCodeTextField >
130- < VSCodeRadioGroup
131- style = { { display : "flex" , flexWrap : "wrap" } }
132- value = { sortOption }
133- role = "radiogroup"
134- onChange = { ( e ) => setSortOption ( ( e . target as HTMLInputElement ) . value as SortOption ) } >
135- < VSCodeRadio value = "newest" data-testid = "radio-newest" >
136- { t ( "history:newest" ) }
137- </ VSCodeRadio >
138- < VSCodeRadio value = "oldest" data-testid = "radio-oldest" >
139- { t ( "history:oldest" ) }
140- </ VSCodeRadio >
141- < VSCodeRadio value = "mostExpensive" data-testid = "radio-most-expensive" >
142- { t ( "history:mostExpensive" ) }
143- </ VSCodeRadio >
144- < VSCodeRadio value = "mostTokens" data-testid = "radio-most-tokens" >
145- { t ( "history:mostTokens" ) }
146- </ VSCodeRadio >
147- < VSCodeRadio
148- value = "mostRelevant"
149- disabled = { ! searchQuery }
150- data-testid = "radio-most-relevant"
151- style = { { opacity : searchQuery ? 1 : 0.5 } } >
152- { t ( "history:mostRelevant" ) }
153- </ VSCodeRadio >
154- </ VSCodeRadioGroup >
155-
156- < div className = "flex items-center gap-2" >
157- < Checkbox
158- id = "show-all-workspaces-view"
159- checked = { showAllWorkspaces }
160- onCheckedChange = { ( checked ) => setShowAllWorkspaces ( checked === true ) }
161- variant = "description"
162- />
163- < label htmlFor = "show-all-workspaces-view" className = "text-vscode-foreground cursor-pointer" >
164- { t ( "history:showAllWorkspaces" ) }
165- </ label >
119+ < div className = "flex gap-2" >
120+ < Select
121+ value = { showAllWorkspaces ? "all" : "current" }
122+ onValueChange = { ( value ) => setShowAllWorkspaces ( value === "all" ) } >
123+ < SelectTrigger className = "flex-1" >
124+ < SelectValue >
125+ { t ( "history:workspace.prefix" ) } { " " }
126+ { t ( `history:workspace.${ showAllWorkspaces ? "all" : "current" } ` ) }
127+ </ SelectValue >
128+ </ SelectTrigger >
129+ < SelectContent >
130+ < SelectItem value = "current" >
131+ < div className = "flex items-center gap-2" >
132+ < span className = "codicon codicon-folder" />
133+ { t ( "history:workspace.current" ) }
134+ </ div >
135+ </ SelectItem >
136+ < SelectItem value = "all" >
137+ < div className = "flex items-center gap-2" >
138+ < span className = "codicon codicon-folder-opened" />
139+ { t ( "history:workspace.all" ) }
140+ </ div >
141+ </ SelectItem >
142+ </ SelectContent >
143+ </ Select >
144+ < Select value = { sortOption } onValueChange = { ( value ) => setSortOption ( value as SortOption ) } >
145+ < SelectTrigger className = "flex-1" >
146+ < SelectValue >
147+ { t ( "history:sort.prefix" ) } { t ( `history:sort.${ sortOption } ` ) }
148+ </ SelectValue >
149+ </ SelectTrigger >
150+ < SelectContent >
151+ < SelectItem value = "newest" data-testid = "select-newest" >
152+ < div className = "flex items-center gap-2" >
153+ < span className = "codicon codicon-arrow-down" />
154+ { t ( "history:newest" ) }
155+ </ div >
156+ </ SelectItem >
157+ < SelectItem value = "oldest" data-testid = "select-oldest" >
158+ < div className = "flex items-center gap-2" >
159+ < span className = "codicon codicon-arrow-up" />
160+ { t ( "history:oldest" ) }
161+ </ div >
162+ </ SelectItem >
163+ < SelectItem value = "mostExpensive" data-testid = "select-most-expensive" >
164+ < div className = "flex items-center gap-2" >
165+ < span className = "codicon codicon-credit-card" />
166+ { t ( "history:mostExpensive" ) }
167+ </ div >
168+ </ SelectItem >
169+ < SelectItem value = "mostTokens" data-testid = "select-most-tokens" >
170+ < div className = "flex items-center gap-2" >
171+ < span className = "codicon codicon-symbol-numeric" />
172+ { t ( "history:mostTokens" ) }
173+ </ div >
174+ </ SelectItem >
175+ < SelectItem
176+ value = "mostRelevant"
177+ disabled = { ! searchQuery }
178+ data-testid = "select-most-relevant" >
179+ < div className = "flex items-center gap-2" >
180+ < span className = "codicon codicon-search" />
181+ { t ( "history:mostRelevant" ) }
182+ </ div >
183+ </ SelectItem >
184+ </ SelectContent >
185+ </ Select >
166186 </ div >
167187
168188 { /* Select all control in selection mode */ }
@@ -193,10 +213,7 @@ const HistoryView = ({ onDone }: HistoryViewProps) => {
193213
194214 < TabContent className = "p-0" >
195215 < Virtuoso
196- style = { {
197- flexGrow : 1 ,
198- overflowY : "scroll" ,
199- } }
216+ className = "flex-1 overflow-y-scroll"
200217 data = { tasks }
201218 data-testid = "virtuoso-container"
202219 initialTopMostItemIndex = { 0 }
@@ -205,7 +222,7 @@ const HistoryView = ({ onDone }: HistoryViewProps) => {
205222 < div { ...props } ref = { ref } data-testid = "virtuoso-item-list" />
206223 ) ) ,
207224 } }
208- itemContent = { ( index , item ) => (
225+ itemContent = { ( _index , item ) => (
209226 < TaskItem
210227 key = { item . id }
211228 item = { item }
@@ -215,9 +232,7 @@ const HistoryView = ({ onDone }: HistoryViewProps) => {
215232 isSelected = { selectedTaskIds . includes ( item . id ) }
216233 onToggleSelection = { toggleTaskSelection }
217234 onDelete = { setDeleteTaskId }
218- className = { cn ( {
219- "border-b border-vscode-panel-border" : index < tasks . length - 1 ,
220- } ) }
235+ className = "m-2 mr-0"
221236 />
222237 ) }
223238 />
0 commit comments