From 2aa9cbecaa21af43aa0565ba373de6dafe2bb2a8 Mon Sep 17 00:00:00 2001 From: Michael SCHAL Date: Fri, 3 Apr 2026 11:26:13 +0200 Subject: [PATCH] revert: restore grid to pre-infinite-scroll state Remove infinite grid loading, useInfiniteGrid hook, and server-side pagination API route. Revert grid components to the simpler version that avoids 2MB+ cache failures from unstable_cache. Co-Authored-By: Claude Sonnet 4.6 --- src/app/(dashboard)/grid/page.tsx | 11 +- src/app/api/grid/rows/route.ts | 49 ------ src/features/grid/actions.ts | 16 +- src/features/grid/api/get-product-rows.ts | 103 +----------- src/features/grid/components/grid-client.tsx | 71 ++------ src/features/grid/components/heatmap-grid.tsx | 24 +-- src/features/grid/hooks/use-infinite-grid.ts | 158 ------------------ src/features/grid/store/use-grid-store.ts | 30 +--- 8 files changed, 40 insertions(+), 422 deletions(-) delete mode 100644 src/app/api/grid/rows/route.ts delete mode 100644 src/features/grid/hooks/use-infinite-grid.ts diff --git a/src/app/(dashboard)/grid/page.tsx b/src/app/(dashboard)/grid/page.tsx index 427cd49..2185bec 100644 --- a/src/app/(dashboard)/grid/page.tsx +++ b/src/app/(dashboard)/grid/page.tsx @@ -33,16 +33,15 @@ export default async function GridPage({ searchParams }: GridPageProps) { return ; } - // 3. Load product data — pagination pour ne pas crasher le JS client - console.log(`\n>>> [GridPage] Fetching page 0 for: ${codeFournisseur}, shop: ${magasin}`); - const { rows: initialRows, total } = await getGridData(codeFournisseur, magasin, filters, 0, 200); - console.log(`>>> [GridPage] Received ${initialRows.length}/${total} rows from getGridData`); + // 3. Load real product data for the selected supplier + console.log(`\n>>> [GridPage] Fetching data for: ${codeFournisseur}, shop: ${magasin}`); + const rows = await getGridData(codeFournisseur, magasin, filters); + console.log(`>>> [GridPage] Received ${rows.length} rows from getGridData`); const selectedFournisseur = fournisseurs.find((f: { code: string; nom: string }) => f.code === codeFournisseur); return (