mirror of
https://github.com/R0m1k3/CollectFlow.git
synced 2026-10-22 14:38:10 +02:00
feat: introduce virtualized heatmap grid component with client-side filtering, sorting, and optimized Zustand state management.
This commit is contained in:
1 parent
9aca3b8ead
commit
aa77025d14
1 file changed
+2
-2
@@ -233,7 +233,7 @@ export function HeatmapGrid({ onSelectionChange }: HeatmapGridProps) {
|
|||||||
|
|
||||||
const selectedIdxs = Object.keys(rowSelection).filter((k) => rowSelection[k]);
|
const selectedIdxs = Object.keys(rowSelection).filter((k) => rowSelection[k]);
|
||||||
const selectedCodeins = selectedIdxs
|
const selectedCodeins = selectedIdxs
|
||||||
.map((idx) => rows[parseInt(idx)]?.codein ?? "")
|
.map((idx) => filteredData[parseInt(idx)]?.codein ?? "")
|
||||||
.filter(Boolean);
|
.filter(Boolean);
|
||||||
|
|
||||||
// Only update if selection actually changed to avoid re-render loops & console warnings
|
// Only update if selection actually changed to avoid re-render loops & console warnings
|
||||||
@@ -245,7 +245,7 @@ export function HeatmapGrid({ onSelectionChange }: HeatmapGridProps) {
|
|||||||
// Delay update to next tick to ensure we're out of any render cycles
|
// Delay update to next tick to ensure we're out of any render cycles
|
||||||
setTimeout(() => onSelectionChange(selectedCodeins), 0);
|
setTimeout(() => onSelectionChange(selectedCodeins), 0);
|
||||||
}
|
}
|
||||||
}, [rowSelection, onSelectionChange, rows]);
|
}, [rowSelection, onSelectionChange, filteredData]);
|
||||||
|
|
||||||
const columns = React.useMemo<ColumnDef<ProductRow>[]>(() => [
|
const columns = React.useMemo<ColumnDef<ProductRow>[]>(() => [
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in new issue
Block a user