Skip to content

[experimental] cli: with no icon set, experimental icon names the discover search where it lists packs - #12725

Closed
josephfarina wants to merge 1 commit into
mainfrom
josephfarina/icon-no-set-finds-packs
Closed

josephfarina wants to merge 1 commit into
mainfrom
josephfarina/icon-no-set-finds-packs

Conversation

@josephfarina

Copy link
Copy Markdown
Contributor

With no icon set installed, astryx experimental icon now names astryx discover "icon set", but only where that search lists an icon pack the project could add; elsewhere the step is unchanged.

Before / after

astryx experimental icon close (and --list) in a project with no icon set installed, once a discover run has saved a catalog in which discover "icon set" lists an icon pack:

Before:

[next] Install a package that ships an icon set, then run `npx @astryxdesign/[email protected] experimental icon use <set>`. To make your own set, read `npx @astryxdesign/[email protected] docs cli/experimental/icon-sets`.

After:

[next] Find an icon pack with `npx @astryxdesign/[email protected] discover "icon set"`, install it, then run `npx @astryxdesign/[email protected] experimental icon use <set>`. To make your own set, read `npx @astryxdesign/[email protected] docs cli/experimental/icon-sets`.

Unchanged (the "Before" line): a project whose catalogs list no icon pack (including a project with no discover source of its own), a pack that discover "icon set" does not find (its text has neither word), a project that already has the pack (also under an alias), and any project before its first discover run.

Cold start: the finder reads only the catalog copies discover already saved and calls no discover source, so a project whose catalog lists packs gets the "Before" line until its first discover run.

JSON keeps its shape: data.next carries the same sentence with bare astryx … commands, and suggestions are unchanged. Text prints the commands with the run's own command stem, as before.

