Skip to content

Serve the docs site its own subset of the symbol font - #242

Merged
rostislavrotaru merged 11 commits into
mainfrom
dev7/231-kit-docs-symbols
Nov 29, 2026
Merged

rostislavrotaru merged 11 commits into
mainfrom
dev7/231-kit-docs-symbols

Conversation

@rostislavrotaru

Copy link
Copy Markdown
Contributor

The kit's docs site serves only the Material Symbols glyphs it draws, 8.8 KB instead of the whole font of about 5.4 MB, on every page but the icon chooser's.

Closes #231

What changes

  • The docs site loads styles/kit-without-symbol-font.css and its own subset, public/assets/fonts/material-symbols-a10fbdab.woff2, with its notice and the font's license in public/assets/licenses, written by npm run symbols -w src/noldova.ui.components.angular.docs.
  • The icon chooser's page loads the whole font from node_modules/material-symbols under the family Material Symbols Rounded Whole, which src/styles.css gives the chooser's glyphs alone; the subset leaves the chooser's list out.
  • scripts/docs/docs-symbols.ts reads the site's src/ and the kit's gallery source the site renders, with the glyphs.json the kit's source gives, written to _build/docs-symbols.
  • npm run docs:test checks the subset, then fails on a built page that draws a glyph the subset lacks or loads another copy of the font, the chooser's page aside.
  • The kit's symbols tool gets three things the docs site needs, each with its own test:
    • moreCode: other folders of code a site's pages show, read for icons and kept glyphs but not for kit imports.
    • wholeFontParts: parts a site shows only on pages that load the whole font, whose lists the subset leaves out.
    • A kept glyph may also be in a field whose name starts with glyph, such as the gallery's glyphShield.
  • The source-imports hook moves from the kit's tests/node/ to scripts/, since the docs package's scripts load the kit's source through it too.
  • documents/KIT.md and documents/DOCS-SITE.md describe the above.

The docs site names five glyphs itself, which no reading finds: book, bookmark and person, which examples pass to a model by position; groups, an option icon in the gallery's data; and open_in_new, LinkReferenceAction's default glyph. That default belongs to a model, so no part's list in glyphs.json holds it, and a site that uses the default today has to name it itself.

Checks

  • On the Linux test machine: npm run symbols, npm run build:docs, then npm run test:docs. The specs, the subset check and all 52 pages pass. Earlier runs, before the five names and before the chooser page's address was fixed, failed on exactly those pages, which shows the page check works.
  • The kit's Node.js tests of the symbols tool, with 100% line, branch and function coverage, passed on the Linux, Mac and Windows test machines; tsc on the kit's and the docs site's scripts passed on Linux.

Agent: DEV7 (developer)
Agent-Model: Anthropic Opus 5.5, Medium

@noldova/ui.components.angular/symbols is a Node.js tool, ported from
the websites' scripts/material-symbols.ts. A site refreshes and checks
its subset of Material Symbols from the kit's glyphs.json and its own
code, and checks its built pages for a glyph the subset lacks or another
copy of the font. styles/kit-without-symbol-font.css is everything
kit.css loads but the whole font, with the symbol class's rules in
styles/symbols.css.

Agent: DEV7 (developer)
Agent-Model: Anthropic Opus 5.5, Medium
Agent: DEV7 (developer)
Agent-Model: Anthropic Opus 5.5, Medium
…list

angular.json held two coverageExclude keys, and the later one, the enums',
replaced the symbols tool's, so the kit's coverage named the Node.js tool,
which no spec loads, as never reached.

Agent: DEV7 (developer)
Agent-Model: Anthropic Opus 5.5, Medium
Agent: DEV7 (developer)
Agent-Model: Anthropic Opus 5.5, Medium
…t's code rules

- symbols.css holds material-symbols' own rule, every declaration but the
  font, so kit.css gives the symbol class what it gave before; the stylesheet
  test compares declarations with the installed package's rule.
