Skip to content

Add event-wiring attrs to :top_strip (theme_event, palette_event, pane_event) #180

Description

@ty13r

:top_strip — add event-wiring attrs (theme_event, palette_event, pane_event)

Canonical-grep proof

$ git grep -n "kind: :top_strip" packages/live_ui/lib/live_ui/renderer.ex
packages/live_ui/lib/live_ui/renderer.ex:<line>:  def render(%{element: %Element{kind: :top_strip}} = ...)

Renderer clause exists (added in PR #179 commit 2d7c2c76 + fix-up 65a08442); the constructor at packages/unified_iur/lib/unified_iur/widgets/components.ex for :top_strip accepts brand, context, theme, pane_open? opts + a children list — but does NOT accept event-wiring attrs for the theme button cluster, palette button, or pane toggle button.

Divergence (ariston consumer vs canonical)

Ariston's operator-surface top strip (ariston-ui/lib/ariston_ui_web/live/operator_surface_live.ex:812-829) passes 3 event-name attrs that canonical doesn't model:

Aspect Ariston-side Canonical Impact
Theme button click "theme_event" => "set_theme" (phx event name) + "current_theme" for state theme attr (token only); no event hook Theme toggle click has no canonical wiring
Palette button click "palette_event" => "open_palette" (phx event name) no palette_event attr Palette button click has no canonical wiring
Pane toggle click "pane_event" => "toggle_pane" (phx event name) + pane_open? for state pane_open? attr (state only); no event hook Pane toggle click has no canonical wiring

The state attrs (theme, pane_open?) are passed and consumed correctly. Only the EVENT names for the 3 control buttons have no canonical path.

Proposed extension

Add 3 optional event-name attrs to :top_strip:

@spec top_strip([child], opts) :: Element.t()
def top_strip(children \\ [], opts \\ [])
# Existing opts: brand, context, theme, pane_open?, id
# NEW opts: theme_event, palette_event, pane_event (each: optional event-name string)

In the renderer clause: pass each event-name through to the corresponding button's phx-click attribute (or pass them all via a controls_attrs adapter map if you prefer the adapter pattern used by :chat_composer's input_attrs/send_attrs).

Status

Ariston PR #351 (Wave AshUI-3.3 step 4 canonical migration) currently DROPS these 3 event attrs because they have no canonical path. The 3 control buttons in ariston's operator-surface lose their click wiring on the canonical render path. Filing this extension unblocks restoring those events.

ash_ui PR #108 (merged at a32fb5519fb9) added per-kind render clauses for the 7 shell primitives. Once :top_strip accepts these attrs, the render clauses in BOTH unified_ui and ash_ui need to pass them through to the rendered button elements.

Cross-references

Sibling issues this batch:

  • :sidebar_item visual+state primitives
  • :unread_badge a11y label

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions