Skip to content

Keep Filament's label row: the source switch joins the hint and hint actions - #9

Open
grafst wants to merge 2 commits into
happenv-com:1.xfrom
blemli:switch-in-label-row
Open

grafst wants to merge 2 commits into
happenv-com:1.xfrom
blemli:switch-in-label-row

Conversation

@grafst

@grafst grafst commented Sep 28, 2026

Copy link
Copy Markdown

A field with ->hint() / ->hintIcon() / ->hintAction() currently loses that row's layout: hiddenLabel() removes the wrapper label, the plugin re-draws the label inside the field content, and Filament renders the hints in a row of their own above it (screenshot: a hintAction(WebSearchAction …) ended up as an orphan line above «Label | File / From URL»).

This PR keeps Filament's own label row and adds the source switch to it as an after-label component, after the hints:

  • MultiSourceFileUpload::setUp() wraps the existing after-label closure (the hints) and appends a View component with the switch when URL import is on; no more hiddenLabel().
  • The switch (components/source-switch.blade.php) and the panes live in different Alpine scopes, so they talk through a msu-tab CustomEvent keyed by the field ($dispatch from the switch, $watch('tab') from the panes so a finished import flips the switch back to File).
  • The plugin header and its label re-styling are gone from the view and the stylesheet (dist rebuilt); the label is Filament's again — accessible, inline-label aware, one fi-fo-field-label-content per field.
  • Fixture gains a label, hint and hint action; the render test asserts all three survive next to the switch.

🤖 Generated with Claude Code

grafst and others added 2 commits September 29, 2026 01:23
…actions

Hiding the wrapper label and re-drawing it inside the field content cut the
field's hint, hint icon and hint actions loose — they rendered in a row of
their own above the plugin's header. The switch is now an after-label
component: Filament's own label row stays (accessible, inline-label aware),
the hints keep their place and the switch sits at its end. Switch and panes
live in different Alpine scopes, so they talk through a msu-tab event keyed
by the field.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The file pane is the field's own wrapped content; wrapping it together
with the URL pane put the label row inside the file pane, where showing
the URL pane hid it — and the switch with it. wrapEmbeddedHtml() is the
seam between content and wrapper, so the panes join there and the label
row stays put whichever pane is showing.

Co-Authored-By: Claude Fable 5.1 <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