From 8a2186a654b67fff101e5f8ac5a68167a2ca52cc Mon Sep 17 00:00:00 2001 From: Ryan Crabbe Date: Sat, 28 Mar 2026 16:19:03 -0700 Subject: [PATCH] [Fix] Reset page to 1 on filter reset and use pageSize param in fallbacks Add setCurrentPage(1) to handleFilterReset in the hook so page resets regardless of which component consumes it. Replace hardcoded page_size: 50 in empty-state fallbacks with the pageSize parameter for consistency. --- .../src/components/view_logs/log_filter_logic.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ui/litellm-dashboard/src/components/view_logs/log_filter_logic.tsx b/ui/litellm-dashboard/src/components/view_logs/log_filter_logic.tsx index 9acff32d63..8c88de49d0 100644 --- a/ui/litellm-dashboard/src/components/view_logs/log_filter_logic.tsx +++ b/ui/litellm-dashboard/src/components/view_logs/log_filter_logic.tsx @@ -174,7 +174,7 @@ export function useLogFilterLogic({ data: [], total: 0, page: 1, - page_size: 50, + page_size: pageSize, total_pages: 0, }; } @@ -242,7 +242,7 @@ export function useLogFilterLogic({ data: [], total: 0, page: 1, - page_size: 50, + page_size: pageSize, total_pages: 0, }; } @@ -294,6 +294,9 @@ export function useLogFilterLogic({ // Cancel any in-flight debounced search debouncedSearch.cancel(); + + // Reset to first page so the unfiltered view starts at page 1 + setCurrentPage(1); }; return {