Skip to content

feat(ActionGroup): add preserveOrder prop for DOM-order layout#2652

Merged
Lisa18289 merged 21 commits into
mainfrom
claude/actiongroup-alignment-review-9b36b7
Jul 16, 2026
Merged

feat(ActionGroup): add preserveOrder prop for DOM-order layout#2652
Lisa18289 merged 21 commits into
mainfrom
claude/actiongroup-alignment-review-9b36b7

Conversation

@Lisa18289

Copy link
Copy Markdown
Member

Was

Führt eine additive Prop preserveOrder (Default false) auf ActionGroup ein. Damit trennen wir die zwei Layout-Modi sauber:

  • Default (sortiert): unverändert — automatische Anordnung nach Slot/Farbe (abort links, primary rechts), mit Gap. Verschoben unter einen .sorted-Modifier, sodass sich für bestehende Consumer (Modal, Confirmation-Modals) nichts ändert.
  • preserveOrder: die ActionGroup erzwingt nichts — keine Sortierung, keine Ausrichtung, kein Gap. Buttons bleiben in DOM-Reihenfolge; Ausrichtung/Abstand regelt der umgebende Kontext per CSS.

Consumer umgestellt

Kontext Verhalten
Modal / Confirmation unverändert (sortiert, Gap, cancel-links/primary-rechts)
Alert preserveOrder — links, DOM-Reihenfolge
Section-Header neu: ActionGroup wird unterstützt (in den Header-actions-Tunnel, rechtsbündig, size="s")
IllustratedMessage, LightBox, Message, List preserveOrder — DOM-Reihenfolge

LightBox behält seinen eigenen vertikalen row-gap (bewusst, Icon-Button-Spalte).

Ergänzt

  • Story PreserveOrder (ActionGroup) und WithHeaderActionGroup (Section)
  • Docs-Beispiel + Abschnitt „Reihenfolge beibehalten" auf der ActionGroup-Seite
  • Remote-Visual-Test ActionGroup-preserveOrder (prüft zugleich, dass die Prop die Remote-Grenze übersteht)
  • Generierte Remote-Artefakte regeneriert (RemoteActionGroupElement)

Hinweis Screenshots

Alert/IllustratedMessage/Message/List/Section ändern ihr visuelles Verhalten und der neue Test hat noch keine Baseline — deshalb das update-screenshots-Label, damit die Baselines in der CI generiert werden.

Verifiziert lokal

pnpm build ✅ · pnpm nx test:compile components ✅ · pnpm nx test:compile remote-react-components

🤖 Generated with Claude Code

Introduce an additive `preserveOrder` prop (default `false`) on ActionGroup.
When set, the group imposes nothing: no color-based sorting, no
abort/primary pole-split, no alignment and no gap between actions — the
buttons stay in source order and the surrounding context controls spacing
and placement via its own CSS. The automatic arrangement (sorting, gap,
flex-end) now lives under a `.sorted` modifier, so the default rendering is
unchanged for existing consumers (Modal, confirmation modals).

Adopt DOM-order layout in the contexts that want it:
- Alert: actions left-aligned in source order
- Section header: now supports ActionGroup (tunneled into the header
  actions, right-aligned, size s), matching the existing single-button
  placement
- IllustratedMessage, LightBox, Message, List: opt into preserveOrder

Add a story, a docs example, and a remote visual test for preserveOrder.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@Lisa18289 Lisa18289 added the update-screenshots Label a PR to update the screenshots used for visual regression testing label Jul 15, 2026
@github-actions github-actions Bot removed the update-screenshots Label a PR to update the screenshots used for visual regression testing label Jul 15, 2026
@Lisa18289 Lisa18289 added the update-screenshots Label a PR to update the screenshots used for visual regression testing label Jul 15, 2026
@github-actions

github-actions Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Coverage Report for ./packages/components/

Status Category Percentage Covered / Total
🔵 Lines 80.59% 324 / 402
🔵 Statements 80.53% 331 / 411
🔵 Functions 85.22% 75 / 88
🔵 Branches 67.26% 150 / 223
File CoverageNo changed files found.
Generated in workflow #5644 for commit d71d99e by the Vitest Coverage Report Action

@github-actions github-actions Bot removed the update-screenshots Label a PR to update the screenshots used for visual regression testing label Jul 15, 2026
@Lisa18289
Lisa18289 marked this pull request as draft July 15, 2026 13:05
@Lisa18289 Lisa18289 self-assigned this Jul 15, 2026
@Lisa18289 Lisa18289 added the update-screenshots Label a PR to update the screenshots used for visual regression testing label Jul 15, 2026
@github-actions github-actions Bot removed the update-screenshots Label a PR to update the screenshots used for visual regression testing label Jul 15, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🚀 Preview Deployment

Preview environments are ready:

Type URL
docs pr-2652.docs.review.flow-components.de
storybook pr-2652.storybook.review.flow-components.de

Images:

  • docs: ghcr.io/mittwald/flow/docs:pr-2652
  • storybook: ghcr.io/mittwald/flow/storybook:pr-2652

github-actions Bot and others added 2 commits July 15, 2026 13:15
Co-authored-by: Lisa18289 <84317589+Lisa18289@users.noreply.github.com>
preserveOrder should only drop the automatic slot sorting and the
abort-left/primary-right pole-split — not the spacing between actions. Move
the gap back onto the base .actionGroup so it applies in both modes; only
justify-content/flex-grow/order/margins stay under the .sorted modifier.
Update the docs wording accordingly.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@Lisa18289 Lisa18289 added the update-screenshots Label a PR to update the screenshots used for visual regression testing label Jul 15, 2026
@github-actions github-actions Bot removed the update-screenshots Label a PR to update the screenshots used for visual regression testing label Jul 15, 2026
@Lisa18289 Lisa18289 added the update-screenshots Label a PR to update the screenshots used for visual regression testing label Jul 15, 2026
@github-actions github-actions Bot removed the update-screenshots Label a PR to update the screenshots used for visual regression testing label Jul 15, 2026
github-actions Bot and others added 3 commits July 15, 2026 13:43
Co-authored-by: Lisa18289 <84317589+Lisa18289@users.noreply.github.com>
In preserveOrder mode ActionGroup no longer applies slot classes or the
abort/primary auto-margins, and the base group no longer forces
justify-content. Remove overrides that only existed to counteract that:

- IllustratedMessage: the `button { margin: 0 }` reset (no auto-margins to
  cancel anymore)
- Message: `justify-content: start` on the action group (now the flex
  default). The .actionGroupAction marker class is kept — it still
  distinguishes group buttons from standalone .action buttons.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The base ActionGroup only sets flex-grow:1 under the .sorted modifier, so in
preserveOrder contexts flex-grow is already the initial value 0. Remove the
now-redundant `flex-grow: 0` overrides on the action groups in LightBox,
LightBoxGallery and the List header.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@Lisa18289 Lisa18289 added the update-screenshots Label a PR to update the screenshots used for visual regression testing label Jul 15, 2026
@github-actions github-actions Bot removed the update-screenshots Label a PR to update the screenshots used for visual regression testing label Jul 15, 2026
Lisa18289 and others added 2 commits July 15, 2026 16:14
Drop the sentence about group alignment being up to the surrounding context.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Drop the trailing clause about spacing and left-to-right layout.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@Lisa18289 Lisa18289 added the update-screenshots Label a PR to update the screenshots used for visual regression testing label Jul 15, 2026
@github-actions github-actions Bot removed the update-screenshots Label a PR to update the screenshots used for visual regression testing label Jul 15, 2026
Lisa18289 and others added 3 commits July 16, 2026 08:12
…d row-gap

The action group's vertical spacing now comes from the ActionGroup's own gap
(spacing "m" = --size-px--m), which equals the previous
--light-box--spacing, so there is no visual change. Drop row-gap from the
shared .actions/.actionGroup rule and keep it only on .actions (which still
spaces the close button from the group).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Same as the LightBox change: the gallery item action group gets its vertical
spacing from the ActionGroup's own gap (spacing "m" = --size-px--m, equal to
the previous --light-box--spacing), so drop the dedicated row-gap. No visual
change.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@Lisa18289 Lisa18289 linked an issue Jul 16, 2026 that may be closed by this pull request
Lisa18289 and others added 2 commits July 16, 2026 09:15
Add a `size` prop on ActionGroup that propagates to the buttons and links
inside the group via its PropsContext, replacing the per-consumer
`ActionGroup: { Button: { size: "s" } }` pattern. Migrate Alert, the Section
header and Message to `ActionGroup: { size: "s" }`; links inside those groups
are now sized as well.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Document the new size prop: a Storybook story, a docs example plus an
"Größe" section on the ActionGroup page, and a remote visual test covering
size "s"/"m" with buttons and links.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@Lisa18289 Lisa18289 added the update-screenshots Label a PR to update the screenshots used for visual regression testing label Jul 16, 2026
@github-actions github-actions Bot removed the update-screenshots Label a PR to update the screenshots used for visual regression testing label Jul 16, 2026
github-actions Bot and others added 2 commits July 16, 2026 08:03
Co-authored-by: Lisa18289 <84317589+Lisa18289@users.noreply.github.com>
Give the link the "secondary" slot and make the size "m" group mirror the
size "s" group, so the screenshot compares identical content at both sizes.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@Lisa18289 Lisa18289 added the update-screenshots Label a PR to update the screenshots used for visual regression testing label Jul 16, 2026
@github-actions github-actions Bot removed the update-screenshots Label a PR to update the screenshots used for visual regression testing label Jul 16, 2026
Lisa18289 and others added 4 commits July 16, 2026 10:21
Co-authored-by: Lisa18289 <84317589+Lisa18289@users.noreply.github.com>
The stretch prop no longer exists after merging main; remove it from the
preserveOrder and size examples.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…iew-9b36b7' into claude/actiongroup-alignment-review-9b36b7
@Lisa18289 Lisa18289 added the update-screenshots Label a PR to update the screenshots used for visual regression testing label Jul 16, 2026
@github-actions github-actions Bot removed the update-screenshots Label a PR to update the screenshots used for visual regression testing label Jul 16, 2026
@Lisa18289
Lisa18289 marked this pull request as ready for review July 16, 2026 08:44
@Lisa18289
Lisa18289 enabled auto-merge (squash) July 16, 2026 08:45
Comment thread packages/components/src/components/ActionGroup/ActionGroup.tsx Outdated
Comment thread packages/components/src/components/ActionGroup/ActionGroup.tsx Outdated
Lisa18289 and others added 2 commits July 16, 2026 14:10
Address review feedback: type the size prop as ButtonProps["size"] instead
of duplicating the literal, and add size/preserveOrder to the
PropsContextProvider dependencies so the context updates when they change.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@Lisa18289
Lisa18289 merged commit a0f14f1 into main Jul 16, 2026
5 checks passed
@Lisa18289
Lisa18289 deleted the claude/actiongroup-alignment-review-9b36b7 branch July 16, 2026 13:17
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.

ActionGroup wrapping in Alert on mobile

2 participants