diff --git a/src/ui/components/history_tab.py b/src/ui/components/history_tab.py index 016fc69..e56173c 100644 --- a/src/ui/components/history_tab.py +++ b/src/ui/components/history_tab.py @@ -171,7 +171,7 @@ def create_history_tab(): search_box = gr.Textbox( label="Search", placeholder="Search by filename...", - scale=2, + scale=3, ) filter_dropdown = gr.Dropdown( @@ -181,6 +181,8 @@ def create_history_tab(): scale=1, ) + refresh_btn = gr.Button("Refresh", variant="secondary", scale=1) + with gr.Row(): # Gallery with gr.Column(scale=2): @@ -253,10 +255,17 @@ def create_history_tab(): outputs=[gallery, stats_display], ) + refresh_btn.click( + fn=lambda f: (get_history_gallery(f), get_history_stats()), + inputs=[filter_dropdown], + outputs=[gallery, stats_display], + ) + return { "gallery": gallery, "comparison_slider": comparison_slider, "item_details": item_details, "stats_display": stats_display, "filter_dropdown": filter_dropdown, + "refresh_btn": refresh_btn, }