Compare commits

..

4 Commits

Author SHA1 Message Date
BOHA
5b380863cf chore(release): v2.4.20 - standalone PWA viewport fix
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-11 08:48:57 +02:00
BOHA
1293da7f25 fix(odin): measured --app-height for standalone-PWA viewports
Installed PWAs (MIUI especially) compute svh/dvh against a viewport that
includes system UI the layout viewport doesn't have, so the immersive page
still scrolled in standalone mode. AppShell now measures window.innerHeight
into --app-height (refreshed on resize/visualViewport, covering the
minimize-restore stale-viewport Chrome bug and the keyboard), and the
immersive shell + chat size from var(--app-height, 100svh).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-11 08:48:57 +02:00
BOHA
d9cf8f53e8 chore(release): v2.4.19 - immersive mobile scroll lock
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-11 08:42:04 +02:00
BOHA
f509e24942 fix(odin): kill body scroll on immersive mobile (MIUI dvh quirk)
Xiaomi Chrome keeps 100dvh at the large-viewport size while the URL bar
overlays the page, so the shell's 100dvh min-height left the document one
bar-height taller than the screen (scrollable + a strip under the
composer). The immersive route now sizes the document to exactly 100svh
with hidden overflow down the chain — body scroll is impossible regardless
of the browser's dvh interpretation. Other routes unchanged.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-11 08:42:04 +02:00
4 changed files with 47 additions and 7 deletions

4
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{ {
"name": "app-ts", "name": "app-ts",
"version": "2.4.18", "version": "2.4.20",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "app-ts", "name": "app-ts",
"version": "2.4.18", "version": "2.4.20",
"license": "ISC", "license": "ISC",
"dependencies": { "dependencies": {
"@anthropic-ai/sdk": "^0.102.0", "@anthropic-ai/sdk": "^0.102.0",

View File

@@ -1,6 +1,6 @@
{ {
"name": "app-ts", "name": "app-ts",
"version": "2.4.18", "version": "2.4.20",
"description": "", "description": "",
"main": "dist/server.js", "main": "dist/server.js",
"scripts": { "scripts": {

View File

@@ -437,8 +437,13 @@ export default function OdinChat() {
// page never scrolls and the chat's message list scrolls internally. // page never scrolls and the chat's message list scrolls internally.
// Desktop: svh === vh. // Desktop: svh === vh.
// Mobile is immersive (AppShell hides its header and main padding on // Mobile is immersive (AppShell hides its header and main padding on
// /odin): the chat owns the whole viewport, full-bleed. // /odin): the chat owns the whole viewport, full-bleed. --app-height
height: { xs: "100svh", md: "calc(100svh - 100px)" }, // is AppShell's live window.innerHeight measurement — standalone-PWA
// viewports misreport svh/dvh (MIUI), only the measured value fits.
height: {
xs: "var(--app-height, 100svh)",
md: "calc(100svh - 100px)",
},
display: "flex", display: "flex",
// Longhand on purpose: a responsive `border` shorthand lands in a // Longhand on purpose: a responsive `border` shorthand lands in a
// media query AFTER borderColor and resets the color to black. // media query AFTER borderColor and resets the color to black.

View File

@@ -28,6 +28,27 @@ export default function AppShell() {
// button. Desktop keeps the normal shell. // button. Desktop keeps the normal shell.
const immersiveOnMobile = location.pathname === "/odin"; const immersiveOnMobile = location.pathname === "/odin";
// Installed-PWA (standalone) viewports lie to CSS units: on MIUI/Android
// svh/dvh are computed against a viewport that includes system UI the real
// layout viewport doesn't have, leaving scroll room no unit can remove
// (and Chrome can serve a stale viewport after minimize/restore). Measure
// the truth — window.innerHeight — into --app-height and keep it fresh;
// immersive layouts size from it with an svh fallback.
useEffect(() => {
if (!immersiveOnMobile) return;
const root = document.documentElement;
const set = () =>
root.style.setProperty("--app-height", `${window.innerHeight}px`);
set();
window.addEventListener("resize", set);
window.visualViewport?.addEventListener("resize", set);
return () => {
window.removeEventListener("resize", set);
window.visualViewport?.removeEventListener("resize", set);
root.style.removeProperty("--app-height");
};
}, [immersiveOnMobile]);
const handleLogout = useCallback(() => { const handleLogout = useCallback(() => {
setLoggingOut(true); setLoggingOut(true);
setMobileOpen(false); setMobileOpen(false);
@@ -79,13 +100,22 @@ export default function AppShell() {
duration: loggingOut ? 0.4 : 0.25, duration: loggingOut ? 0.4 : 0.25,
ease: [0.4, 0, 0.2, 1], ease: [0.4, 0, 0.2, 1],
}} }}
style={{ minHeight: "100dvh" }}
> >
<Box <Box
sx={{ sx={{
display: "flex", display: "flex",
minHeight: "100dvh",
bgcolor: "background.default", bgcolor: "background.default",
// Immersive mobile pages must make the DOCUMENT exactly the
// small-viewport height and clip it: MIUI/Xiaomi Chrome keeps
// 100dvh at the large-viewport size while the URL bar overlays,
// so a 100dvh min-height leaves the page scrollable by the bar
// height (invisible in desktop emulation). svh + hidden overflow
// makes body scroll impossible regardless of dvh interpretation.
minHeight: immersiveOnMobile ? { xs: 0, md: "100dvh" } : "100dvh",
...(immersiveOnMobile && {
height: { xs: "var(--app-height, 100svh)", md: "auto" },
overflow: { xs: "hidden", md: "visible" },
}),
}} }}
> >
<Drawer <Drawer
@@ -128,6 +158,7 @@ export default function AppShell() {
sx={{ sx={{
flex: 1, flex: 1,
minWidth: 0, minWidth: 0,
minHeight: 0,
display: "flex", display: "flex",
flexDirection: "column", flexDirection: "column",
}} }}
@@ -173,6 +204,10 @@ export default function AppShell() {
flex: 1, flex: 1,
px: immersiveOnMobile ? { xs: 0, md: 3 } : { xs: 2, md: 3 }, px: immersiveOnMobile ? { xs: 0, md: 3 } : { xs: 2, md: 3 },
pb: immersiveOnMobile ? { xs: 0, md: 4 } : 4, pb: immersiveOnMobile ? { xs: 0, md: 4 } : 4,
...(immersiveOnMobile && {
minHeight: 0,
overflow: { xs: "hidden", md: "visible" },
}),
}} }}
> >
<Outlet /> <Outlet />