Repository navigation
refactor(web): keep the icon sprite in its own file and check every icon name - #292
Merged
Merged
Conversation
… use base.html includes app/templates/_icons.svg, one symbol per line in commented groups. The rendered pages are unchanged apart from the order and whitespace inside <defs>. The wheel ships the new template.
It had a 16 grid and its own stroke width and joins. It now takes the stroke from .ic like every other symbol.
… the sprite The two dialog close buttons use i-x, the custom keys card i-key and the retried attempt mark i-refresh, instead of inline SVGs drawn on their own grids. The retry mark keeps its stroke weight at 12px.
The folder tile uses i-folder and the generator tile a new i-wand symbol, instead of paths passed inline.
test_icons.py reads the templates, scripts and Python sources. Literal #i-name references must be symbols. Each place that builds an id from a value is listed with where its values are written, and those values must be quoted names of symbols; an unlisted place or an unresolvable value fails. Symbols must use the 24 grid, carry no stroke or fill of their own and have unique ids. The builder's machine tile now names both icons literally so the test can read them.
1 of 11 tasks
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.
Closes #291
What
The icon sprite moves from an inline
<defs>block inbase.htmltoapp/templates/_icons.svg, whichbase.htmlincludes. It has one symbol per line, in commented groups: navigation; actions; views and filters; run states and notices; machines and services; where a dataset's tasks come from; themes. Every symbol now uses the same style:i-wrenchis redrawn on the 24 grid. It has no stroke attributes of its own and takes its stroke from.ic, like the other symbols.The close buttons of the Add to catalogue dialog and of the saved recipe dialogs use
i-x. The custom key card usesi-key, and the retried attempt mark usesi-refresh. The builder's task source tiles usei-folderand a newi-wand, made from the path that the tile drew inline. The retry mark keeps its stroke weight at 12 px.New
app/tests/test_icons.pyreads the templates, scripts and Python sources, and fails in these cases:#i-namewithout a symbol;stroke,stroke-widthorfill;Each place that builds an id from a value is listed in the test, with where its values are written. Two examples are the
filter_icon=arguments and the run state dict inruns/launches.html. The builder's machine tile now names both of its icons literally. The test does not check for unused symbols.The wheel ships
templates/*.svg..claude/rules/ui.mdsays that icons are sprite symbols on the 24 grid, used with<use>, and that a page draws no icon of its own. TheAGENTS.mdmap names_icons.svgand its test.Other inline SVGs stay as they are, because they are drawings, not icons: chart figures, the job page's legend keys, the citation seal on a benchmark page and the start page's mark.
Touches
templates and static · tests · rules (
AGENTS.md,.claude/rules/ui.md) · packaging (pyproject.tomlpackage data)Before and after
Verified
/benchmarks,/agents,/capabilities,/settings,/new-run,/new-run/benchmarks,/launches,/workspaces,/kits,/recipes,/import), with CSRF tokens and checkout paths normalised. Each page is identical, except for the order and whitespace of the symbols inside<defs>.test_icons.pyfails for each case when it is broken on purpose:#i-alrtinhosts.js,filter_icon='targt',icon(kind)in the builder, a new#i-{{ name }}place,stroke-widthoni-plus, a 16 grid oni-x,filloni-x, and a duplicatei-x.python:3.12container with Node:python3 app/tests/parallel.py: 3150 tests in 165 modules, OK.pip install -r app/requirements.txt, thenpython3 app/tests/parallel.py app/ui_tests: 715 tests in 61 modules, OK.uv build --wheel, thenpython3 app/packaging/verify.pyon the wheel: OK. The wheel contains_nullius_app/templates/_icons.svg.Risk
<use>names a symbol that the sprite does not have shows an empty icon. The new test catches this for the places it lists. A new place that builds an id from a value must be added to the test, which fails until then.