diff --git a/src/apps/officer-web/Screens/Dashboard/Jobs/JobsPage.tsx b/src/apps/officer-web/Screens/Dashboard/Jobs/JobsPage.tsx index 9fac947e..2b025b3d 100644 --- a/src/apps/officer-web/Screens/Dashboard/Jobs/JobsPage.tsx +++ b/src/apps/officer-web/Screens/Dashboard/Jobs/JobsPage.tsx @@ -330,8 +330,12 @@ const matchesPanelSet = (node: LayoutNode): boolean => { // One page for /jobs and /jobs/:id — master (list) + detail, resizable like /chat. The layout is // persisted per-user via useDashboardState (screens/ namespace), so pane sizes survive reloads. +// Wait for isLoaded before mounting: ResizablePanel reads defaultSize only at mount, so mounting +// during the query's loading window would freeze the fallback sizes and ignore the persisted layout +// that arrives after (the "survives nav but not refresh" bug — on nav the query is already cached). export const JobsPage = () => { - const { value, setValue } = useDashboardState('screens/jobs', JOBS_LAYOUT); + const { value, setValue, isLoaded } = useDashboardState('screens/jobs', JOBS_LAYOUT); + if (!isLoaded) return
; const layout = matchesPanelSet(value) ? value : JOBS_LAYOUT; return (