feat: implement clickable category links in charts and lists; handle uncategorized transactions in URL parameters

This commit is contained in:
Julien Froidefond
2025-12-20 11:07:35 +01:00
parent d61d9181c7
commit 4f7a80de1c
5 changed files with 113 additions and 41 deletions

View File

@@ -69,6 +69,21 @@ export function useTransactionsPage() {
}
}, [searchParams]);
// Handle categoryIds and includeUncategorized from URL params
useEffect(() => {
const categoryIdsParam = searchParams.get("categoryIds");
const includeUncategorizedParam = searchParams.get("includeUncategorized");
if (categoryIdsParam) {
const categoryIds = categoryIdsParam.split(",");
setSelectedCategories(categoryIds);
setPage(0);
} else if (includeUncategorizedParam === "true") {
setSelectedCategories(["uncategorized"]);
setPage(0);
}
}, [searchParams]);
// Calculate start date based on period
const startDate = useMemo(() => {
const now = new Date();