feat: add scroll-to-top button and improve pagination handling

- Implemented a scroll-to-top button in the viewer UI for better navigation.
- Added styles for the scroll-to-top button in viewer.html and viewer-template.html.
- Created a new ScrollToTop component to manage visibility and scrolling behavior.
- Updated Feed component to include the ScrollToTop component.
- Enhanced pagination logic in usePagination hook to prevent stale closures and improve performance.
- Modified SDKAgent to include additional observation fields for better data handling.
This commit is contained in:
Alex Newman
2025-11-07 17:57:54 -05:00
parent d6f1237283
commit 30a42036aa
9 changed files with 183 additions and 17 deletions
+4 -3
View File
@@ -72,12 +72,13 @@ export function App() {
} catch (error) {
console.error('Failed to load more data:', error);
}
}, [pagination]);
}, [pagination.observations, pagination.summaries, pagination.prompts]);
// Load first page when filter changes or pagination handlers update
// Load first page only when filter changes
useEffect(() => {
handleLoadMore();
}, [currentFilter, handleLoadMore]);
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [currentFilter]); // Only re-run when filter changes, not when handleLoadMore changes
return (
<div className="container">