Skip to content

feat(:top_strip): add search_event + settings_event + user_avatar_url attrs (Wave 3.7 Class C extension, DRAFT, Pascal-review REQUIRED)#136

Draft
ty13r wants to merge 1 commit into
mainfrom
claude/extension-top-strip-search-settings-avatar-wave-3-7
Draft

feat(:top_strip): add search_event + settings_event + user_avatar_url attrs (Wave 3.7 Class C extension, DRAFT, Pascal-review REQUIRED)#136
ty13r wants to merge 1 commit into
mainfrom
claude/extension-top-strip-search-settings-avatar-wave-3-7

Conversation

@ty13r
Copy link
Copy Markdown
Member

@ty13r ty13r commented May 18, 2026

Summary

Extends the canonical :top_strip widget with three trailing-region shell-affordance attrs identified in the Wave AshUI-3.7 comp-fidelity audit (findings TS-1, TS-2, TS-3). Refs unified_ui #183.

This is a DRAFT pending Pascal's design-call on open questions below. Do NOT merge without Pascal review.

The 3 attrs

Attr Type Default Semantics
search_event atom or String.t or nil absent When set, renders a search trigger button in the trailing region with phx-click={search_event} and aria-label="Open search"
settings_event atom or String.t or nil absent When set, renders a settings/gear button in the trailing region with phx-click={settings_event} and aria-label="Open settings"
user_avatar_url String.t or nil absent When set, renders an <img> in the trailing region with aria-label="User profile"

Stage 1-4 files modified

  • Stage 1 (IUR constructor): packages/unified_iur/lib/unified_iur/widgets/components.extop_strip/2 extended with maybe_put for 3 new attrs
  • Stage 2 (catalog): packages/unified_ui/lib/unified_ui/widget_components.ex — summary updated
  • Stage 4 (renderer): packages/live_ui/lib/live_ui/renderer.ex — top_strip render clause renders .live-ui-top-strip-trailing div with conditional search/settings buttons and avatar img

Test counts added

  • unified_iur packages/unified_iur/test/unified_iur/widgets/components_test.exs: +1 test ("top_strip stores trailing-region affordance attrs in shell map") — covers no-trailing, search-only, settings-only, avatar-only, all-three combinations. Suite: 6 tests, 0 failures.
  • live_ui packages/live_ui/test/live_ui/renderer_test.exs: +5 tests in describe "top_strip trailing-region affordances" block — covers HTML output for each attr combination, nil-guard (no spurious elements when unset), all-three together. Suite: 10 tests, 0 failures.

Open questions for Pascal (from unified_ui #183, verbatim)

  1. Attr-driven vs slot-driven trailing region? Direct attrs are simpler; a trailing slot is more composable. Both have precedent (:command_palette has slots; :button has direct attrs). Your call.
  2. Avatar composition: should :top_strip reference an :avatar widget composition (cleanest separation), or accept raw user_avatar_url + me_actor_id and render an inline avatar (simplest consumer)?
  3. Default value for the events: nil = "don't render the affordance" is the cleanest convention; we want to confirm that matches Pascal's preference for optional event attrs across other widgets.
  4. ARIA labels: should each affordance accept a custom aria_label attr, or should the widget hardcode "Search", "Settings", "User profile"? Consumers may want i18n.
  5. Family decision: should :top_strip stay in :layer_shell_and_callout family, or should the trailing-region attrs need a richer family (e.g., new :shell_with_affordances or similar)?

Closest existing extension pattern

:sidebar_section (action_intent -> conditional button with {@interaction_attrs}) is the closest single-intent precedent. This PR extends the same conditional-render pattern to three distinct trailing affordances.

For multi-event widget precedent with intent-atom attrs, see :mode_nav and :chat_composer.


Audit cross-references:

  • Comp-audit findings TS-1 (search), TS-2 (settings), TS-3 (avatar)
  • unified_ui issue #183

Generated with Claude Code

… trailing-region attrs (Wave 3.7 Class C extension)

Extends the canonical :top_strip widget with three shell-affordance attrs identified
in the Wave AshUI-3.7 comp-fidelity audit (findings TS-1, TS-2, TS-3). DRAFT pending
Pascal design-call on trailing-region shape and ARIA label strategy (unified_ui #183).

Stage 1 (IUR constructor): top_strip/2 accepts search_event, settings_event,
user_avatar_url via maybe_put -- all optional, absent when nil.

Stage 2 (catalog): widget_components.ex summary updated.

Stage 4 (renderer): top_strip clause renders a live-ui-top-strip-trailing div with
conditional search button (phx-click + aria-label="Open search"), settings button
(phx-click + aria-label="Open settings"), and avatar img when attrs are present.

Tests added:
- unified_iur components_test: 1 new test (6 total) covering all attr combinations
- live_ui renderer_test: 5 new tests (10 total) covering HTML output per combination

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.

1 participant