Skip to content

Remove a favourite by pointing at its tile - #85

Merged
PatrickSt1991 merged 1 commit into
mainfrom
fix/remove-favourite-from-tile
Sep 6, 2026
Merged

PatrickSt1991 merged 1 commit into
mainfrom
fix/remove-favourite-from-tile

Conversation

@PatrickSt1991

Copy link
Copy Markdown
Contributor

His report on build-42ed14f: two tiles both reading instagram.com, both kept by typing, opening different pages, and no way to remove either — "removing instagram.com or instagram.com/reels didn't removed them, reopening also didn't helped and pressing 8 always say open a page first".

That message was mine, from an hour earlier. It was correct, and it was useless advice.

The hole

It had been there since favourites existed, and only keeping an address by typing it made it reachable: removal required knowing the string. Being on the page and pressing 8 worked because the engine handed us the exact address. Anything else meant typing it back — and what the start screen shows is a host with the www. stripped plus a title, neither of which is what the favourite is stored as. Two kept addresses on one site therefore render as the same two lines, and the thing you would have to type is nowhere on the screen.

Adding was one press. Removing was a guess.

Three changes, and the first is the one that matters

  • 8 on the start screen removes the tile the pointer is on. PageScript.linkAt() climbs from the hit-test to the nearest anchor and returns its href — for a tile that is the stored address exactly, because HomePage wrote it there. Pointing at the thing you want gone is the one gesture that cannot be spelled wrong, and the pointer already knew how to hit-test; the whole addition is fifteen lines of script and a bridge message. A recent tile gets kept instead, which is the same key doing what it does everywhere else.
  • A kept address is named by its address. It was named by SiteRules.KeyFor — the bare host — which is exactly why his two tiles read identically. Urls.Readable drops the scheme and a trailing slash and keeps the rest.
  • SameKey folds a leading www. as well as the trailing slash: the two parts of an address a person neither sees nor types. Without it, typing back exactly what the tile shows still missed the favourite that tile names.

The rule this leaves behind, in INTERNALS: anything the app will act on by name must be displayed under that name, or be reachable without one. Favourites were neither.

Checks

  • linkAt verified in desktop chromium against a page carrying his exact case — two look-alike tiles differing only in path, plus a non-link. Returns https://www.instagram.com/reel, https://www.instagram.com/reels, and "".
  • tools/cdpharness/run.sh — green. Required: PageScript changed, and a syntax error there kills the pointer on every build.
  • tools/startpage/run.sh — the www. fold, that it is only a whole label at the front of the host, and that /reel is still not /reels. Green.
  • tools/siterules/run.sh green; ./build.sh all five packages, 0 warnings.

Issue 80's reporter, on build-42ed14f: two tiles both reading instagram.com,
both kept by typing, opening different pages, and no way to get rid of either —
"removing instagram.com or instagram.com/reels didn't removed them, reopening
also didn't helped and pressing 8 always say open a page first".

The message he hit was mine, from an hour earlier, and it was correct and useless
advice. The hole behind it had been there since favourites existed and only
keeping an address by typing it made it reachable: removal required knowing the
string. Being on the page and pressing 8 worked because the engine handed us the
exact address; anything else meant typing it back. And the start screen shows a
host with the www. stripped, plus a title — neither of which is what the
favourite is stored as. Two kept addresses on one site render as the same two
lines, and the thing you would have to type is nowhere on the screen.

So 8 on the start screen now removes the tile the pointer is on.
PageScript.linkAt() climbs from the hit-test to the nearest anchor and returns
its href, which for a tile is the stored address exactly, because HomePage wrote
it there. Pointing at the thing you want gone cannot be spelled wrong, and the
pointer already knew how to hit-test. A recent tile gets kept instead, which is
the same key doing what it does everywhere else.

Two supporting changes. A kept address is named by its address (Urls.Readable)
rather than by the bare host, which is why his two tiles read identically. And
SameKey folds a leading www. as well as the trailing slash — the two parts of an
address a person neither sees nor types — so typing back exactly what the tile
shows finds the favourite it names.

linkAt verified in desktop chromium against two look-alike tiles and a non-link;
cdpharness re-run for the frame path; startpage covers the www. fold and its
limits.
@PatrickSt1991
PatrickSt1991 merged commit a77a661 into main Sep 6, 2026
7 checks passed
@PatrickSt1991
PatrickSt1991 deleted the fix/remove-favourite-from-tile branch September 6, 2026 14:28
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