feat(:mode_nav): add canonical item glyph#133
Merged
Conversation
Extends the canonical :mode_nav widget with an optional per-item glyph field. When present, the glyph is rendered as a leading decorative span with aria-hidden="true" so the visible label remains the accessible name. Items without glyph are backward-compatible (no span rendered). Layers changed: - packages/live_ui/lib/live_ui/renderer.ex — glyph + label spans in mode_nav render clause - packages/live_ui/test/live_ui/navigation_widgets_test.exs — 4 new mode_nav glyph rendering tests - packages/unified_iur/test/unified_iur/widgets/components_test.exs — 2 new mode_nav constructor tests (glyph preserved + backward-compat) Open questions for Pascal per unified_ui #186: naming (glyph vs icon), format (free string vs enum), icon asset model, position configurability, selected glyph variant, and glyph_label override for ARIA. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2443b91 to
82d1416
Compare
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.
Summary
Rebases PR #133 onto current
mainand makes the:mode_navitem glyph a documented canonical extension instead of an accidental passthrough.mode_navitems may now include optionalglyph: String.t(). Live UI renders the glyph before the item label witharia-hidden="true"; the label remains the accessible name.Architecture decisions
glyph, noticon. This is inline display metadata for compact text/glyph affordances, not an asset lookup or renderer-specific icon contract.mode_navvisual contract.glyph_labelis added becausemode_navremains a labeled control and labels are the accessible item names.What changed
UnifiedIUR.Widgets.Components.mode_nav/2normalizes string-keyedglyphto the canonical atom key and validates glyph values.LiveUi.Rendererrenders optional glyph spans and keeps labels in their own span.mode_navglyph semantics.Verification
mix test packages/unified_iur/test/unified_iur/widgets/components_test.exsmix test packages/live_ui/test/live_ui/navigation_widgets_test.exsmix test packages/unified_ui/test/unified_ui/widget_components_catalog_test.exsmix format --check-formatted packages/live_ui/lib/live_ui/renderer.ex packages/live_ui/test/live_ui/navigation_widgets_test.exs packages/unified_iur/lib/unified_iur/widgets/components.ex packages/unified_iur/test/unified_iur/widgets/components_test.exs packages/unified_ui/lib/unified_ui/widget_components.exbash ./scripts/validate_specs_governance.shbash ./scripts/validate_guides_governance.shNotes
mix spec.prime --base HEADandmix spec.nextwere attempted, but thespec.*Mix tasks are not available in this checkout.