feat(dui/spinner)!: collapse to single library-owned rotation spinner#396
Merged
Conversation
The spinner is now a single, library-owned 8-frame rotation animation
at 100 ms intervals. Packages declare only a placeholder `<g id=...>`
in their layout SVG and reference it via `spinner: { node: ... }` in
the manifest; DeUX injects the canonical geometry (background tile +
8 radial bars) at frame-generation time.
BREAKING CHANGES
- `SpinnerSpec` reduced to a single `node` field. The fields `type`,
`frames`, `interval_ms`, and `background_node` are gone.
- Manifests that include any of those legacy keys fail to load.
- `SpinnerType` enum, `DEFAULT_SPINNER_FRAMES`, and
`DEFAULT_SPINNER_INTERVAL_MS` are removed.
- `SpinnerFrames` class is replaced by the module-level
`get_frames(...)` function backed by a process-wide LRU cache keyed
by rendered SVG, placeholder id, size, image format, and background
tile signature.
Library-shipped `IconKey.dui` and `PictureKey.dui` packages have been
migrated to the new minimal form.
Refs #395
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 #395.
Summary
Replaces the configurable per-package spinner with a single, library-owned 8-frame rotation animation at 100 ms intervals. Packages declare only a placeholder
<g id="...">in their layout SVG and reference it viaspinner: { node: ... }in the manifest; DeUX injects the canonical geometry (background tile + 8 radial bars) at frame-generation time.Breaking changes
SpinnerSpecreduced to a singlenodefield.type,frames,interval_ms, andbackground_nodeare no longer accepted; manifests using them fail to load with a clear error.SpinnerTypeenum,DEFAULT_SPINNER_FRAMES,DEFAULT_SPINNER_INTERVAL_MS, and theSpinnerFramesclass are removed.get_frames(...)function backed by a process-wide LRU cache keyed by rendered SVG, placeholder id, size, image format, and background tile signature.Migration
Before:
After:
In the layout SVG, replace the inline spinner geometry with an empty placeholder:
The library-shipped
IconKey.duiandPictureKey.duipackages have been migrated.Validation
ruff check .— cleanmypy src/deux— cleanpytest tests/ --cov=deux --cov-fail-under=95— 1979 passed, 1 skipped, coverage 95.66 %deux.dui.spinnermodule coverage: 96 %Files
src/deux/dui/schema.py: shrinkSpinnerSpecto{node}, dropSpinnerTypeand default constants.src/deux/dui/loader.py: reject legacy keys; drop CUSTOM / background validation.src/deux/dui/spinner.py: full rewrite — canonical SVG constant + LRUget_frames.src/deux/dui/svg_renderer.py: simplify_hide_spinner_node.src/deux/dui/key.py,src/deux/dui/card.py: switch toget_frames, dropSpinnerFramesusage.src/deux/dui/__init__.py: update exports.src/deux/dui/packages/{IconKey,PictureKey}.dui: migrate to minimal placeholder form.tests/test_spinner.py: rewritten for the new API.tests/test_spinner_cache.py: new — LRU identity, eviction, key composition.tests/test_busy_guard.py,tests/test_dui_svg_renderer.py: updated for new schema.docs/guides/creating-dui-packages.md: collapsed spinner section.