@@ -13,6 +13,8 @@ import { ChatInitializedModal as UiChatInitializedModal } from '@ui/components/e
1313import { CommitMessageModal as UiCommitMessageModal } from '@ui/components/editor/panel/modals/CommitMessageModal'
1414import { StageFilesModal as UiStageFilesModal } from '@ui/components/editor/panel/modals/StageFilesModal'
1515import { use_panel } from './hooks/use-panel'
16+ import { Button } from '@ui/components/editor/panel/Button'
17+ import { FileInPreview } from '@shared/types/file-in-preview'
1618import { LayoutContext } from './contexts/LayoutContext'
1719import { Layout } from './components/Layout/Layout'
1820
@@ -296,28 +298,53 @@ export const Panel = () => {
296298 on_back_click = { ( ) => {
297299 post_message ( vscode , { command : 'EDITS_REVIEW' , files : [ ] } )
298300 } }
301+ footer_slot = {
302+ < >
303+ < Button
304+ on_click = { ( ) => {
305+ set_response_history ( ( prev ) =>
306+ prev . filter (
307+ ( i ) =>
308+ i . created_at != selected_history_item_created_at
309+ )
310+ )
311+ set_selected_history_item_created_at ( undefined )
312+ post_message ( vscode , {
313+ command : 'EDITS_REVIEW' ,
314+ files : [ ]
315+ } )
316+ } }
317+ is_secondary
318+ >
319+ Discard
320+ </ Button >
321+ < Button
322+ on_click = { ( ) => {
323+ const accepted_files = items_to_review . filter (
324+ ( f ) => 'file_path' in f && f . is_checked
325+ ) as FileInPreview [ ]
326+ set_response_history ( [ ] )
327+ set_selected_history_item_created_at ( undefined )
328+ post_message ( vscode , {
329+ command : 'EDITS_REVIEW' ,
330+ files : accepted_files
331+ } )
332+ } }
333+ disabled = {
334+ items_to_review . filter (
335+ ( f ) => 'file_path' in f && f . is_checked
336+ ) . length == 0
337+ }
338+ >
339+ Approve
340+ </ Button >
341+ </ >
342+ }
299343 >
300344 < UiResponsePreview
301345 items = { items_to_review }
302346 raw_instructions = { raw_instructions }
303347 has_multiple_workspaces = { workspace_folder_count > 1 }
304- on_discard = { ( ) => {
305- set_response_history ( ( prev ) =>
306- prev . filter (
307- ( i ) => i . created_at != selected_history_item_created_at
308- )
309- )
310- set_selected_history_item_created_at ( undefined )
311- post_message ( vscode , { command : 'EDITS_REVIEW' , files : [ ] } )
312- } }
313- on_approve = { ( accepted_files ) => {
314- set_response_history ( [ ] )
315- set_selected_history_item_created_at ( undefined )
316- post_message ( vscode , {
317- command : 'EDITS_REVIEW' ,
318- files : accepted_files
319- } )
320- } }
321348 on_focus_file = { ( file ) => {
322349 post_message ( vscode , {
323350 command : 'FOCUS_ON_FILE_IN_PREVIEW' ,
0 commit comments