Tests

  • Written first: five cases in discover.icon-packs.test.mjs. The first (a project whose @acme catalog lists a pack, after a discover run, gets the discover sentence, and that search returns the pack's set) fails on main. The others keep the install step: a pack the search does not list (found by discover glyphs only), before any discover run, no discover source or a catalog with no icon set, and the pack already declared under an alias; each failed on an earlier, looser version.
  • icon.test.mjs is unchanged: its project has no catalog, so it keeps the install step.
  • CI=1 pnpm exec vitest run --project node packages/cli from the repo root: 18,647 passed, 19 failed. The same 19 fail on unchanged main on the same machine (theme editor build and picture checks that need tools the machine lacks); none touch this change.
  • pnpm typecheck in packages/cli: clean.
  • Cost: the added check takes about 20–36 ms on the first call in a run (module load and project scan included) and about 1 ms after; whole-run time of experimental icon close is within noise of main (611 → 620 ms, 599 → 602 ms).

User impact

People and agents with no icon set installed were told to install "a package that ships an icon set" with no way to find one, even where astryx discover "icon set" lists the packs a project could add (marked [experimental]). The step now names that search, but only where it lists a pack, so it never points at a search that finds none.

Expected behavior and authority

spec:AST-084 FR6/FR7: with no set installed, the finder and --list say how to get a set (next). FR17: discover lists the icon sets a project could add. No record changes: the records describe the next step generically.

Smallest restoration

Discover's own search function runs the query icon set over the saved discover catalogs (the same packages and items discover's saved-copy search reads, with the command's default limit) and answers whether it lists an icon set to add, so the sentence names a search only when that search lists a pack. The no-set sentence takes that answer. The text client prints the API's next sentence with the run's command stem instead of building the sentence again.

Scope

Components: cli (experimental icon next step; discover's saved-catalog read)

  • 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.

…ere it lists packs

With no icon set installed, the next step of `astryx experimental icon` and `--list` said to install a package that ships one but named no way to find it. Where discover's own search for "icon set", run over the catalog copies discover saved, lists an icon set the project could add, the step now names `astryx discover "icon set"` first; elsewhere, and before the first discover run, it reads as before. No discover source is called on this path. The JSON `next` field keeps its shape.
@vercel

vercel Bot commented Nov 18, 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 11:33pm UTC

Request Review

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

astracat-bot Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

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

@github-actions

Copy link
Copy Markdown
Contributor

PR Analysis Report

🔎 Preview · cf025d8

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

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


Generated by PR Enrichment workflow | View current CI run

@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec cf025d8

@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 finder and --list now name astryx discover "icon set" only where discover's saved catalogs list an icon pack the project could add; the new command tests cover each case, and an engineering owner's /approve-spec for this head covers the wording. Optional follow-up: with no set installed, the error for a named set (--set, <set>/<id>, use <set>) still says only to install a package that ships an icon set.

Claims and files checked

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

Claims:

  • With no set, the finder and --list name the discover search when discover lists a pack the project could add: verified (api/icon/search/search.mjs:75, api/icon/list/list.mjs:54, foundation/text/icon-set-next.mjs:34-36; new command test case 1).
  • The new sentence reads as the changeset and description show: verified (icon-set-next.mjs:33-36; case 1 checks JSON and --list text).
  • The finder reads only the catalog copies discover saved and calls no discover source: verified (api/discover/discover.mjs:208-232).
  • Before the first discover run, and where no catalog lists a pack, the step reads as before: verified (cases 3 and 4).
  • A pack the search does not find, and a pack the project already declares or aliases, keep the old step: verified (cases 2 and 5).
  • JSON next carries the same sentence with bare commands and an unchanged shape; suggestions are unchanged: verified (search.mjs:194, list.mjs:54; the named-set suggestions are untouched).
  • Text prints the commands with the run's own command stem, as before: verified (prefixCliCommands rewrites each inline command; the generic sentence prints exactly as on the base).
  • The check runs discover's own search with its default limit over the same saved inputs: verified (discover.mjs:244-256, DEFAULT_LIMIT at :55).
  • The text client prints the API's sentence instead of building it again: verified (clients/cli/commands/experimental/icon.mjs:235, :336).
  • The first new test fails on the base branch and the others keep the install step: verified (case 1 fails on the base, 12 pass).
  • The other new cases failed on an earlier, looser version: not verifiable from the branch history; not material.
  • The existing icon command test is unchanged and keeps the install step: verified (not in the diff; passes on this head).
  • The whole node test project and package typecheck results: not reproduced in full; the 59 targeted test files pass, and typecheck shows only two errors for an unbuilt theme package's output in untouched template pages, the same on the base.
  • The added cost (about 20-36 ms on the first call): not measured.
  • Released as an experimental patch: verified (changeset front matter and [experimental] prefix).
  • No new public API: verified (no command or option doc changes; the new helpers are internal).
  • No internal context in public text: verified.

Files:

  • .changeset/icon-no-set-finds-packs.md: clear.
  • packages/cli/api/discover/discover.mjs: clear (search's discover line keeps its icon-set filter and tests).
  • packages/cli/api/icon/_adapter.mjs: clear.
  • packages/cli/api/icon/list/list.mjs: clear.
  • packages/cli/api/icon/search/search.mjs: clear.
  • packages/cli/clients/cli/commands/discover.icon-packs.test.mjs: clear.
  • packages/cli/clients/cli/commands/experimental/icon.mjs: clear.
  • packages/cli/foundation/text/icon-set-next.mjs: clear.

Automated review (maintainer link)

josephfarina added a commit that referenced this pull request Nov 19, 2026
…names the discover search where it lists packs
josephfarina added a commit that referenced this pull request Nov 19, 2026
josephfarina added a commit that referenced this pull request Nov 19, 2026
- #12680 perf(cli): a template's component line resolves its names in one pass, not one full lookup per name
  Author: Joey <[email protected]>
- #12180 fix(core): Calendar weekday names widen their column instead of overlapping
  Author: Joey <[email protected]>
- #12159 feat(cli): make an icon set inside your own app
  Author: Joey Farina <[email protected]>
- #12383 fix(Grid): a responsive column shrinks to a container narrower than minWidth
  Author: Joey Farina <[email protected]>
- #12374 [fix] Icon: a glyph given as name renders and warns, instead of crashing
  Author: Joey Farina <[email protected]>
- #12453 fix(charts): line, area and band default to straight segments
  Author: josephfarina <[email protected]>
- #12296 fix(core): a neutral Badge in a primary or destructive Button meets 4.5:1 on its fill
  Author: Joey Farina <[email protected]>
- #12395 fix(CodeBlock): without a code string, CodeBlock names the prop and the fix in development
  Author: Joey Farina <[email protected]>
- #12260 fix(cli): `astryx component Flex` names Stack first
  Author: Joey Farina <[email protected]>
- #12391 fix(core): a two-lane Toolbar wraps instead of squeezing its start lane
  Author: Joey Farina <[email protected]>
- #12427 fix(core): checkbox and radio marks keep their share of the box a theme sizes
  Author: josephfarina <[email protected]>
- #12725 [experimental] cli: with no icon set, experimental icon names the discover search where it lists packs
  Author: Joey Farina <[email protected]>
@josephfarina

Copy link
Copy Markdown
Contributor Author

Landed in #12738.

@github-actions
github-actions Bot deleted the josephfarina/icon-no-set-finds-packs branch November 19, 2026 06:04

This branch was successfully deployed

1 active deployment
Preview — cf025d8d 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