You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .claude/skills/layered-ui-rails/references/CONTROLLERS.md
+2-1Lines changed: 2 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -111,7 +111,7 @@ Accessible tabbed interface with keyboard navigation.
111
111
Positions a native `popover`-attribute element relative to its trigger, with auto-flip near viewport edges. Showing, hiding, light-dismiss (outside click), and Escape-to-close are all handled by the browser via the `popover` attribute - this controller only handles placement.
112
112
113
113
**Targets:**`trigger`, `popover`
114
-
**Values:**`placement` (String, default `"bottom"`; one of `"top"`, `"bottom"`, `"left"`, `"right"`), `align` (String, default `"start"`; `"start"` or `"end"` - which edge of the popover flushes with the trigger on the cross axis)
114
+
**Values:**`placement` (String, default `"bottom"`; one of `"top"`, `"bottom"`, `"left"`, `"right"`), `align` (String, default `"start"`; `"start"` or `"end"` - which edge of the popover flushes with the trigger on the cross axis), `open` (Boolean, default `false`; when true the popover opens as soon as the controller connects, shown and positioned in the same task so it never paints unpositioned - e.g. re-opening a filter popover after a form submission re-renders the page)
115
115
116
116
```html
117
117
<divdata-controller="l-ui--popover">
@@ -130,6 +130,7 @@ Positions a native `popover`-attribute element relative to its trigger, with aut
130
130
Features:
131
131
- Repositions on open, and while open on window resize/scroll
132
132
- Flips to the opposite side if the preferred placement would overflow the viewport
133
+
-`data-l-ui--popover-open-value="true"` opens the popover on connect without a flash of unpositioned content
Copy file name to clipboardExpand all lines: .claude/skills/layered-ui-rails/references/CSS.md
+3-1Lines changed: 3 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -278,14 +278,16 @@ Always combine the base block with a modifier, e.g. `<span class="l-ui-badge l-u
278
278
Interactive tag - e.g. an email recipient or an active filter. A badge is a static styled span; a tag is a container with separately interactive segments.
279
279
280
280
```
281
+
.l-ui-tag-row Canonical container for a row of tags plus any trailing actions (e.g. a filter bar); wrapping flex row with gap
281
282
.l-ui-tag Tag container (div); carries colour and shape but no padding - segments supply it
282
283
.l-ui-tag--rounded Pill shape (matching l-ui-badge--rounded); default is the subtle badge radius
283
284
.l-ui-tag__text Static label segment (span)
284
285
.l-ui-tag__button Interactive label segment (button or a); focus ring + pointer
286
+
.l-ui-tag__label Inner wrapper (span) around a text/button segment's content; truncates long labels with an ellipsis
285
287
.l-ui-tag__remove Trailing remove segment (button or a) holding a ✕ icon (e.g. l-ui-icon--xs); needs an aria-label
286
288
```
287
289
288
-
A tag takes the same subtle corner radius as a badge by default; add `l-ui-tag--rounded` for a pill. Segments must be direct children in label-then-remove order; when a remove segment follows, the label segment automatically drops its right padding so the remove owns the gap and every part of the tag stays clickable. Prefer the `l_ui_tag` helper (see HELPERS.md), which also wires an optional popover.
290
+
A tag takes the same subtle corner radius as a badge by default; add `l-ui-tag--rounded` for a pill. Segments must be direct children in label-then-remove order; when a remove segment follows, the label segment automatically drops its right padding so the remove owns the gap and every part of the tag stays clickable. A tag never grows past its container; wrap label content in `l-ui-tag__label` so it truncates with an ellipsis instead of overflowing. Prefer the `l_ui_tag` helper (see HELPERS.md), which renders the label wrapper and wires an optional popover.
-`id` (String, optional) - DOM id for the popover element; defaults to an auto-generated id
335
335
-`placement` (Symbol, optional) - `:top`, `:bottom` (default), `:left`, or `:right`. Flips automatically if it would overflow the viewport
336
336
-`align` (Symbol, optional) - `:start` (default) flushes the popover's leading edge with the trigger's; `:end` flushes its trailing edge instead. For example, `placement: :bottom, align: :end` hangs the popover down and to the left of a trigger at the right end of a row
337
+
-`open` (Boolean, optional) - when `true`, the popover opens as soon as its Stimulus controller connects, shown and positioned in the same task so it never paints unpositioned. Useful for re-opening a popover after a form submission re-renders the page (e.g. `open: params[:filtering].present?`). Defaults to `false`
337
338
-`container` (Hash, optional) - extra HTML attributes for the wrapping `<div>` (e.g. `class:`)
338
339
-`&block` - the block's content is the popover body; call `p.trigger(**options, &block)` inside it to render the trigger button
339
340
@@ -388,7 +389,9 @@ Builder methods:
388
389
-`t.button(**opts, &block)` - button segment (`<button class="l-ui-tag__button">`); opens the tag's popover when one is declared
389
390
-`t.link(url, **opts, &block)` - link segment, styled like a button segment
390
391
-`t.remove(url = nil, **opts, &block)` - trailing remove segment (`l-ui-tag__remove`): a link when `url` is given, otherwise a button. Renders a ✕ icon unless the block supplies custom content. Pass `aria: { label: ... }` so it has an accessible name
391
-
-`t.popover(id: nil, placement: :bottom, align: :start, &block)` - attaches a popover; the block is the popover body. Options match `l_ui_popover`
392
+
-`t.popover(id: nil, placement: :bottom, align: :start, open: false, &block)` - attaches a popover; the block is the popover body. Options match `l_ui_popover`
393
+
394
+
Text, button, and link segments wrap their content in `<span class="l-ui-tag__label">`, which truncates long labels with an ellipsis when the tag is squeezed (the tag itself never grows past its container).
Copy file name to clipboardExpand all lines: test/dummy/app/views/pages/popovers.html.erb
+36Lines changed: 36 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -131,6 +131,38 @@
131
131
</dialog>
132
132
</div>
133
133
134
+
<h2class="mt-8 l-ui-heading--section">Open on connect</h2>
135
+
136
+
<pclass="mt-4">Pass <code>open: true</code> to open the popover as soon as its Stimulus controller connects - for example, re-opening a filter popover after a form submission re-renders the page. The controller shows and positions the popover in the same task, so it never paints unpositioned. As an <code>auto</code> popover it still light-dismisses as usual, so the example below is only open until you click elsewhere; reload the page to see it again.</p>
<pclass="mt-4">For a list of actions (e.g. a "more" menu on a table row), use <code>l-ui-popover__menu</code> to reset the popover's padding to a full-width list, and <code>l-ui-popover__menu-item</code> on each link or button. Add <code>l-ui-popover__menu-item--danger</code> for destructive actions, and an <code><hr class="l-ui-popover__menu-divider"></code> to separate groups of items. Give an icon-only trigger an <code>aria-label</code>. Pair with <code>align: :end</code> when the trigger sits at the end of a row.</p>
<tdclass="l-ui-table__cell"><code>:start</code> (default) or <code>:end</code> - which edge of the popover flushes with the trigger on the cross axis</td>
<tdclass="l-ui-table__cell">When <code>true</code>, the popover opens as soon as its Stimulus controller connects, shown and positioned in the same task so it never paints unpositioned; defaults to <code>false</code></td>
0 commit comments