Problem
The initial app skeletons — the inbox sidebar in BaseSidebarScreen and the ForYouSection — decided whether to render from persisted Onyx flags rather than from whether the OpenApp request was actually in flight. BaseSidebarScreen defaulted IS_LOADING_APP to true and tracked "have we ever finished loading" in a module-level variable fed by its own Onyx.connectWithoutView, and ForYouSection gated on isLoadingApp || isLoadingReportData. Because those flags can be stale or optimistically re-set (e.g. ReconnectApp flipping IS_LOADING_REPORT_DATA back to true), the skeletons could show when no app load was pending, or flash again on foreground, reconnect, and tab navigation.
Solution
Both components now derive the initial skeleton from the request queue via the existing useIsAppLoadPending() hook, so the skeleton tracks the real in-flight OpenApp. HAS_LOADED_APP keeps the skeleton limited to the first load (including holding it while that key is still hydrating, checked with isLoadingOnyxValue), and IS_LOADING_APP is demoted to a narrow isColdRestartRecoveryFallback for recovering an interrupted cold start after HAS_LOADED_APP hydrates false. This deletes the module-level hasEverFinishedLoading variable and its ad-hoc Onyx subscription, and the skeleton telemetry reasonAttributes are updated to report the new signals. New UI tests in tests/ui/BaseSidebarScreenTest.tsx and tests/ui/ForYouSectionTest.tsx cover the cold-load, hydrating, and already-loaded cases.
PR
#97115
Issue Owner
Current Issue Owner: @BartekObudzinski
Problem
The initial app skeletons — the inbox sidebar in
BaseSidebarScreenand theForYouSection— decided whether to render from persisted Onyx flags rather than from whether theOpenApprequest was actually in flight.BaseSidebarScreendefaultedIS_LOADING_APPtotrueand tracked "have we ever finished loading" in a module-level variable fed by its ownOnyx.connectWithoutView, andForYouSectiongated onisLoadingApp || isLoadingReportData. Because those flags can be stale or optimistically re-set (e.g.ReconnectAppflippingIS_LOADING_REPORT_DATAback to true), the skeletons could show when no app load was pending, or flash again on foreground, reconnect, and tab navigation.Solution
Both components now derive the initial skeleton from the request queue via the existing
useIsAppLoadPending()hook, so the skeleton tracks the real in-flightOpenApp.HAS_LOADED_APPkeeps the skeleton limited to the first load (including holding it while that key is still hydrating, checked withisLoadingOnyxValue), andIS_LOADING_APPis demoted to a narrowisColdRestartRecoveryFallbackfor recovering an interrupted cold start afterHAS_LOADED_APPhydrates false. This deletes the module-levelhasEverFinishedLoadingvariable and its ad-hoc Onyx subscription, and the skeleton telemetryreasonAttributesare updated to report the new signals. New UI tests intests/ui/BaseSidebarScreenTest.tsxandtests/ui/ForYouSectionTest.tsxcover the cold-load, hydrating, and already-loaded cases.PR
#97115
Issue Owner
Current Issue Owner: @BartekObudzinski