fix(cli): score apple-touch-icon-precomposed at the 180px default - #3607
Merged
Conversation
declaredSize() matched the rel token "apple-touch-icon" exactly, so the legacy "apple-touch-icon-precomposed" spelling (one token, not two) fell through to 0 instead of the 180px Apple default, even though the selector already collects it. Same page, one spelling apart, opposite winner inside tier 1 — it never drops a candidate and never beats the .ico tier. Switch to a startsWith check on the token. Exact-token matching stays for mask-icon, where a longer rel really would be a different asset.
miguel-heygen
requested review from
james-russo-rames-d-jusso,
jerrai-bot-heygen and
jrusso1020
September 3, 2026 03:56
jerrai-bot-heygen
approved these changes
Sep 3, 2026
jerrai-bot-heygen
left a comment
There was a problem hiding this comment.
Reviewed at exact head 4f8f102b11388bd059e0bc6119a5a9c5b71428a4.
The token-safe prefix match correctly gives unsized apple-touch-icon-precomposed the same 180px default as apple-touch-icon, without changing exact mask-icon handling or the mask-last tier. The new A/B fixture fails with the prior exact-token logic and preserves the other ranking tiers.
Completed checks are green; remaining CI jobs are pending and no check is red.
— Jerrai
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
The favicon ranker's
declaredSize()matches the rel tokenapple-touch-iconexactly.
rel="apple-touch-icon-precomposed"is one token, not two, so itfell through to a score of 0 instead of the 180px Apple default — even though
the selector (
link[rel*="icon"]) already collects it. Same page, onespelling apart, opposite winner inside tier 1: it never drops a candidate and
never beats the
.icotier, so it only mis-orders within the middle tier.Fix:
startsWith("apple-touch-icon")on the token instead of an exact match.mask-iconkeeps its own exact-token check (isMaskIcon), where a longerrel really would be a different asset.
What I measured
Reverted the fix locally (exact-token match) and reran the new test:
With the fix restored:
bunx tsc --noEmitinpackages/cli: same three pre-existing errors on bothorigin/mainand this branch (missing generated runtime files, unrelated tothis change) — no new errors introduced.
What I did NOT exercise
page declaring
apple-touch-icon-precomposed). This is a pure ranking-unitchange; the download loop and page-evaluate extraction it feeds into are
untouched.
<link rel="manifest">icons anddata:URI hrefs, both called out aspre-existing gaps in the original PR's review and out of scope here.