Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
27b734f6d0 | ||
|
|
91072548d4 | ||
|
|
5b380863cf | ||
|
|
1293da7f25 |
4
package-lock.json
generated
4
package-lock.json
generated
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "app-ts",
|
"name": "app-ts",
|
||||||
"version": "2.4.19",
|
"version": "2.4.21",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "app-ts",
|
"name": "app-ts",
|
||||||
"version": "2.4.19",
|
"version": "2.4.21",
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@anthropic-ai/sdk": "^0.102.0",
|
"@anthropic-ai/sdk": "^0.102.0",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "app-ts",
|
"name": "app-ts",
|
||||||
"version": "2.4.19",
|
"version": "2.4.21",
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "dist/server.js",
|
"main": "dist/server.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
@@ -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.
|
||||||
|
|||||||
@@ -28,6 +28,36 @@ 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);
|
||||||
|
// Kill pull-to-refresh: a PTR reload lands mid-viewport-settle and
|
||||||
|
// re-races the measurement (Chromium settles without a resize event).
|
||||||
|
// The immersive page is fixed-viewport — the gesture has no use here.
|
||||||
|
const prevRootOverscroll = root.style.overscrollBehaviorY;
|
||||||
|
const prevBodyOverscroll = document.body.style.overscrollBehaviorY;
|
||||||
|
root.style.overscrollBehaviorY = "none";
|
||||||
|
document.body.style.overscrollBehaviorY = "none";
|
||||||
|
return () => {
|
||||||
|
window.removeEventListener("resize", set);
|
||||||
|
window.visualViewport?.removeEventListener("resize", set);
|
||||||
|
root.style.removeProperty("--app-height");
|
||||||
|
root.style.overscrollBehaviorY = prevRootOverscroll;
|
||||||
|
document.body.style.overscrollBehaviorY = prevBodyOverscroll;
|
||||||
|
};
|
||||||
|
}, [immersiveOnMobile]);
|
||||||
|
|
||||||
const handleLogout = useCallback(() => {
|
const handleLogout = useCallback(() => {
|
||||||
setLoggingOut(true);
|
setLoggingOut(true);
|
||||||
setMobileOpen(false);
|
setMobileOpen(false);
|
||||||
@@ -92,7 +122,7 @@ export default function AppShell() {
|
|||||||
// makes body scroll impossible regardless of dvh interpretation.
|
// makes body scroll impossible regardless of dvh interpretation.
|
||||||
minHeight: immersiveOnMobile ? { xs: 0, md: "100dvh" } : "100dvh",
|
minHeight: immersiveOnMobile ? { xs: 0, md: "100dvh" } : "100dvh",
|
||||||
...(immersiveOnMobile && {
|
...(immersiveOnMobile && {
|
||||||
height: { xs: "100svh", md: "auto" },
|
height: { xs: "var(--app-height, 100svh)", md: "auto" },
|
||||||
overflow: { xs: "hidden", md: "visible" },
|
overflow: { xs: "hidden", md: "visible" },
|
||||||
}),
|
}),
|
||||||
}}
|
}}
|
||||||
|
|||||||
Reference in New Issue
Block a user