Skip to content

phone: pair by pasting a link, fix the damaged-link toast and Back - #5

Open
Stener1 wants to merge 1 commit into
cosscom:mainfrom
Stener1:phone-pairing-fixes
Open

Stener1 wants to merge 1 commit into
cosscom:mainfrom
Stener1:phone-pairing-fixes

Conversation

@Stener1

@Stener1 Stener1 commented Oct 6, 2026

Copy link
Copy Markdown

Three fixes to the phone app, found pairing an iPhone (iOS 26, Safari and a Home Screen app) with two boxes.

A good pairing link said "That pairing link is damaged" and left a blank page. pairFromLink() runs at load and calls toast(), which reads toastTimer — declared with let further down, so it was still in its temporal dead zone. The ReferenceError landed in the catch, whose own toast() threw again, stopping the rest of app.js. The boxes were saved, so a reload showed them. toastTimer now sits with the other top-level state.

A Home Screen app could not be paired by link. iOS gives a Home Screen web app storage of its own, apart from Safari, so a link opened in Safari pairs Safari only — and the Home Screen app has no address bar to open the link in. The Pair screen (and Boxes, for adding one later) now has Or paste a pairing link: the same #pair= payload, read from pasted text. Parsing moved into pairFrom(text), used by both the fragment and the field; a link carrying no usable box now counts as damaged instead of toasting "Paired with undefined".

Back left the app. It called history.back() whenever history.length > 1, which in a browser tab steps out to whatever came before (the pasted link, the page that linked here). It now returns to the list, as the standalone app already did.

The phone guide mentions pasting into the Home Screen app.

Tested in a browser against the patched page (link in the fragment pairs with no error and clears the fragment; a pasted link pairs; Back returns to the list), then on an iPhone Home Screen app against two boxes running this build. go test ./internal/box -run Phone passes; node --check on app.js.

🤖 Generated with Claude Code

@vercel

vercel Bot commented Oct 6, 2026

Copy link
Copy Markdown

@Stener1 is attempting to deploy a commit to the seanbrydonio's projects Team on Vercel.

A member of the Team first needs to authorize it.

- A pairing link that worked showed "That pairing link is damaged" and
  stopped the page: toast() read toastTimer before its let ran (TDZ).
- A Home Screen app keeps its own storage and has no address bar, so a
  link opened in Safari never paired it. The Pair and Boxes screens take
  a pasted link.
- Back used history.back(), which left the app when the tab had other
  pages behind it; it now returns to the list.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LQ7gUBM8j8uAh3PWTFSYQa
@Stener1
Stener1 force-pushed the phone-pairing-fixes branch from 2595c48 to 5e7f59c Compare October 13, 2026 14:09

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