From e73dbbe186d155f4321a23ee9e8d2215fab41495 Mon Sep 17 00:00:00 2001 From: artheru Date: Wed, 10 Jun 2026 09:00:51 +0800 Subject: [PATCH] =?UTF-8?q?ux:=20keep=20the=20tavern=20mounted=20=E2=80=94?= =?UTF-8?q?=20instant=20returns,=20no=20reload=20flash=20(0.65.0)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Home unmounted on every route change, so returning to the tavern reloaded the canvas (the 'loading tavern…' flash + image re-fetch each time) - keep Home mounted in a persistent host, hidden (display:none) when off-route; non-home routes still render in the keyed transition wrapper - the canvas IntersectionObserver pauses while Home is display:none, so a hidden tavern costs nothing — and resumes instantly (not reloaded) on return - verified live: rAF 60→0 when hidden →60 on return, no loading flash, home renders + scrolls, inner routes + transitions intact --- index.html | 2 +- package.json | 2 +- src/Scene2D.jsx | 8 ++++++-- src/styles.css | 3 +++ 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/index.html b/index.html index 8edfef4..ee09994 100644 --- a/index.html +++ b/index.html @@ -4,7 +4,7 @@ - + diff --git a/package.json b/package.json index 36c7d05..f0b53eb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "amerc-site", - "version": "0.64.0-resilience", + "version": "0.65.0-instanthome", "private": true, "type": "module", "scripts": { diff --git a/src/Scene2D.jsx b/src/Scene2D.jsx index 5c085bd..85e24ef 100644 --- a/src/Scene2D.jsx +++ b/src/Scene2D.jsx @@ -7,7 +7,7 @@ import Account from './Account.jsx'; import TavernGame from './TavernGame.jsx'; import { api } from './api.js'; -const RELEASE = '0.64.0-resilience'; +const RELEASE = '0.65.0-instanthome'; const NAV = [ { id: 'home', label: 'Tavern' }, @@ -441,11 +441,15 @@ function Scene({ route, setRoute, auth }) { export default function Scene2DApp() { const [route, setRoute] = useHashRoute(); const auth = useAuth(); + const isHome = route === 'home'; return (

amerc agent mercenary tavern

-
+ {/* Home stays mounted (hidden off-route) so returning to the tavern is instant — + the canvas pauses while hidden, so it costs nothing. */} +
+ {!isHome &&
}
); } diff --git a/src/styles.css b/src/styles.css index 67d2228..c3c2e03 100644 --- a/src/styles.css +++ b/src/styles.css @@ -1446,3 +1446,6 @@ button { .eb-actions button { font-family: Georgia, serif; font-size: 14px; padding: 9px 22px; border-radius: 10px; border: none; cursor: pointer; background: linear-gradient(180deg, #f3d27a, #d9a948); color: #2a1303; font-weight: 600; } .eb-actions a { font-family: Georgia, serif; font-size: 14px; color: #cfe6ff; text-decoration: none; } .eb-actions a:hover { color: #7fe9ff; } + +/* persistent home host (0.65) — keeps the tavern mounted, hidden off-route */ +.route-host { flex: 1; min-height: 0; flex-direction: column; }