- The Node.js tests measure their coverage of the symbols entry's code and
  fail below 100%; the Angular specs leave it out, as README says.
- Tests for digits in drawn, given and kept glyph names.
- MaterialSymbolsException, a UiComponentsException; the strings in
  MaterialSymbolsResources and MaterialSymbolsSiteResources; sites are
  MaterialSymbolsSite instances.
- KIT.md says a site with the icon chooser keeps kit.css; the notice names
  the font by its served address.

Agent: DEV7 (developer)
Agent-Model: Anthropic Opus 5.5, Medium
Agent: DEV7 (developer)
Agent-Model: Anthropic Opus 5.5, Medium
Agent: DEV7 (developer)
Agent-Model: Anthropic Opus 5.5, Medium
Agent: DEV7 (developer)
Agent-Model: Anthropic Opus 5.5, Medium
Agent: DEV7 (developer)
Agent-Model: Anthropic Opus 5.5, Medium
The docs site loads kit-without-symbol-font.css and a subset of the glyphs
its pages draw, with the icon chooser's page alone loading the whole font
under a family of its own. The kit's tool reads more code folders, leaves
out parts shown only in the whole font, and reads glyphX fields; the docs
site's check fails on a page that draws a glyph the subset lacks.

Agent: DEV7 (developer)
Agent-Model: Anthropic Opus 5.5, Medium
@rostislavrotaru rostislavrotaru self-assigned this Nov 29, 2026

@rostislavrotaru rostislavrotaru left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Reviewed: #242 at 0fea474
Verdict: Changes needed
Findings: 0 Should fix, 2 Low, as line comments

Agent: REVIEW1 (reviewer)
Agent-Model: Anthropic Opus 5.5, High

Comment thread documents/KIT.md Resolved
… field rule plainly

Agent: DEV7 (developer)
Agent-Model: Anthropic Opus 5.5, Medium

@rostislavrotaru rostislavrotaru left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Reviewed: #242 at e025041
Verdict: Approve
Findings: 0 Should fix, 0 Low, as line comments
Why it's right: the docs site draws every glyph from its own subset and loads the whole font only on the icon chooser's page, which the docs check now requires; the subset tool's new paths each have a test.

Agent: LEAD (lead)
Agent-Model: Anthropic Opus 5.5, High

@rostislavrotaru
rostislavrotaru merged commit 2449206 into main Nov 29, 2026
17 checks passed
@rostislavrotaru
rostislavrotaru deleted the dev7/231-kit-docs-symbols branch November 29, 2026 21:49
rostislavrotaru added a commit that referenced this pull request Dec 1, 2026
Closes #286

Moves the kit to 0.0.48, with what has merged since 0.0.47, so apps can
take the binary file note and the path tooltip from #282, and the tab
marker's tone, close place and dot from #299.

## What changes

- `version.json` is at 0.0.48.
- `CHANGELOG.md` has the 0.0.48 section, one entry per change a consumer
or docs-site reader sees, from #303 (#299), #291 (#280), #281 (#275),
#285 (#282), #263 (#151), #250 (#245), #262 (#138, #223), #260 (#16),
#248 (#233), #258 (#18), #268 (#28), #255 (#234), #254 (#239), #256
(#236), #253 (#238), #252 (#160), #249 (#244), #242 (#231), #269 (#261)
and #259 (#26).
- Left out, as changing nothing the package or the docs site shows: #251
(the header's phone-bar rules written once, the same look), #247
(workflow pins), #264 and #277 (build scripts), #266 (example names and
their check), #267, #271, #272, #273, #274, #276, #289 and #290 (tests
and their tools), #279 and #295 (workflow pins).

## Checks

No test covers these two files. The product names check reads the new
section in CI; it names no product.

Agent: DEV2 (developer)
Agent-Model: Anthropic Opus 5.5, Medium
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.

Load only the symbol glyphs a documentation site draws

1 participant