Skip to content

History: Back and Forward land on the page the user left - #73

Open
davd-gzl wants to merge 3 commits into
fix/calendar-truthfrom
fix/history
Open

davd-gzl wants to merge 3 commits into
fix/calendar-truthfrom
fix/history

Conversation

@davd-gzl

@davd-gzl davd-gzl commented Sep 29, 2026 •

Copy link
Copy Markdown
Collaborator

6/10, medium

Problem

Back and Forward can land on a page the user never saw. Search Paris to Lyon, switch to Ideas, press Back twice: the home page comes back on the Ideas tab with Lyon gone, and on a desktop it shows the whole Paris list under a bare URL. Forward onto the saved trips page shows the list beneath it, and Back with a train dialog open returns to the form with the dialog still over it.

Every capture here is Chromium headless at 390px wide unless it names another width, main 5e514c5 on the left and this branch on the right. Each caption names the keys pressed. Search Paris to Lyon, switch to Ideas, Back twice.

before: the Ideas tab with only Paris; after: the Trip tab with Paris and Lyon

The same keys at 1366px, landing on the bare URL.

before: the Ideas form over All destinations from Paris, 187 rows; after: the Trip form waiting for Search

Save a Paris to Lyon train, See all, Back, Forward.

before: the train list; after: the Saved trips page

Open a connecting train's booking dialog, then Back.

before: the dialog still over the form; after: the dialog closed and the results shown

Every history entry restored one shared form: formSnapshot overwrote lastBuiltForm on each call, and the Back handler restored and ran it whenever the URL had nothing to search. The saved page pushed the list's own URL with nothing marking it, and a dialog had no entry at all.

Fix

Each entry now carries its own form, tab and list position, and a bare URL shows the form waiting for Search, never results. The saved page and an open dialog each get an entry, so Back closes the dialog first and Forward reopens the saved page.

Scroll the Paris list to La Rochelle, open it, Back.

before: the list back at its top; after: La Rochelle still at the top

Three smaller defects ride along. "See all dates" in the trip dialog now opens both calendars in place instead of rerunning the same screen as a new entry. An empty Search adds no entry and says a departure is needed. A tab switch no longer moves focus into the empty field, which had swallowed the 1, 2 and 3 shortcuts.

A refinement made on the home page, a toggle or the nights stepper, still pushes one entry, and Back to home restores the form as that entry last left it rather than as first loaded.

Each history entry now restores its own form and tab. The bare landing
URL never shows results; Back to it restores the form as it was left
and asks for Search, keeping a build made on the entry a refinement
pushed off it. The saved-trips page has its own restorable entry, and
Back restores the list's scroll after a drill-in.

An open dialog owns one history entry: Back closes it, and closing it
by its button pops that entry. "See all dates" opens both calendars
in place, an empty Search adds no entry and shows a hint, the tab
shortcuts no longer pull focus into an empty field, and a favorite
opened from a tour page drops the tour's cities from the URL.
…s open from the menu (#74)

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.

This branch has not been deployed

No deployments
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