From bb90dba95277191de1dcca9823dc66645d7649bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Padez?= Date: Wed, 29 Jul 2026 21:58:58 +0000 Subject: [PATCH] jobs: wait for persisted layout before mounting the panel group MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ResizablePanel reads defaultSize only at mount, so mounting during the dashboard-state query's loading window froze the fallback sizes and ignored the persisted layout that arrives after — layout survived in-app nav (query cached) but not a full refresh. Gate the render on isLoaded so the group mounts once, with the stored sizes. Co-Authored-By: Claude Opus 4.8 --- src/apps/officer-web/Screens/Dashboard/Jobs/JobsPage.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 (