Distinguish Font Awesome quick picks from full-set resolution in comments (task e2fc2dbc)
definitionIcons.tsx and frontend render.ts still described Font Awesome as a curated subset; fa:<name> resolves against the full Free Solid set. Test names updated to match. Comments and test titles only. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1355,7 +1355,7 @@ describe("DefinitionsTab Font Awesome and emoji icons", () => {
|
||||
fireEvent.click(within(s).getByRole("button", { name: "Morning" }));
|
||||
}
|
||||
|
||||
it("ships the curated Font Awesome subset, each drawn as a filled glyph", () => {
|
||||
it("ships the curated Font Awesome quick picks, each drawn as a filled glyph", () => {
|
||||
expect(FA_DEFINITION_ICONS.length).toBeGreaterThan(0);
|
||||
for (const entry of FA_DEFINITION_ICONS) {
|
||||
expect(entry.kind).toBe("fa");
|
||||
|
||||
@@ -1,11 +1,14 @@
|
||||
/**
|
||||
* The icons a definition's `icon` may name (ADMIN-SPEC §3.3): the curated
|
||||
* Lucide set, the curated Font Awesome Free solid subset, or an emoji. The
|
||||
* names, labels and path data come from the shared icon registry
|
||||
* (`src/icons/registry.generated.ts`, generated from
|
||||
* `tools/icons/curated-icons.json`) — no CDN, no runtime fetch. The stored
|
||||
* value is namespaced — `lucide:<name>`, `fa:<name>` or `emoji:<grapheme>` —
|
||||
* and a legacy bare `<kebab-name>` still names the same Lucide entry.
|
||||
* Lucide set, any icon in the full Font Awesome Free Solid set, or an emoji.
|
||||
* The Font Awesome quick picks (`FA_DEFINITION_ICONS`) are only a curated
|
||||
* shortcut list; `fa:<name>` resolves against the full set
|
||||
* (`FA_SOLID_ICONS`). The names, labels and path data come from the shared
|
||||
* icon registry (`src/icons/registry.generated.ts`, generated by
|
||||
* `tools/icons/generate.mjs` from `tools/icons/curated-icons.json` and the
|
||||
* installed Free Solid package) — no CDN, no runtime fetch. The stored value
|
||||
* is namespaced — `lucide:<name>`, `fa:<name>` or `emoji:<grapheme>` — and a
|
||||
* legacy bare `<kebab-name>` still names the same Lucide entry.
|
||||
*/
|
||||
import { GlyphSvg } from "../icons/GlyphSvg";
|
||||
import {
|
||||
@@ -105,8 +108,9 @@ export function emojiIconText(value: string | null): string {
|
||||
}
|
||||
|
||||
/**
|
||||
* The curated glyph (Lucide or Font Awesome) an icon value resolves to via
|
||||
* the shared parser; emoji, unknown and null values give null.
|
||||
* The glyph an icon value resolves to via the shared parser: a curated
|
||||
* Lucide entry or any Font Awesome Free Solid icon (quick pick or not);
|
||||
* emoji, unknown and null values give null.
|
||||
*/
|
||||
export function findDefinitionIcon(value: string | null): DefinitionIconEntry | null {
|
||||
const icon = resolveIcon(value);
|
||||
|
||||
@@ -157,7 +157,7 @@ describe("offline bundling", () => {
|
||||
}
|
||||
});
|
||||
|
||||
it("no bundled source imports an icon package — only the curated generated data ships", () => {
|
||||
it("no bundled source imports an icon package — only the generated registry data ships", () => {
|
||||
const sources = [join(REPO_ROOT, "admin", "src"), join(REPO_ROOT, "frontend", "src")]
|
||||
.flatMap(filesUnder)
|
||||
.filter((path) => /\.(ts|tsx)$/.test(path) && !path.endsWith(".test.ts") && !path.endsWith(".test.tsx"));
|
||||
|
||||
Reference in New Issue
Block a user