Skip to content

Mobile layout: no text is cut, low-end mode skips the map, saved trips open from the menu - #74

Merged
davd-gzl merged 2 commits into
fix/historyfrom
fix/mobile-layout
Sep 29, 2026
Merged

davd-gzl merged 2 commits into
fix/historyfrom
fix/mobile-layout

Conversation

@davd-gzl

Copy link
Copy Markdown
Collaborator

5/10, medium

Four defects in how the app lays out on a phone and on a slow device. None changes a search result: each changes what a reader can see, what a low-end device downloads, or whether a screen can be reached at all.

Two small fixes ride along. In Arabic the sort menu's arrow sat on its label, so every control with a left or right side now uses the reading direction. The dark theme now tells the browser it is dark, so native controls follow it.

This sits on the history branch, #73, and merges after it. Every capture below is Chromium headless, main 5e514c5 on the left and this branch on the right.


Seven text rules: names end in an ellipsis

A via chip, the search bar, a leg name, a tour route and an airport name each ended in "…" once the text outgrew its box: .chip-via with a 14ch cap, .mc-route, .msearch-text and four more. Across 12 screens from 360 to 1366px, 197 strings were cut on phones and 130 on desktop. Each now wraps in full, and the search bar takes two balanced lines so a date is never split across them. npm run verify now fails on any cut text at 360, 390 and 1100px.

A connection's via chip, 390px wide.

before: the chip reads VIA MONTP… ; after: VIA MONTPELLIER ST-ROCH in full

The phone search bar on a long route, 390px wide.

before: St Pierre Des Corps → Aix-en-Provence … with the date gone; after: two lines ending in Thu, Oct 1

A connection's second leg, 360px wide.

before: Valence Tgv Auvergne Rhone Alp… ; after: the full name on two lines

A Multi-city leg header, 390px wide.

before: the badge alone on a line and the route cut at Auvergn… ; after: the badge beside the full route

A browse row for an airport station, 1100px wide.

before: Aeroport Roissy Cdg… ; after: Aeroport Roissy Cdg 2 Tgv in full beside its plane icon


prerender: low-end mode still downloads the map

The prerendered page was captured from the live app with the map on, so every visitor parsed Leaflet's markup and the map chunk's preload links. A phone in low-end mode, which never shows the map, fetched the map code, its stylesheet and a tile. The capture now runs with the map off.


Header menu: saved trips cannot be reached on a phone

Saved trips and favorites sit in the results drawer, which only the results screen shows on a phone, and the header menu had no entry for them. The menu now opens the saved page from any screen. A desktop already shows both cards in the results column, so the entry is phone-only.

The header menu, 390px wide.

before: language, GitHub, theme and share; after: a Saved trips & favorites row under the language


setupDrawer: the results sheet sizes itself from a hidden map

setupDrawer measured from the top of the map, which the form screen hides, so the first half-height sheet was 461px and the same sheet 420px after two taps. Fully raised, it covered the search bar. The sheet now measures from below the search bar and again whenever the bar appears or wraps, so it takes the same height every time and stops under the bar.

The results sheet fully raised, 390x844.

before: the sheet reaches the header and the search bar is gone; after: the sheet stops under the two-line search bar


Fonts: eight security-policy errors on every load

Vite inlines assets under 4 KB as data: URLs, which put the small font subsets inside the stylesheet, and the page's Content-Security-Policy allows fonts from its own origin only. Each load logged 8 blocked fonts. Fonts now always ship as files, so the policy stays as strict as it was and npm run verify fails on any policy error.

…s open from the menu

Via chips, the phone search bar, tour routes, leg names, airport names
and the date pill wrap in full instead of ending in an ellipsis; the
search bar takes two balanced lines and the map fit reserves its
height.

The prerendered page no longer carries the live map, so low-end mode
downloads no map code and no tile. Fonts ship as files, which clears
the 8 CSP errors every load logged.

The phone header menu opens the saved page, favorites included, from
the search form. The drawer measures its detents below the search bar,
so the first half detent matches later ones and the full one stops
under the bar; landing runs no view transition. Controls use logical
sides in Arabic, and the dark theme sets color-scheme to dark.

npm run verify now fails on CSP errors, map requests in low-end mode
and cut text at 360, 390 and 1100px.
# Conflicts:
#	docs/user-flows.md
@davd-gzl
davd-gzl merged commit 3055285 into fix/history Sep 29, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant