[6.x] Replicator card layout - #15343
Open
jaygeorge wants to merge 33 commits into
Open
Conversation
Shopify Draggable’s swap animation doesn’t work well with display: grid. Handle conflict — The outer (vertical) sortable used the same handle class as the cards. Dragging a card handle started a row drag instead of a card drag. Fix: Separate handles — sortable-row-handle for full-width sets (vertical moves), sortable-handle for cards (horizontal moves inside a group).
Lone card groups no longer use the inner horizontal sortable, so their set handle drives the outer row sortable. Multi-card groups get a dedicated row handle for moving the whole group vertically.
Apply inset picker styling to all sets in a multi-card group, including the first and last cards. Hide the dashed entry connector for card rows since the vertical handle replaces it.
(get the first replicator control above the card)
Move the --col-span override from the set list onto each card slot so nested publish fields are reset without relying on the list wrapper.
Move grouping, connector, and collapse member logic into pure helpers with Vitest coverage for column counts and row membership.
Observe the panel container width instead of slot offset comparisons so parallel cards collapse together reliably, recover sort order from the DOM when sortable emits duplicates, and wire the extracted card layout helpers.
Show the card layout toggle only when editing Replicator sets, strip the card flag from Bard blueprint saves, and ignore it in Bard runtime config. Clarify the blueprint instructions copy.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of the Problem
“Card” components are a common pattern on the web, used for things like contact information, team bios, and feature highlights with icons.
Replicator sets always render full-width, one per row. That works well for long-form content, but many blueprints repeat the same set type (e.g. feature cards, team members, stats) where an optional compact side-by-side layout would be easier to scan and edit.
When content naturally lends itself to a card-based presentation, it can be useful to display replicator sets as condensed cards.
What this PR Does
On the publish form, consecutive instances of the same card-enabled set render as cards when the panel is wide enough:
I considered giving editors control over card widths, but opted for automatic sizing instead, because:
Also includes:
2026-09-02.at.11.09.17.mp4
Some more technical things:
cardLayouts.jshelpers with Vitest coveragecardis stripped from Bard runtime configHow to Reproduce