fix: 回首页转场软锁 — 幕布合上后永不 reveal,页面只剩背景和导航栏
startNavigation() 重置 readyToLoadHeavy,但 loadingBus 只在新 mark 时通知;首页访问过一次后 REQUIRED 资源全部已标记,mark() 被 done.has(key) 守卫挡住不再 notify,回首页(/ 开启 routeLoading 门控)的 reveal 门控永不通过。修复:导航意图产生时若 loadingBus 快照已 ready,立即恢复门控;真正未加载完的资源仍走订阅通知。
This commit is contained in:
@@ -153,10 +153,20 @@ export default function RouteTransitionOverlay() {
|
|||||||
// Intent → cover (original effect 1).
|
// Intent → cover (original effect 1).
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (targetHref && mode === "idle") {
|
if (targetHref && mode === "idle") {
|
||||||
|
// startNavigation() resets readyToLoadHeavy, but the bus only notifies
|
||||||
|
// on NEW marks. When every REQUIRED key is already done (any visit to
|
||||||
|
// "/" after the first), no notification ever fires again, so the
|
||||||
|
// route:wait reveal gate for a "/" target would never pass — the
|
||||||
|
// curtain stays covering the page (dots background + header only).
|
||||||
|
// Restore the gate immediately when the snapshot is already ready;
|
||||||
|
// genuinely-pending assets still notify through the subscription.
|
||||||
|
if (loadingBus.getSnapshot().ready) {
|
||||||
|
setReadyToLoadHeavy(true);
|
||||||
|
}
|
||||||
routeFrom.current = { path: pathname, coverDone: false };
|
routeFrom.current = { path: pathname, coverDone: false };
|
||||||
setTransition({ mode: "route", phase: "cover" });
|
setTransition({ mode: "route", phase: "cover" });
|
||||||
}
|
}
|
||||||
}, [targetHref, mode, pathname]);
|
}, [targetHref, mode, pathname, setReadyToLoadHeavy]);
|
||||||
|
|
||||||
// Entry wait → reveal (original effect 2): fires as soon as the gates
|
// Entry wait → reveal (original effect 2): fires as soon as the gates
|
||||||
// pass — the reveal is NOT held for the progress-bar fade timers.
|
// pass — the reveal is NOT held for the progress-bar fade timers.
|
||||||
|
|||||||
Reference in New Issue
Block a user