Skip to content

feat(:mode_nav): add canonical item glyph#133

Merged
pcharbon70 merged 1 commit into
mainfrom
claude/extension-mode-nav-glyph-wave-3-7
May 22, 2026
Merged

feat(:mode_nav): add canonical item glyph#133
pcharbon70 merged 1 commit into
mainfrom
claude/extension-mode-nav-glyph-wave-3-7

Conversation

@ty13r
Copy link
Copy Markdown
Member

@ty13r ty13r commented May 18, 2026

Summary

Rebases PR #133 onto current main and makes the :mode_nav item glyph a documented canonical extension instead of an accidental passthrough.

mode_nav items may now include optional glyph: String.t(). Live UI renders the glyph before the item label with aria-hidden="true"; the label remains the accessible name.

Architecture decisions

  • Name: keep glyph, not icon. This is inline display metadata for compact text/glyph affordances, not an asset lookup or renderer-specific icon contract.
  • Format: free string. The constructor rejects non-string glyph values, while leaving future design vocabulary constraints outside this narrow contract.
  • Assets: no icon files, asset URLs, SVG payloads, or icon registry fields are introduced.
  • Position: leading only for now, matching the current mode_nav visual contract.
  • Selected state: use CSS treatment of the same glyph; no selected-glyph variant field in this PR.
  • ARIA: glyphs are decorative. No glyph_label is added because mode_nav remains a labeled control and labels are the accessible item names.

What changed

  • UnifiedIUR.Widgets.Components.mode_nav/2 normalizes string-keyed glyph to the canonical atom key and validates glyph values.
  • LiveUi.Renderer renders optional glyph spans and keeps labels in their own span.
  • The canonical widget spec, contract, user guide, and Unified UI catalog summary now describe mode_nav glyph semantics.
  • Tests cover constructor preservation, string-key normalization, invalid glyph values, backward compatibility, and Live UI rendering.

Verification

  • mix test packages/unified_iur/test/unified_iur/widgets/components_test.exs
  • mix test packages/live_ui/test/live_ui/navigation_widgets_test.exs
  • mix test packages/unified_ui/test/unified_ui/widget_components_catalog_test.exs
  • mix 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.ex
  • bash ./scripts/validate_specs_governance.sh
  • bash ./scripts/validate_guides_governance.sh

Notes

mix spec.prime --base HEAD and mix spec.next were attempted, but the spec.* Mix tasks are not available in this checkout.

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>
@pcharbon70 pcharbon70 force-pushed the claude/extension-mode-nav-glyph-wave-3-7 branch from 2443b91 to 82d1416 Compare May 21, 2026 17:43
@pcharbon70 pcharbon70 marked this pull request as ready for review May 21, 2026 17:43
@pcharbon70 pcharbon70 changed the title feat(:mode_nav): add glyph slot/attr (Wave 3.7 Class C extension, DRAFT, Pascal-review REQUIRED) feat(:mode_nav): add canonical item glyph May 21, 2026
@pcharbon70 pcharbon70 merged commit f3836cc into main May 22, 2026
8 checks passed
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.

2 participants