Skip to content

fix(columns): render the wire:key callers pass to columns and cards - #234

Merged
ManukMinasyan merged 2 commits into
4.xfrom
fix/column-wire-key
Nov 15, 2026
Merged

ManukMinasyan merged 2 commits into
4.xfrom
fix/column-wire-key

Conversation

@ManukMinasyan

@ManukMinasyan ManukMinasyan commented Nov 15, 2026 •

Copy link
Copy Markdown
Member

Clicking a column's add card button can light the loading spinner in a different column. It happens after any request that inserts, removes or reorders a column ahead of the clicked one: the spinner appears on the column now sitting where the clicked column used to be. Relaticle hit it by hiding its "No Stage" column, reloading, and showing it again. Clicking Add in the second column then spun the first column's +.

What changed

  • modern/index.blade.php and the classic index.blade.php pass wire:key="column-{id}" to each column, and the classic column passes wire:key="card-{id}" to each card. None of the three components printed $attributes, so the keys never reached the DOM. modern/livewire/column.blade.php, livewire/column.blade.php and livewire/card.blade.php now render {{ $attributes->class(...) }} on their root.
  • The classic card declares config in @props. Its caller passes :config, and an undeclared array attribute would make $attributes throw when rendered. Declaring it keeps any published column view that still passes it working.

Why it broke

Without keys, Livewire's morph pairs columns by position. Livewire reads wire:target once, when it initialises an element. The morph patched the attribute on the reused node, but the spinner stayed bound to the column the node first held. The request itself carried the clicked column, so cards still landed in the right column. Only the spinner was misplaced.

Behavior to know about

No config key, no JS or CSS change, so filament:assets is not needed. The only DOM change is the wire:key attribute on column and card roots, plus any other attribute a caller passes to these components.

Tests

  • tests/Browser/ModernBoardTest.php: "the add card spinner stays in its own column after a column is inserted before it" shows hidden_column through showAllColumns, holds the request and reads which column shows a spinner. Before the fix it reports hidden_column and in_progress; after, only in_progress.
  • tests/Modern/Feature/LivewireBoardTest.php: "keys every column and card so a morph never reuses another column" pins the column and card keys on the modern and the classic board. The classic case renders a card with :config passed. Both cases fail on the 4.x views. The released classic tests under tests/Feature stay untouched for bin/classic-gate.sh.

Checked

  • Browser suite: 69/69 in Chromium and 69/69 in WebKit (--browser safari).
  • Feature files that render columns and cards (LivewireBoardTest, both CollapseEmptyColumnsTest, both CardActionUrlTest, CardLabelTest, DragBindingsTest, ColumnHeaderMenuTest): all pass. Pint clean.
  • In Relaticle, with these views, the original path and stage hide, show and reorder, collapse, collapse all, card size, grouped lanes, create and "create & create another" each lit only the clicked column's spinner, in Chromium and WebKit.

Not checked

PHPStan was not run on this branch. The change touches only Blade views and tests, and CI runs it.

Copilot AI balanced review requested due to automatic review settings November 15, 2026 19:14

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@ManukMinasyan
ManukMinasyan merged commit 444fce3 into 4.x Nov 15, 2026
13 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