fix(native): one size class the keyboard cannot move, shortcuts that wait for sheets

From the large-screen review (code findings H1, M1, M2, M3, M4, M7, L1, L3, L4, L6, L7):

- The size class is one value in JavaScript (hooks/sizeClass.ts) and the
  stylesheet follows it: MobileShell writes it to the shell as data-size, the
  wide:/split: variants and mobile.css key on that instead of media queries of
  their own. A window that only grows shorter at the same width while a field
  has focus is Android's soft keyboard, not a new window, so the rail, the form
  sheets and the panes no longer fold away (and take the focused field with
  them) while one types.
- The large-screen layout is the app's only. In a browser the touch shell is
  the phone's below 768px and stays compact there, as before this branch.
- Shortcuts are the app's only, so a browser keeps Ctrl+1 and Alt+Left. The
  command key is the platform's own (Cmd on Apple, Ctrl elsewhere), digits are
  matched by the key's place as well (AZERTY), and nothing runs while a sheet
  or another modal dialog is open: the page listens to nothing and the app is
  handed no key commands, so Cmd+[ can no longer drop an unsaved form.
- Inside a trip Cmd+N belongs to the trip shell and creates what the tab on
  show creates, named after it.
- Inside the touch shell the desktop navbar of the few PageShell routes is
  hidden and --nav-h is 0.
- The rail comes before the page in the DOM, so a keyboard reaches it first.
- The phone's deep day colour for a journey card without a photo stays the
  phone's; the desktop and shared timelines keep their faint wash. Its card is
  opaque, a suggestion included, so the map's names do not read through.
- The trip widget's iPad mini layout keys on the iPad mini's width alone.
- The trip dock gets the scroll-edge strip and the denser dock glass the
  global dock has.
- Duplicate test id FE-MOB-PANES-016 renumbered.
This commit is contained in:
Maurice
2026-11-07 23:20:44 +01:00
parent 18a16d2aa2
commit 4dfccaa2a4
21 changed files with 701 additions and 185 deletions
+48 -26
View File
@@ -10,6 +10,9 @@
--m-bg: #F3F2EF;
--m-scr: radial-gradient(120% 80% at 50% -10%, #FBFAF7 0%, #F1EFEA 55%, #E9E7E1 100%);
--m-glass: rgba(255,255,255,.6);
/* The dock's glass: denser than --m-glass, so a photo scrolling under it
* neither turns it muddy nor washes out its icons. */
--m-dock: rgba(255,255,255,.8);
--m-gbr: rgba(255,255,255,.75);
--m-card: rgba(255,255,255,.55);
--m-cbr: rgba(255,255,255,.75);
@@ -58,17 +61,17 @@
--m-rail-w: 0px;
}
/* Wide size class (hooks/sizeClass.ts WIDE_QUERY): the rail on the leading
* edge takes the dock's place, so nothing docks at the bottom any more and
* content only clears the home indicator. */
@media (min-width: 600px) and (min-height: 501px) {
.m-root {
--bottom-nav-h: env(safe-area-inset-bottom, 0px);
--m-rail-w: calc(env(safe-area-inset-left, 0px) + 92px);
}
:root[dir='rtl'] .m-root {
--m-rail-w: calc(env(safe-area-inset-right, 0px) + 92px);
}
/* Wide size class (hooks/sizeClass.ts, written to the shell's root as
* data-size): the rail on the leading edge takes the dock's place, so nothing
* docks at the bottom any more and content only clears the home indicator.
* Asked from <html>, so a sheet's own .m-root (portalled, perhaps to body)
* reads the same values as the shell. */
html:has(.m-shell[data-size='wide'], .m-shell[data-size='split']) .m-root {
--bottom-nav-h: env(safe-area-inset-bottom, 0px);
--m-rail-w: calc(env(safe-area-inset-left, 0px) + 100px);
}
html[dir='rtl']:has(.m-shell[data-size='wide'], .m-shell[data-size='split']) .m-root {
--m-rail-w: calc(env(safe-area-inset-right, 0px) + 100px);
}
.dark .m-root {
@@ -78,6 +81,7 @@
--m-bg: #0A0A0C;
--m-scr: radial-gradient(120% 80% at 50% -10%, #17171C 0%, #0C0C0F 55%, #08080A 100%);
--m-glass: rgba(26,26,31,.6);
--m-dock: rgba(26,26,31,.82);
--m-gbr: rgba(255,255,255,.12);
--m-card: rgba(24,24,29,.55);
--m-cbr: rgba(255,255,255,.1);
@@ -171,15 +175,13 @@
/* A form sheet on a wide window sits mid-screen, so it rises from the bottom
edge of the window rather than from just below its own resting place. */
@media (min-width: 600px) and (min-height: 501px) {
@keyframes m-sheet-up {
from { transform: translateY(calc(50dvh + 50%)); }
to { transform: translateY(0); }
}
@keyframes m-sheet-down {
from { transform: translateY(0); }
to { transform: translateY(calc(50dvh + 50%)); }
}
@keyframes m-sheet-up-wide {
from { transform: translateY(calc(50dvh + 50%)); }
to { transform: translateY(0); }
}
@keyframes m-sheet-down-wide {
from { transform: translateY(0); }
to { transform: translateY(calc(50dvh + 50%)); }
}
.m-sheet-in { animation: m-sheet-in 260ms var(--ease-out-quint) both; }
.m-sheet-out { animation: m-sheet-out 220ms var(--ease-drawer) both; }
@@ -192,12 +194,14 @@
.m-pop-in { animation: m-pop-in 220ms var(--ease-out-quint) both; }
.m-toast-in { animation: m-toast-in 260ms var(--ease-out-quint) both; }
.m-toast-out { animation: m-toast-out 220ms ease both; }
@media (min-width: 600px) and (min-height: 501px) {
.m-panel-in { animation: m-panel-in 320ms var(--ease-out-quint) both; }
[dir='rtl'] .m-panel-in { animation-name: m-panel-in-rtl; }
@media (prefers-reduced-motion: reduce) {
.m-panel-in, [dir='rtl'] .m-panel-in { animation: m-fade-in 120ms ease-out both; }
}
@media (prefers-reduced-motion: no-preference) {
html:has(.m-shell[data-size='wide'], .m-shell[data-size='split']) .m-sheet-up { animation-name: m-sheet-up-wide; }
html:has(.m-shell[data-size='wide'], .m-shell[data-size='split']) .m-sheet-down { animation-name: m-sheet-down-wide; }
}
html:has(.m-shell[data-size='wide'], .m-shell[data-size='split']) .m-panel-in { animation: m-panel-in 320ms var(--ease-out-quint) both; }
html[dir='rtl']:has(.m-shell[data-size='wide'], .m-shell[data-size='split']) .m-panel-in { animation-name: m-panel-in-rtl; }
@media (prefers-reduced-motion: reduce) {
html:has(.m-shell[data-size='wide'], .m-shell[data-size='split']) .m-panel-in { animation: m-fade-in 120ms ease-out both; }
}
/* Reduced motion: gentler, not zero (same rule the desktop keyframes follow). */
@@ -631,6 +635,17 @@ html:has(.m-shell) body {
overflow-x: clip;
background-color: transparent;
}
/* The few routes without a phone screen of their own (a plugin's page, help,
a trip's files) still render through PageShell. Inside the touch shell its
desktop navbar, shown from 768px up, would stand over the rail and repeat the
navigation, and --nav-h would keep 64px of room for it: the shell has its own
navigation, so neither is there. */
html:has(.m-shell) {
--nav-h: 0px;
}
html:has(.m-shell) [data-desktop-navbar] {
display: none;
}
html:has(.m-shell) .leaflet-control-zoom {
display: none !important;
}
@@ -652,6 +667,13 @@ html:has(.m-shell) ::-webkit-scrollbar {
margin-inline-start: var(--trip-map-inset, 0px);
}
/* The strip under a floating dock (components/MDockScrim.tsx): solid across
the gap below the dock, clear from about its middle up. */
.m-dock-scrim {
-webkit-mask-image: linear-gradient(to top, #000 calc(env(safe-area-inset-bottom, 0px) + 12px), transparent calc(env(safe-area-inset-bottom, 0px) + 40px));
mask-image: linear-gradient(to top, #000 calc(env(safe-area-inset-bottom, 0px) + 12px), transparent calc(env(safe-area-inset-bottom, 0px) + 40px));
}
/* A horizontal strip with more behind an edge fades out there
(components/useEdgeFade.ts), so a cut chip reads as "the row goes on". */
.m-fade-s,