From 1a0a349fb38fff5efcfa5776587ea2ad24783bb7 Mon Sep 17 00:00:00 2001 From: rouggy Date: Thu, 23 Jul 2026 23:11:58 +0200 Subject: [PATCH] fix: NET Control "#" column now renumbers on reorder The pass-order "#" is a rowIndex valueGetter, but AG-Grid keeps the same row node across a reorder (getRowId by id) and caches the value, so a moved station kept its old number. Force-refresh the __order column on every model update in passOrder mode. --- frontend/src/components/RecentQSOsGrid.tsx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/frontend/src/components/RecentQSOsGrid.tsx b/frontend/src/components/RecentQSOsGrid.tsx index 112b5a7..8c8c80f 100644 --- a/frontend/src/components/RecentQSOsGrid.tsx +++ b/frontend/src/components/RecentQSOsGrid.tsx @@ -407,9 +407,16 @@ export function RecentQSOsGrid({ rows, selectAllSignal, selectRowSignal, rowDrag const reportFilteredCount = useCallback((e: { api?: any }) => { const api = e?.api ?? gridRef.current?.api; if (api?.getDisplayedRowCount) setDispCount(api.getDisplayedRowCount()); + // Pass-order "#" is a rowIndex-based valueGetter; AG-Grid keeps the same + // row node across a reorder (getRowId by id), so the number is cached and + // stale until we force it. Refresh it on every model update (a reorder + // fires one). force:true bypasses the value cache. + if (passOrder && api?.refreshCells) { + api.refreshCells({ columns: ['__order'], force: true }); + } if (!api || !onFilteredCountChange) return; onFilteredCountChange(api.isAnyFilterPresent?.() ? api.getDisplayedRowCount() : null); - }, [onFilteredCountChange]); + }, [onFilteredCountChange, passOrder]); const saveColumnState = useCallback(() => { if (restoringRef.current) return; // ignore the events fired by a column rebuild const state = gridRef.current?.api?.getColumnState();