fix: resolve 5 pre-merge issues in finding archive tracking
1. ACTIVE state never populated — stats endpoint now computes ACTIVE from live findings cache count instead of querying archive table 2. CHECK constraint mismatch — migration now uses 3-state constraint (ARCHIVED, RETURNED, CLOSED) matching runtime initArchiveTables() 3. Archive filter click non-functional — handleArchiveStateClick now fetches and renders filtered archive list below summary bar 4. Hook glob pattern mismatch — changed **/migrate*.js to **/migrations/*.js so hook fires for actual migration filenames 5. Stale stats after sync — ArchiveSummaryBar polls every 60s and refreshes immediately after workflow sync via refreshKey prop
This commit is contained in:
@@ -121,7 +121,7 @@ function hexToRgb(hex) {
|
||||
return `${r}, ${g}, ${b}`;
|
||||
}
|
||||
|
||||
export default function ArchiveSummaryBar({ onStateClick, activeFilter }) {
|
||||
export default function ArchiveSummaryBar({ onStateClick, activeFilter, refreshKey }) {
|
||||
const [stats, setStats] = useState(null);
|
||||
const [loading, setLoading] = useState(true);
|
||||
const [error, setError] = useState(false);
|
||||
@@ -146,8 +146,11 @@ export default function ArchiveSummaryBar({ onStateClick, activeFilter }) {
|
||||
}
|
||||
};
|
||||
load();
|
||||
return () => { cancelled = true; };
|
||||
}, []);
|
||||
|
||||
// Re-fetch every 60s so stats stay reasonably fresh after syncs
|
||||
const interval = setInterval(load, 60000);
|
||||
return () => { cancelled = true; clearInterval(interval); };
|
||||
}, [refreshKey]);
|
||||
|
||||
if (loading) {
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user