Skip to content

fix(cli): equally scored icons put first one whose id the query names in full - #12205

Closed
josephfarina wants to merge 1 commit into
mainfrom
josephfarina/icon-tie-order
Closed

josephfarina wants to merge 1 commit into
mainfrom
josephfarina/icon-tie-order

Conversation

@josephfarina

@josephfarina josephfarina commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Record change: spec:AST-084 FR6 adds one tie rule: within a set, among equal scores, an icon whose id the query names in full comes first, and id order still decides the rest.
Checks: the icon tests and the icon-set checks pass locally; on a fixed set of agent-style requests across four published icon sets, right first answers rise in every set and none are lost.

User impact

When several icons tie at one score, astryx experimental icon orders them by id. For a request whose words fit a plain icon and its variants equally, the variant whose id sorts first wins: with a published set chosen, plus add icon gets folder-plus before plus, and up down arrow icons gets arrow-down-up-across-line before arrows-up-down.

Problem and solution fit

Id order is arbitrary for the reader. Among tied icons, one whose id the query names in full (every word of the id is a query word, or its plural or singular) is the direct answer, and a variant adds words the request never asked for. This PR puts such an icon first within a tie and keeps id order for the rest.

Expected behavior and authority

docs/specs/AST-084-icon-sets/spec.md FR6 owns the order of equal scores. This PR adds the rule to that sentence: after set order, the name/meaning rank and the tag position, an icon whose id the query names in full, then id order.

Smallest restoration

One sort key in the finder's ranking, before id order: whether the query names every word of the icon's id. Nothing else moves: scores, matches and which icons answer stay the same.

