Skip to content

fix(web): keep no page history in the app on an iPhone's Home Screen - #493

Merged
kalaspuff merged 4 commits into
mainfrom
fctl/1039-installed-app-history
Nov 9, 2026
Merged

kalaspuff merged 4 commits into
mainfrom
fctl/1039-installed-app-history

Conversation

@fctl-sh

@fctl-sh fctl-sh Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Summary

After #492, swipes from the screen's edges still went back and forward on an iPhone, in the app on the Home Screen and in Chrome: cancelling the touches that start at the edges doesn't stop them. WebKit starts that swipe whenever there is a page to go back or forward to, whatever the page does with the touch. So in the app on an iPhone's or iPad's Home Screen, which has no back button, each page now takes the place of the last in the browser's history instead of adding to it: the router's navigations, the app's own page loads (signing in or out, going to Linear) and links that load a page in the same window (signing in with Google, installing the GitHub App) alike. The swipes then have nowhere to go, and a finger at the left edge drags the sidebar in. Safari's and Chrome's tabs, the app on Android and a Mac's app in the Dock keep their history. #492's edge-touch handling and its overscroll-behavior-x rule go, since they didn't stop the swipe.

Unit tests cover when the app keeps no history, the router's history replacing rather than pushing there, the page loads and the links. With the Home Screen app stood in, in Playwright's Chromium and WebKit, opening pages through the sidebar left history.length as it was, with each page at its top, while in a tab each page added an entry; a plain link's full page load did the same in WebKit. cargo xtask check web passes. The getting-started guide now says the app on an iPhone's Home Screen doesn't go back on a swipe.

The design docs describe it in hyperstructure/design:

Worth confirming

  • Assumption: with no page to go back or forward to, iOS doesn't start the swipe in the app on the Home Screen, and the touch reaches the page, as WebKit's source says (ViewGestureController::canSwipeInDirection). Worth trying on your iPhone once it is deployed; close the app in the app switcher first, as the history it has now stays until it opens afresh.
  • Decision: iPads too, in the app on their Home Screen, which has no back button either. The app on Android keeps its history, which its back gesture and button go through.
  • Decision: another site's own pages, such as a consent screen you click through on the way back from signing in, still add to the history until the app opens afresh: the app can't keep them from it.
  • Decision: with feat(web): keep swipes from a phone's screen edges in the app #492's overscroll-behavior-x: none gone, Chrome's own swipe from the edge on Android goes back again in tabs, as tabs keep their swipes.

fctl session


Note

Low risk. It changes how links and page loads behave only in the app on an iPhone's or iPad's Home Screen, and leaves browsers and Android alone.

What it does. In the app on an iPhone's or iPad's Home Screen, each page now takes the place of the last in the browser's history, so iOS's edge swipes have nowhere to go and the sidebar drawer can be dragged in from the left edge. The router's push becomes replace, full page loads go through goTo (location.replace), and a document-level click handler in linksInPlace loads plain links in place, including links to a place on the same page, which keep the router's state. The touch-cancelling edge-swipe code from #492 is removed.

Edge-swipe code removed. edge-swipes.ts and its tests are deleted, since cancelling touches didn't stop iOS's swipe; the behavior now depends on iOS not starting a swipe when there is no history, which the description asks to confirm on a device.

fctl review's first look at 79c48d8 · 20 files, +302 −781 · Review agent settings

iOS's swipes from the screen's edges went back and forward in the app on
the Home Screen and in Chrome even though fctl#492 cancelled the touches
that start there: WebKit lets a page stop them only by leaving no page to
go back or forward to. In the app on an iPhone's or iPad's Home Screen,
which has no back button, each page now takes the place of the last in the
browser's history, the router's and the loads after signing in or out
alike, so the swipes have nowhere to go and the left edge drags the
sidebar in. Browsers' tabs, and the app on Android, keep their history.
The edge-touch handling of fctl#492, and its overscroll rule for Chrome,
go.
@fctl-review

This comment has been minimized.

Comment thread web/src/lib/history.ts Resolved
Signing in or linking with Google, going to Linear and installing the
GitHub App loaded their pages after the app's, leaving it in the history
for iOS's edge swipe to go back to. On an iPhone's or iPad's Home Screen,
links that load a page in the same window, and the app's own page loads,
now replace the page they leave.
@fctl-review

This comment has been minimized.

Comment thread web/src/lib/history.ts Resolved
…state

On an iPhone's or iPad's Home Screen, a link to a place on the same page
(#enrollment-tokens) loaded the page in place of itself, losing the
router's index and key. It now replaces the entry with its own state and
scrolls to the place, as the browser's jump would, without adding to the
history.
@fctl-review

This comment has been minimized.

Comment thread web/src/lib/history.ts Resolved
A link to #100% or #%E0%A4%A made decodeURIComponent throw after the URL
had changed. The place is now looked up by its name as written, then as
decoded where it decodes, as browsers do, and a malformed name scrolls
nowhere.
@kalaspuff
kalaspuff merged commit b017240 into main Nov 9, 2026
13 checks passed
@kalaspuff
kalaspuff deleted the fctl/1039-installed-app-history branch November 9, 2026 18:05
@fctl-sh

fctl-sh Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor Author

Merged, but not deployed yet: in main's CI run, every check passed and Deploy app.fctl.sh failed in 0 s without a runner or a log, before any step ran. That looks like a GitHub Actions hiccup, not this change. Re-running that run's failed job deploys it (the session's token isn't allowed to), and so does the next push to main. It's in no release yet (after v0.32.2).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant