From 86d068a7ccfafb1472cca173b88c3839df5dc5f7 Mon Sep 17 00:00:00 2001 From: richard-epsilla Date: Thu, 1 Oct 2026 20:17:31 -0700 Subject: [PATCH] workplace: the room is read once at boot whether or not the tab is visible The periodic refreshes run only while the tab is visible, so a tab that booted in the background sat on "Opening the workplace" with an empty room list until it was looked at. Co-Authored-By: Claude Fable 5.1 --- kits/workplace/app/src/App.jsx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/kits/workplace/app/src/App.jsx b/kits/workplace/app/src/App.jsx index 6384197..eee1dbe 100644 --- a/kits/workplace/app/src/App.jsx +++ b/kits/workplace/app/src/App.jsx @@ -113,6 +113,12 @@ function Workplace() { }, [me, harnessIds]); const ready = !!rec && !!me; + // The first read of the room is unconditional: the periodic refreshes below run only while the + // tab is visible, and a tab that booted in the background (opened behind another, or switched + // away from in its first seconds) sat on "Opening the workplace" with an empty room list until + // it was looked at (2026-10-02). + useEffect(() => { if (ready) refreshTeammates(); }, [ready, refreshTeammates]); + useEffect(() => { if (ready && teammates) refreshCards(); }, [ready, teammates !== null, refreshCards]); // eslint-disable-line react-hooks/exhaustive-deps useVisibleInterval(() => { if (ready) refreshTeammates(); }, TEAMMATES_MS, [ready, refreshTeammates]); useVisibleInterval(() => { if (ready && teammates) refreshCards(); }, CARDS_MS, [ready, teammates !== null, refreshCards]);