Evidence

  • Reproduction before the change: in a set with folder-plus and plus, both tagged add, the query plus add answers folder-plus first.
  • Result after the change: plus first, then folder-plus.
  • Representative unchanged path: when no tied id is named in full (arrow against a-arrow-down and arrow-down), ties keep id order.
  • On a fixed set of agent-style icon requests across four published icon sets, only tie order moves; no request lost a right first icon, and more gained one in every set, including requests never used to tune the ranking. In a project with no icon set, the definitions answer follows the same tie rule (for justify align, alignJustify now comes before alignEnd); on the request set, no definitions answer changed.
  • Rejected: ordering ties by how many id words the query leaves unnamed. It also moved some answers onto narrower icons (a generic status request onto one brand's status icon; a help-circle request onto info ahead of the circled question mark), which blind judges called clear misses.
  • Regression test in packages/cli/api/icon/icon.test.mjs.

Scope

Components: cli (foundation/discovery/icon-ranking.mjs, api/icon/icon.doc.mjs), AST-084 FR6

  • One defect is restored.
  • Separable contradictory or unsettled tagalongs were removed or split.
  • No new public API, visual representation, default, or interaction model is hidden under the bug-fix label.
  • Public text and artifacts contain no internal Meta context.

Testing

  • npx vitest run --project node packages/cli/api/icon/icon.test.mjs packages/cli/foundation/discovery/icon-set-checks.test.mjs packages/cli/foundation/discovery/template-icons.test.mjs packages/cli/api/icon/search/icon-index.test.mjs

Writing rubric results

R1 narration: none; the FR6 clause states the order in the present tense.
R2 research: none in the record; the measurement stays in this description.
R3 evidence: no evidence, basis, or verification cell changed.
R4 rejected alternatives: none added to the record.
R5 change references: none.
R6 open questions: none touched.
R7 project status: none.

@vercel

vercel Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
astryx Ready Ready Preview Nov 18, 2026 5:15pm UTC

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Nov 17, 2026
@astracat-bot

astracat-bot Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Nov 18, 2026, 5:24 PM UTC

@github-actions github-actions Bot added the needs:spec-owner-review Current knowledge records await owner approval label Nov 17, 2026

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approval waits on an engineering owner's decision about the spec:AST-084 FR6 changes, and two fixes are needed after that decision.

Owner decision: current FR6 ends remaining ties with "then by id", and this head rewrites FR6 to put first an icon whose id the query names in full, beside FR6 text carried from #12138 for score-20 word matches and for reading export-name words. An engineering owner records the decision by commenting /approve-spec <full head SHA> on this pull request (the author may do so as an engineering owner), or says which parts should change.

Blocking findings:

  • .changeset/icon-search-words.md says "A query that already had an answer keeps it," but export-name reading changes answered queries (in a two-icon set, icon ArrowUp moves from arrowup-box to arrow-up), and #12138's current head already replaced that line with "Word matches appear only where nothing answered before."
  • The word-match sort at icon-ranking.mjs:550 orders equal weights by id parts minus carried words, not by "fewer id parts the query does not name" as the proposed FR6 and the module header say, so bolt-lock-shut leads lock-open-wide for lock open button; count the unnamed id parts or reword the clause.

Both findings come with the #12138 commits on this branch, and rebasing onto #12138's current head fixes the first.

Claims and files checked

Review mode: full; reason: no-earlier-review

Claims:

  • Tied icons are ordered by id today, so plus add puts folder-plus first: verified (the new test fails on #12187's head).
  • Among tied icons, one whose id the query names in full now comes first, then id order: verified (icon-ranking.mjs:669, :679, :692-697; icon.test.mjs:83).
  • FR6 owns tie order and gains the rule: verified (spec.md:222-224); not yet approved.
  • One sort key, with scores, matches and answering icons unchanged: verified for this pull request's own commit; the branch as a whole also carries #12138's new answers.
  • With no id named in full, ties keep id order: verified (arrow case).
  • Bug-fix label and "one defect is restored": not a restoration, since the base already follows current FR6's "then by id"; held for the owner decision.
  • No new public API: verified (icon() signature and match fields unchanged).
  • Measurements over four published icon sets and the rejected alternative: not verifiable from the repository.
  • Regression test in icon.test.mjs: verified.
  • Testing command: passes at this head (144 tests); icon-index.test.mjs exists only on main.
  • No internal context in public text: verified.
  • Speed changeset, answers unchanged: verified by the passing suites; speed not measured.
  • Search-words changeset, score-20 word matches, rarest words first, mapped definition words counted twice, export names read as words: verified by tests; "a query that already had an answer keeps it": false (finding above).
  • Tie-order changeset, plus before folder-plus and other ties in id order: verified.

Files:

  • .changeset/icon-finder-speed.md: clear
  • .changeset/icon-search-words.md: finding (false claim)
  • .changeset/icon-tie-order.md: clear
  • docs/specs/AST-084-icon-sets/spec.md: owner decision needed; word-match clause differs from the code
  • packages/cli/api/icon/icon.doc.mjs: clear
  • packages/cli/api/icon/icon.test.mjs: clear
  • packages/cli/foundation/discovery/icon-ranking.mjs: finding (word-match tie key)

Automated review (maintainer link)

Comment thread .changeset/icon-search-words.md Resolved
@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

🔎 Preview · a3f7102

⏳ Building… Until it's ready, Storybook · Sandbox open the branch's previous preview.

Current run: The current CI run concluded skipped. Current analysis is unavailable.


Generated by PR Enrichment workflow | View current CI run

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approval waits on an engineering owner's decision about the new spec:AST-084 FR6 tie rule in #12205, which also needs one description fix.

#12138: approve. Its FR6 additions for word matches and export-name reading carry an engineering owner's /approve-spec for its head, and its changeset and description claims hold.

#12187: approve. Its answers match #12138's head exactly, and ranking is faster.

#12205: changes requested. Current FR6 ends ties with "then by id", and this pull request rewrites it to put first an icon whose id the query names in full; an engineering owner records the decision by commenting /approve-spec <full head SHA> on #12205 (the author may do so as an engineering owner), or says how the rule should change, including whether an id that repeats a query word, such as check-check for check, counts as named in full.

  • Miss: the description says the definitions answer in a project with no icon set is unchanged, but that answer goes through the same tie key, so justify align now lists alignJustify before alignEnd; reword that line.

Whole stack: passes, with CI still running on this head; a pull request in this stack lands only when it and every pull request below it are approved.

Claims and files checked

Review mode: full; reason: rebase

Claims:

  • #12205: tied icons were ordered by id, so plus add put folder-plus first: verified (the new test fails on #12187's head).
  • #12205: an icon whose id the query names in full now leads a tie, then id order, with the arrow case unchanged: verified (icon-ranking.mjs:697, :707, :720; icon.test.mjs).
  • #12205: only tie order moves, never scores or which icons answer: verified over 6,040 queries on two open-source icon libraries.
  • #12205: the no-set definitions answer is unchanged: false (finding above).
  • #12205: bug-fix framing and "one defect is restored": the base already follows current FR6's id order, so this is the FR6 change awaiting the owner decision, not a restoration.
  • #12205: measurements over four published icon sets and the rejected alternative: not reproducible from the repository.
  • #12205: regression test, testing command, no new public API, no internal context: verified.
  • #12205 changeset: plus before folder-plus, remaining ties in id order: verified.
  • #12187: ranking answers unchanged against #12138's head: verified (same answers for every query, with and without word matches and with no set installed).
  • #12187 changeset: faster ranking: verified (warm time on a large set drops about 3 to 6 times); the rankIconIndex() note is accurate but its advice is incomplete (non-blocking above).
  • #12138: phrases nothing answered now return score-20 word matches ranked by rare words, with mapped definition words counted twice: verified by tests and code.
  • #12138: export names read as their words, the typed reading winning a tie: verified (SearchIcon, Bars3Icon, PaperClip icon tests).
  • #12138: word matches only in the search answer, never in missing-id suggestions or icon add's definitions: verified (those callers do not ask for them).
  • #12138 changeset: an answered query changes only when the split reading scores higher: verified.

Files:

  • .changeset/icon-finder-speed.md: clear (non-blocking wording note)
  • .changeset/icon-search-words.md: clear
  • .changeset/icon-tie-order.md: clear
  • docs/specs/AST-084-icon-sets/spec.md: #12138 text owner-approved; #12205 tie clause awaits an owner decision
  • packages/cli/api/icon/icon.doc.mjs: clear
  • packages/cli/api/icon/icon.test.mjs: clear
  • packages/cli/api/icon/rankIconIndex.doc.mjs: clear (non-blocking wording note)
  • packages/cli/api/icon/search/search.mjs: clear
  • packages/cli/foundation/discovery/icon-ranking.mjs: clear; its tie key drives the description finding
  • packages/cli/foundation/discovery/icon-set-writer.mjs: clear
  • packages/cli/foundation/text/icon-id.mjs: clear

Automated review (maintainer link)

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approval waits on an engineering owner's decision about the new spec:AST-084 FR6 tie rule in #12205, which also needs one description fix.

#12187: approve, pending CI. Every answer stays the same on the icon libraries checked, and a search that needs several passes is faster.

#12205: changes requested. Current FR6 ends equal scores with "then by id", and this pull request adds a key before it that puts first an icon whose id the query names in full; an engineering owner records the decision by commenting /approve-spec <full head SHA> on #12205 (the author may do so as an engineering owner), or says how the rule should change, including whether an id that repeats a query word, such as check-check for check, counts as named in full.

  • The description says the definitions answer in a project with no icon set is unchanged, but that answer goes through the same tie key, so justify align now lists alignJustify before alignEnd; reword that line.

Whole stack: passes, with CI still running on this head; a pull request in this stack lands only when it and every pull request below it are approved.

Claims and files checked

Review mode: full; reason: rebase

Claims:

  • #12187 changeset: each search works out every set's words once and each query's forms once per pass: verified (icon-ranking.mjs:498-517, :653-672, :682).
  • #12187 changeset and description: answers are unchanged: verified (every ranking checked on two open-source icon libraries and the Astryx definitions matches the base).
  • #12187 description: a query of several words takes up to four passes, each rebuilding every icon's words: verified in the base's rankIcons() and rankTerm().
  • #12187 description: each search starts afresh, so an edited set answers from its new data: verified (icon-ranking.mjs:500; icon.test.mjs:768-779).
  • #12187 description: matchIcon() keeps its signature and the one matcher: verified (icon-ranking.mjs:149-151).
  • #12187 description: timings on four published sets: direction corroborated (a several-pass search on a 2,295-icon library drops from about 18 to 15 ms); the exact figures were not reproduced.
  • #12187 description: no public API, product behavior or policy change, and its testing command: verified (the listed test files pass).
  • #12205: tied icons were ordered by id, so plus add put folder-plus first: verified (the new test fails on #12187's head).
  • #12205: an icon whose id the query names in full now leads a tie, then id order, with the arrow case unchanged: verified (icon-ranking.mjs:703, :713, :726-731; icon.test.mjs:83-113).
  • #12205: only tie order moves, never scores or which icons answer: verified over every ranking checked.
  • #12205: the definitions answer in a project with no icon set is unchanged: false (finding above).
  • #12205: bug-fix framing and "one defect is restored": the base follows current FR6's id order, so this is the FR6 change awaiting the owner decision, not a restoration.
  • #12205: measurements over four published icon sets, blind judging and the rejected alternative: not reproducible from the repository.
  • #12205: regression test, testing command, no new public API, no internal context and the writing rubric results: verified.
  • #12205 changeset: plus before folder-plus, remaining ties in id order: verified.

Files:

  • .changeset/icon-finder-speed.md: clear
  • .changeset/icon-tie-order.md: clear
  • docs/specs/AST-084-icon-sets/spec.md: tie clause awaits an engineering owner's decision
  • packages/cli/api/icon/icon.doc.mjs: clear (matches the proposed FR6)
  • packages/cli/api/icon/icon.test.mjs: clear
  • packages/cli/foundation/discovery/icon-ranking.mjs: clear; its tie key drives the description finding

Automated review (maintainer link)

@josephfarina
josephfarina marked this pull request as draft November 17, 2026 17:02
@josephfarina
josephfarina force-pushed the josephfarina/icon-tie-order branch from 2f120de to a3f7102 Compare November 18, 2026 17:02
@josephfarina
josephfarina marked this pull request as ready for review November 18, 2026 17:02
@josephfarina

Copy link
Copy Markdown
Contributor Author

Owner decision (engineering owner, covering this pull request): within equal scores, an icon whose id the query names in full leads; a repeated id word counts, so check names check-check in full. The answer for a query with no icon set chosen follows the same rule. spec:AST-084 FR6 states this.

@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec a3f7102

@github-actions github-actions Bot removed the needs:spec-owner-review Current knowledge records await owner approval label Nov 18, 2026

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved pending CI: CI has not run on this head yet.

The new tie rule in spec:AST-084 FR6 is approved by an engineering owner for this head, and the code, the icon() doc, the changeset and the test match it. The new test fails on the base and passes here, and comparing the base and head ranking over the lucide and heroicons ids changes only the order of equally scored icons, never which icons answer or their scores. The description's claim about the no-set definitions answer now matches the head.

Claims and files checked

Review mode: full; reason: rebase

  • Claims:
    • The FR6 record change adds one tie rule and keeps id order for the rest: verified (spec.md:262-264, icon-ranking.mjs:757-765).
    • The icon tests and the icon-set checks pass: verified (158 tests in the four listed files).
    • Before the change, plus add answers folder-plus before plus, and arrow-down-up-lock sorts before arrows-up-down: verified (the new test fails on the base at icon.test.mjs:100).
    • After the change plus leads, a plural id word counts as named, and ties with no fully named id keep id order: verified (icon.test.mjs:83-113).
    • Only tie order moves; scores, matches and which icons answer stay the same: verified (base-to-head ranking comparison).
    • With no icon set, the definitions answer follows the same rule (justify align lists alignJustify first): verified (command run on base and head).
    • The measurement over agent-style requests in four published icon sets: not checkable from the repository; not relied on.
    • One change, no tagalongs and no new public API: verified.
    • The changeset: a tie goes to the icon the query names in full, and remaining ties keep id order: verified.
  • Files:
    • .changeset/icon-tie-order.md: clear
    • docs/specs/AST-084-icon-sets/spec.md: clear
    • packages/cli/api/icon/icon.doc.mjs: clear
    • packages/cli/api/icon/icon.test.mjs: clear
    • packages/cli/foundation/discovery/icon-ranking.mjs: clear

Automated review (maintainer link)

josephfarina added a commit that referenced this pull request Nov 19, 2026
- #12072 fix(templates): payment form and checkout wrap the summary below the form on a narrow first paint
  Author: Joey Farina <[email protected]>
- #12274 fix(core): cap the Selector family's trigger-width list minimum at the viewport
  Author: josephfarina <[email protected]>
- #12215 fix(cli): advise keeping one dependency when two packages declare one provider ID
  Author: Joey <[email protected]>
- #12322 [experimental] export --reverse: use the project's own copy of an aliased file, or restore the page's copy with its paths entry
  Author: josephfarina <[email protected]>
- #12403 docs(core): Text's as and PowerSearch's statusVariant list every value their types allow
  Author: Joey Farina <[email protected]>
- #12494 fix(templates): dashboard templates use page sections, not cards, for page regions
  Author: Joey Farina <[email protected]>
- #12282 fix(cli): theme build --check and doctor ignore which CLI release, and which command name, built a theme
  Author: Joey Farina <[email protected]>
- #12420 fix(Chat): ChatToolCalls and ChatDictationButton without a required prop name it and the fix in development
  Author: Joey Farina <[email protected]>
- #12205 fix(cli): equally scored icons put first one whose id the query names in full
  Author: Joey Farina <[email protected]>
- #12455 fix(core): a theme sets the room between a checkbox or a switch and its label
  Author: josephfarina <[email protected]>
- #12658 perf(cli): the first theme build after a CLI upgrade reuses the JavaScript it compiled from a theme's local modules
  Author: Joey <[email protected]>
- #12323 [experimental] export: React logs no render timings while the export draws a page
  Author: Joey Farina <[email protected]>
@josephfarina

Copy link
Copy Markdown
Contributor Author

Landed in #12713.

@github-actions
github-actions Bot deleted the josephfarina/icon-tie-order branch November 19, 2026 06:05

This branch was successfully deployed

1 active deployment
Preview — a3f71024 Deployed Nov 18, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant