Skip to content

Feature/tabs 9.1.0#427

Merged
skerbis merged 19 commits into
mainfrom
feature/tabs-9.1.0-demos
May 22, 2026
Merged

Feature/tabs 9.1.0#427
skerbis merged 19 commits into
mainfrom
feature/tabs-9.1.0-demos

Conversation

@skerbis

@skerbis skerbis commented May 22, 2026

Copy link
Copy Markdown
Member

Version 9.1.1

Verbesserungen

  • Repeater-Decode mit Slot-IDMFormRepeaterHelper::decode() akzeptiert jetzt neben String-Payloads auch direkt numerische Value-Slots (z. B. decode(1)).
  • Klare API für Slot-basierten Zugriff – neue Methode MFormRepeaterHelper::decodeById(int $valueId) für die direkte Auflösung über den REDAXO-Value-Slot.
  • Form Builder Output aktualisiert – generierter Repeater-Output nutzt nun bevorzugt MFormRepeaterHelper::decode(<slot>) statt decode('REX_VALUE[...]').
  • Doku und Demo-Beispiele vereinheitlicht – Repeater-Beispiele wurden auf die bevorzugte Slot-ID-Variante umgestellt, die alte String-Nutzung bleibt kompatibel.

Summary by CodeRabbit

  • Neue Features

    • Tabs: moderner Stil, vertikales Layout, ID-freies Rendering; neue Tab-Optionen (Icon/Style/Layout)
    • Neue Formularfelder: Toggle-Checkbox, Alert-Varianten, Color-Swatch; Modal-Container
    • Form-Builder: Suchleiste, erweiterte Feldpalette, Palette-Feedback, Builder-State-Persistenz
  • Verbesserungen

    • Verbesserte ARIA-/Zugänglichkeit und stabileres Tab-Verhalten in verschachtelten Repeatern
    • Flexiblere Textumbruch-Styles in Formularansichten
    • Einheitlichere Repeater-Ausgabe-Generierung
  • Bug Fixes

    • Konsistente Checkbox-Serialisierung im Repeater
    • Persistenz-Reset bei „Alles löschen“ behoben
  • Dokumentation

    • Beispiele und Anleitungen aktualisiert: Repeater-Decode nun mit numerischen Slot-IDs; vereinheitlichte Demos und Referenzen

Review Change Stack

Copilot AI review requested due to automatic review settings May 22, 2026 20:21
@coderabbitai

coderabbitai Bot commented May 22, 2026

Copy link
Copy Markdown
Contributor

Warning

Rate limit exceeded

@skerbis has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 10 minutes and 31 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 8963f6dd-b973-4a61-af97-3d5b00a7eb84

📥 Commits

Reviewing files that changed from the base of the PR and between cc09ca8 and e0df12f.

📒 Files selected for processing (2)
  • docs/07_repeater.md
  • lib/MForm/Repeater/MFormRepeaterHelper.php

Moin

Walkthrough

Änderungspaket für MForm 9.1: Repeater‑Decode erweitert auf int|string mit decodeById, ID‑freies Tab‑Rendering (JS + Backend + CSS + ARIA), umfangreiche Form‑Builder‑Erweiterungen (Palette, neue Feldtypen, Modal), zahlreiche Template/Demo‑ und Dokumentationsanpassungen sowie Version‑Bump.

Changes

MForm 9.1 – Repeater, Tabs, Builder, Docs

Layer / File(s) Summary
Repeater Decode API and helpers
lib/MForm/Repeater/MFormRepeaterHelper.php, pages/module/*, docs/*
MFormRepeaterHelper::decode() akzeptiert `int
Tab JavaScript init & activation
assets/mform.js, assets/repeater.js
Eigenes Tab‑Management mit ARIA‑ID‑Linking, activateTab() und Click‑Delegation über data-mform-tab-toggle (ersetzt Bootstrap API).
Backend Tab rendering (ID‑free)
fragments/mform/mform_wrapper.php, lib/MForm/FlexRepeater/MFormFlexRepeaterRenderer.php
Rendering ersetzt ID‑Placeholder durch data-*‑Attribute, neue Auto‑Grouping‑Logik (needsTabAutoGrouping) und Cleaner für Tab‑Attribute.
Tab CSS variants & parser mapping
assets/css/mform.css, lib/MForm/Parser/MFormParser.php, lib/MForm/MFormElements.php
Neue CSS‑Varianten (modern/vertical), Dark Mode CSS‑Variablen; Parser normalisiert tab-style/tab-layoutdata-group-* und setzt Blockklassen.
Form Builder: palette, types, codegen
assets/js/formbuilder.js, pages/formbuilder.php
Palette‑Suche/Alias, neue Feldtypen (togglecheckbox, colorswatch, alert*), modal container support; Code‑Generator erweitert (parseColorSwatches, colorSwatchArray, flattenStructuralChildren, structure‑only items), persist/restore state.
CSS: wrapping & palette scrolling
assets/css/*
Ersetzt word-break: break-word durch overflow-wrap: anywhere an mehreren Stellen; Palette scroll/layout Regeln und colorSwatch help wrapping.
FlexRepeater JS: checkbox serialization
assets/js/flex-repeater.js
Checkbox set/collect/collectNested überarbeitet: Akkumulator für checked values, serialisiert als CSV per field key.
Docs, demos, changelog & langs
docs/*, CHANGELOG.md, lang/*.lang
Neue Section 9.1.0 im Changelog, API‑Referenz aktualisiert, viele docs Beispiele auf numeric decode umgestellt, neue demo modules und i18n keys ergänzt.
Module templates / output.inc updates
pages/module/*/output.inc, pages/module/*/input.inc
Zahlreiche module output includes auf decode(<int>) umgestellt; neue demo templates (tabs_modern_vertical, tabs_repeater_tabs) hinzugefügt.
Package version
package.yml
Version bumped von 9.0.19.1.1.

Sequence Diagram(s)

(Kein zusätzliches Diagramm in sichtbarem Bereich – relevante flows wurden im versteckten Review‑Artefakt visualisiert.)

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related issues

Possibly related PRs

Suggested reviewers

  • joachimdoerr
  • eaCe
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 30.36% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed Der Titel bezieht sich auf ein reales Merkmal der Änderung (Tabs 9.1.0/9.1.1), ist aber zu allgemein und deckt nicht den Kernpunkt ab: die Erweiterung von MFormRepeaterHelper::decode() für numerische Value-Slots sowie Tab-Varianten.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/tabs-9.1.0-demos

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Bumps MForm to 9.1.1 and standardizes Repeater decoding to support slot-id based access (decode(1)) while also rolling in the related Tabs/Form-Builder updates and documentation/demo alignments for the 9.1 line.

Changes:

  • MFormRepeaterHelper::decode() now accepts int|string and adds decodeById(int $valueId) for direct REDAXO value-slot decoding.
  • Tabs rendering was updated towards an ID-free/tab-scoped approach (PHP renderer + fragments + JS init), including optional tab-style/tab-layout handling.
  • Visual Form Builder palette/properties were extended (search, modal, alerts, toggle checkbox, color swatch) and docs/demos were updated accordingly.

Reviewed changes

Copilot reviewed 49 out of 49 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
pages/module/wrapper/tabs/output.inc Demo output switched to decode(<slot>) usage.
pages/module/wrapper/tabs_modern_vertical/output.inc New demo output for modern/vertical tabs wrapper.
pages/module/wrapper/tabs_modern_vertical/input.inc New demo input using tab-style / tab-layout attributes.
pages/module/wrapper/inline/output.inc Demo output switched to decode(<slot>).
pages/module/wrapper/columns/output.inc Demo output switched to decode(<slot>).
pages/module/wrapper/collapse/output.inc Demo output switched to decode(<slot>).
pages/module/wrapper/collapse_select/output.inc Demo output switched to decode(<slot>).
pages/module/wrapper/collapse_checkradio/output.inc Demo output switched to decode(<slot>).
pages/module/wrapper/accordion/output.inc Demo output switched to decode(<slot>).
pages/module/repeater/widgets_repeater/output.inc Demo output switched to decode(<slot>).
pages/module/repeater/tinymce_nested_repeater/output.inc Demo output switched to decode(<slot>).
pages/module/repeater/tabs_repeater_tabs/output.inc New nested demo output for “tabs → repeater in tab → tabs”.
pages/module/repeater/tabs_repeater_tabs/input.inc New nested demo input for “tabs → repeater in tab → tabs”.
pages/module/repeater/single_repeater/output.inc Demo output switched to decode(<slot>).
pages/module/repeater/nested_repeater/output.inc Demo output switched to decode(<slot>).
pages/module/repeater/copy_paste_repeater/output.inc Demo output switched to decode(<slot>).
pages/module/extended/placeholder/output.inc Demo output switched to decode(<slot>).
pages/module/expert/template_api/output.inc Demo output switched to decode(<slot>).
pages/module/expert/repeater_helper_api/output.inc Demo output switched to decode(<slot>).
pages/module/expert/html_form_elements/output.inc Demo output switched to decode(<slot>).
pages/module/expert/color_swatch_demo/output.inc Demo output switched to decode(<slot>).
pages/module/base/text/output.inc Demo output switched to decode(<slot>).
pages/module/base/select/output.inc Demo output switched to decode(<slot>).
pages/formbuilder.php Form Builder UI updated (palette search, additional palette items, additional properties).
package.yml Version bump to 9.1.1.
lib/MForm/Repeater/MFormRepeaterHelper.php Adds decodeById() and extends decode() signature to accept slot ids.
lib/MForm/Parser/MFormParser.php Adds tab layout/style class mapping and trims class concatenation for active.
lib/MForm/MFormElements.php Maps tab-layout / tab-style to data-group-* attributes for grouping.
lib/MForm/FlexRepeater/MFormFlexRepeaterRenderer.php Tab auto-grouping + ID-free tab markup for FlexRepeater rendering.
lang/en_gb.lang Adds labels for new demo modules.
lang/de_de.lang Adds labels for new demo modules.
fragments/mform/mform_wrapper.php Updates tab wrapper/tab nav markup to match new JS/tab scoping approach.
docs/ROADMAP_9.1_ISSUES.md Roadmap task list reorganized/updated.
docs/14_fragments_output.md Updates repeater decode examples to slot-id form.
docs/13_api_reference.md Updates API docs for new decode signature and tab options.
docs/11_tutorial_modul.md Updates tutorial repeater decode examples to slot-id form.
docs/08_mblock_migration.md Updates migration doc repeater decode examples to slot-id form.
docs/07_repeater.md Updates repeater docs for slot-id decode and ID-free tabs guidance.
docs/05_wrapper.md Documents optional tab variants (modern/vertical/icons).
docs/03_customlink.md Updates repeater decode usage in examples.
docs/00_whats_new.md Adds “Update 9.1” notes for tabs/form builder changes.
CHANGELOG.md Adds 9.1.1 section and includes 9.1.0 notes.
assets/repeater.js Updates repeater-context tab initialization to ID-free/tab-scoped toggling + ARIA linking.
assets/mform.js Updates general tab initialization to ID-free/tab-scoped toggling + ARIA linking.
assets/js/formbuilder.js Extends builder types (toggle checkbox, alerts, colorswatch, modal), palette search, and code generation.
assets/css/mform.css Adds styling for modern + vertical tab variants (incl. dark theme variables).
assets/css/list-widget.css Improves long text wrapping (overflow-wrap:anywhere).
assets/css/formbuilder.css Adds palette scroll/search UI and improves colorswatch help wrapping.
assets/css/flex-repeater.css Improves label wrapping (overflow-wrap:anywhere).

Comment thread assets/js/formbuilder.js
Comment thread pages/module/repeater/tabs_repeater_tabs/output.inc

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
docs/07_repeater.md (1)

67-68: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Moin – Signaturtabelle auf int|string aktualisieren.

Hier steht noch decode(string $rexValue), obwohl die Doku sonst bereits decode(1) zeigt. Das ist inkonsistent zur aktuellen API und kann bei der Nutzung verwirren. Bitte auf decode(int|string $source) anpassen.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/07_repeater.md` around lines 67 - 68, Update the signature in the docs
table to match the current API: replace the entry showing `decode(string
$rexValue)` with `decode(int|string $source)` so it reflects the actual accepted
types and parameter name; ensure the adjacent `prepareItemsForOutput(array
$items)` entry remains unchanged and the table formatting stays consistent.
🧹 Nitpick comments (1)
assets/mform.js (1)

193-270: 🏗️ Heavy lift

Moin – Tab-Initialisierung zentralisieren, um Drift zwischen Dateien zu vermeiden.

Die Logik in Line 193-270 ist nahezu identisch zu assets/repeater.js (Line 69-146). Bitte in einen gemeinsamen Helper auslagern, damit Fixes an einer Stelle landen und nicht auseinanderlaufen.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@assets/mform.js` around lines 193 - 270, Extract the duplicate
tab-initialization logic (ensureAriaLinking, activateTab, the click handler on
'[data-mform-tab-toggle]', and the final activation block that uses nav, panes,
wrapper, and data attribute 'data-mform-tab-toggle' /
'data-tab-group-nav-tab-id') into a single shared helper module/function and
replace the inline code in both locations with a call to that helper, passing
the wrapper/nav/panes or a container element; ensure the helper preserves the
existing behaviors (setting link/pane ids, aria-controls/aria-labelledby,
aria-selected, active class toggling) and rebinds the click namespace
'click.mformTabs' on the provided wrapper so both original call sites simply
invoke the new initializeTabs(container) helper.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@assets/js/formbuilder.js`:
- Around line 944-958: In renderCall(), there are two duplicate case
'togglecheckbox' labels causing the first (colorSwatchArray/parseColorSwatches)
branch to always capture togglecheckbox and the optionsArray/parseOptions branch
to never run; fix by making the first case only handle 'colorswatch' (remove
'togglecheckbox' from that case) so that item.type === 'togglecheckbox' falls
through to the branch that uses optionsArray(parseOptions(item.options)) and
phpStr(item.defaultValue) with attrPhp as intended (refer to parseColorSwatches,
colorSwatchArray, parseOptions, optionsArray, phpStr, attrPhp and the renderCall
function to locate the corrected switch).

In `@docs/00_whats_new.md`:
- Line 12: In the release doc line containing "Der Visual Form Builder
unterstuetzt diese drei Tab-Optionen ebenfalls in den Tab-Eigenschaften." fix
the user-facing typo by replacing "unterstuetzt" with the correct German umlaut
form "unterstützt" (and scan the same file for any other occurrences of
"unterstuetzt" to replace them as well).

---

Outside diff comments:
In `@docs/07_repeater.md`:
- Around line 67-68: Update the signature in the docs table to match the current
API: replace the entry showing `decode(string $rexValue)` with
`decode(int|string $source)` so it reflects the actual accepted types and
parameter name; ensure the adjacent `prepareItemsForOutput(array $items)` entry
remains unchanged and the table formatting stays consistent.

---

Nitpick comments:
In `@assets/mform.js`:
- Around line 193-270: Extract the duplicate tab-initialization logic
(ensureAriaLinking, activateTab, the click handler on '[data-mform-tab-toggle]',
and the final activation block that uses nav, panes, wrapper, and data attribute
'data-mform-tab-toggle' / 'data-tab-group-nav-tab-id') into a single shared
helper module/function and replace the inline code in both locations with a call
to that helper, passing the wrapper/nav/panes or a container element; ensure the
helper preserves the existing behaviors (setting link/pane ids,
aria-controls/aria-labelledby, aria-selected, active class toggling) and rebinds
the click namespace 'click.mformTabs' on the provided wrapper so both original
call sites simply invoke the new initializeTabs(container) helper.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: f2e4cf53-388d-423f-8268-3540906fbe7a

📥 Commits

Reviewing files that changed from the base of the PR and between af9d1a9 and 0751ccb.

📒 Files selected for processing (49)
  • CHANGELOG.md
  • assets/css/flex-repeater.css
  • assets/css/formbuilder.css
  • assets/css/list-widget.css
  • assets/css/mform.css
  • assets/js/formbuilder.js
  • assets/mform.js
  • assets/repeater.js
  • docs/00_whats_new.md
  • docs/03_customlink.md
  • docs/05_wrapper.md
  • docs/07_repeater.md
  • docs/08_mblock_migration.md
  • docs/11_tutorial_modul.md
  • docs/13_api_reference.md
  • docs/14_fragments_output.md
  • docs/ROADMAP_9.1_ISSUES.md
  • fragments/mform/mform_wrapper.php
  • lang/de_de.lang
  • lang/en_gb.lang
  • lib/MForm/FlexRepeater/MFormFlexRepeaterRenderer.php
  • lib/MForm/MFormElements.php
  • lib/MForm/Parser/MFormParser.php
  • lib/MForm/Repeater/MFormRepeaterHelper.php
  • package.yml
  • pages/formbuilder.php
  • pages/module/base/select/output.inc
  • pages/module/base/text/output.inc
  • pages/module/expert/color_swatch_demo/output.inc
  • pages/module/expert/html_form_elements/output.inc
  • pages/module/expert/repeater_helper_api/output.inc
  • pages/module/expert/template_api/output.inc
  • pages/module/extended/placeholder/output.inc
  • pages/module/repeater/copy_paste_repeater/output.inc
  • pages/module/repeater/nested_repeater/output.inc
  • pages/module/repeater/single_repeater/output.inc
  • pages/module/repeater/tabs_repeater_tabs/input.inc
  • pages/module/repeater/tabs_repeater_tabs/output.inc
  • pages/module/repeater/tinymce_nested_repeater/output.inc
  • pages/module/repeater/widgets_repeater/output.inc
  • pages/module/wrapper/accordion/output.inc
  • pages/module/wrapper/collapse/output.inc
  • pages/module/wrapper/collapse_checkradio/output.inc
  • pages/module/wrapper/collapse_select/output.inc
  • pages/module/wrapper/columns/output.inc
  • pages/module/wrapper/inline/output.inc
  • pages/module/wrapper/tabs/output.inc
  • pages/module/wrapper/tabs_modern_vertical/input.inc
  • pages/module/wrapper/tabs_modern_vertical/output.inc

Comment thread assets/js/formbuilder.js
Comment thread docs/00_whats_new.md

@coderabbitai coderabbitai Bot 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.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
assets/js/formbuilder.js (1)

1437-1448: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Moin – colorswatch wird hier mit dem falschen Parser kommentiert.

optionValuesComment() nimmt für colorswatch aktuell parseOptions(). Dadurch können die ausgegebenen „moegliche Werte“-Kommentare bei |preview-Syntax bzw. Zeilen ohne = irreführend sein.

Vorgeschlagene Korrektur
-            var opts = parseOptions(item.options || '');
+            var opts = item.type === 'colorswatch'
+                ? parseColorSwatches(item.options || '')
+                : parseOptions(item.options || '');
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@assets/js/formbuilder.js` around lines 1437 - 1448, The optionValuesComment()
block currently treats 'colorswatch' like other choice fields by calling
parseOptions(item.options || ''), which produces misleading "moegliche Werte"
comments for color-swatch preview/lines without '='; update
optionValuesComment() so that when item.type === 'colorswatch' it uses the
colorswatch-specific parser (e.g. parseColorSwatchOptions or the existing
color/swatch parser in the codebase) instead of parseOptions, and then format
the returned swatch entries into the same lines array (preserving the "moegliche
Werte:" header) so preview syntax and lines without '=' are handled correctly.
Ensure you reference the item.type === 'colorswatch' branch, replace the
parseOptions call with the color-swatch parser, and keep the rest of the lines
construction logic compatible with color entries.
🧹 Nitpick comments (1)
CHANGELOG.md (1)

12-17: ⚡ Quick win

Moin – Kompatibilitätsauswirkung der neuen Persistenz bitte explizit ergänzen.

Die 9.1.1-Einträge nennen die localStorage-Persistenz, aber nicht klar als Kompatibilitäts-/Verhaltensänderung (z. B. „kein Breaking Change, aber Entwürfe bleiben backend-seitenübergreifend erhalten“).

As per coding guidelines, "Update CHANGELOG.md with release-ready entries describing compatibility impacts when making relevant changes".

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@CHANGELOG.md` around lines 12 - 17, Add an explicit compatibility-impact
sentence to the 9.1.1 CHANGELOG.md entry: under the "Form Builder Persistenz
über Seitenwechsel" (and/or the "Persistenz-Reset im Form Builder") note, state
that this introduces localStorage-backed persistence across backend pages,
clarify it is not a breaking change but changes behavior (drafts remain
backend-page-crossing) and explain user-visible effects (e.g., drafts persist
across page switches and are cleared on "Alles loeschen" or when empty). Ensure
the wording mentions version 9.1.1 and references the existing bullets "Form
Builder Persistenz über Seitenwechsel" and "Persistenz-Reset im Form Builder" so
readers understand compatibility impact.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@assets/js/formbuilder.js`:
- Around line 1437-1448: The optionValuesComment() block currently treats
'colorswatch' like other choice fields by calling parseOptions(item.options ||
''), which produces misleading "moegliche Werte" comments for color-swatch
preview/lines without '='; update optionValuesComment() so that when item.type
=== 'colorswatch' it uses the colorswatch-specific parser (e.g.
parseColorSwatchOptions or the existing color/swatch parser in the codebase)
instead of parseOptions, and then format the returned swatch entries into the
same lines array (preserving the "moegliche Werte:" header) so preview syntax
and lines without '=' are handled correctly. Ensure you reference the item.type
=== 'colorswatch' branch, replace the parseOptions call with the color-swatch
parser, and keep the rest of the lines construction logic compatible with color
entries.

---

Nitpick comments:
In `@CHANGELOG.md`:
- Around line 12-17: Add an explicit compatibility-impact sentence to the 9.1.1
CHANGELOG.md entry: under the "Form Builder Persistenz über Seitenwechsel"
(and/or the "Persistenz-Reset im Form Builder") note, state that this introduces
localStorage-backed persistence across backend pages, clarify it is not a
breaking change but changes behavior (drafts remain backend-page-crossing) and
explain user-visible effects (e.g., drafts persist across page switches and are
cleared on "Alles loeschen" or when empty). Ensure the wording mentions version
9.1.1 and references the existing bullets "Form Builder Persistenz über
Seitenwechsel" and "Persistenz-Reset im Form Builder" so readers understand
compatibility impact.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 8c71a178-0535-4b07-8ba1-ffc349fb9555

📥 Commits

Reviewing files that changed from the base of the PR and between 0751ccb and 3cc03fc.

📒 Files selected for processing (3)
  • CHANGELOG.md
  • assets/js/flex-repeater.js
  • assets/js/formbuilder.js

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
docs/07_repeater.md (1)

274-293: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Moin, bitte die verpflichtenden Begleit-Dokus mitziehen (00_whats_new und 05_wrapper).

Hier werden nutzerrelevante Wrapper/Tab-Änderungen dokumentiert; laut Repo-Regel sollten dazu zusätzlich docs/00_whats_new.md und das thematische Gegenstück docs/05_wrapper.md aktualisiert werden.

As per coding guidelines "Add new user-relevant features to docs/00_whats_new.md and update topic-specific documentation files like docs/07_repeater.md and docs/05_wrapper.md".

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/07_repeater.md` around lines 274 - 293, Update docs/00_whats_new.md and
docs/05_wrapper.md to include the new Repeater wrapper/Tab capabilities
introduced in docs/07_repeater.md: summarize that FlexRepeater now supports
wrapper methods like addStartGroupTab/addTab/addCloseTab/addCloseGroupTab,
addTabElement, addCollapseElement/addStartGroupCollapse, addFieldsetArea,
addStartGroupInline, addStartGroupColumn/addColumn/addCloseGroupColumn, and
addModalElement; note ID-free tab rendering scoped by .mform-tabs and data
attributes (data-tab-item, data-tab-group-nav-tab-id, data-group-open-tab),
mention automatic grouping behavior when addTabElement is used without explicit
group, and add cross-reference links from 00_whats_new and 05_wrapper to the
detailed section in 07_repeater.md.
♻️ Duplicate comments (1)
assets/js/formbuilder.js (1)

1031-1045: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Moin, doppeltes case 'togglecheckbox' macht den korrekten Zweig unerreichbar.

Der erste togglecheckbox-Treffer landet im colorSwatchArray(parseColorSwatches(...))-Pfad und breakt sofort; der zweite togglecheckbox-Block mit optionsArray(parseOptions(...)) wird nie ausgeführt.

🔧 Vorschlag
-                case 'togglecheckbox':
                 case 'colorswatch': {
                     line += ', ' + colorSwatchArray(parseColorSwatches(item.options));
                     var hasDefaultColorValue = !!item.defaultValue;
                     if (attrPhp || hasDefaultColorValue) line += ', ' + (attrPhp || 'null');
                     if (hasDefaultColorValue) line += ', ' + phpStr(item.defaultValue);
                     break;
                 }
                 case 'togglecheckbox': {
                     line += ', ' + optionsArray(parseOptions(item.options));
                     var hasDefaultValue = !!item.defaultValue;
                     if (attrPhp || hasDefaultValue) line += ', ' + (attrPhp || 'null');
                     if (hasDefaultValue) line += ', ' + phpStr(item.defaultValue);
                     break;
                 }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@assets/js/formbuilder.js` around lines 1031 - 1045, The switch has a
duplicate case 'togglecheckbox' which causes the intended optionsArray branch to
be unreachable; remove 'togglecheckbox' from the first case group so that the
first block only handles 'colorswatch' (using
parseColorSwatches/colorSwatchArray) and the later case 'togglecheckbox' block
remains to handle optionsArray(parseOptions(...)) and defaultValue/phpStr logic
(references: colorSwatchArray, parseColorSwatches, optionsArray, parseOptions,
phpStr, attrPhp, item.defaultValue).
🧹 Nitpick comments (1)
lib/MForm/Repeater/MFormRepeaterHelper.php (1)

302-307: ⚡ Quick win

Moin, PHPDoc von decodeById() bitte auf Parameterebene vervollständigen.

Der neue öffentliche Parameter $valueId fehlt im PHPDoc (@param), obwohl die umliegenden Methoden konsistent dokumentiert sind.

🔧 Vorschlag
 /**
  * Decodes repeater data from the current slice by value slot id.
  *
+ * `@param` int $valueId
  * `@return` array<int, array<string, mixed>>
  */
 public static function decodeById(int $valueId): array

As per coding guidelines "Keep PHPDoc and type hints clean and consistent in PHP code".

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@lib/MForm/Repeater/MFormRepeaterHelper.php` around lines 302 - 307, Die
PHPDoc für die öffentliche Methode decodeById(int $valueId): array fehlt den
param-Eintrag; ergänze oberhalb der Funktion einen `@param` int $valueId Eintrag
mit kurzer Beschreibung (z. B. "ID des Value-Slots, dessen Repeater-Daten
decodiert werden sollen"), sodass die PHPDoc konsistent mit den umliegenden
Methoden ist und der vorhandene `@return-Typ` erhalten bleibt.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/07_repeater.md`:
- Line 67: The markdown table row for `decode(int|string $source)` contains
three pipe-separated cells causing MD056; edit the table line that includes the
`decode(int|string $source)` entry and remove the extra column separator so the
row has exactly two cells (left: the code/descriptor `decode(int|string
$source)`, right: the descriptive text about slot resolution/JSON/entity
decoding and filtering), ensuring the table header and other rows remain
consistent.

---

Outside diff comments:
In `@docs/07_repeater.md`:
- Around line 274-293: Update docs/00_whats_new.md and docs/05_wrapper.md to
include the new Repeater wrapper/Tab capabilities introduced in
docs/07_repeater.md: summarize that FlexRepeater now supports wrapper methods
like addStartGroupTab/addTab/addCloseTab/addCloseGroupTab, addTabElement,
addCollapseElement/addStartGroupCollapse, addFieldsetArea, addStartGroupInline,
addStartGroupColumn/addColumn/addCloseGroupColumn, and addModalElement; note
ID-free tab rendering scoped by .mform-tabs and data attributes (data-tab-item,
data-tab-group-nav-tab-id, data-group-open-tab), mention automatic grouping
behavior when addTabElement is used without explicit group, and add
cross-reference links from 00_whats_new and 05_wrapper to the detailed section
in 07_repeater.md.

---

Duplicate comments:
In `@assets/js/formbuilder.js`:
- Around line 1031-1045: The switch has a duplicate case 'togglecheckbox' which
causes the intended optionsArray branch to be unreachable; remove
'togglecheckbox' from the first case group so that the first block only handles
'colorswatch' (using parseColorSwatches/colorSwatchArray) and the later case
'togglecheckbox' block remains to handle optionsArray(parseOptions(...)) and
defaultValue/phpStr logic (references: colorSwatchArray, parseColorSwatches,
optionsArray, parseOptions, phpStr, attrPhp, item.defaultValue).

---

Nitpick comments:
In `@lib/MForm/Repeater/MFormRepeaterHelper.php`:
- Around line 302-307: Die PHPDoc für die öffentliche Methode decodeById(int
$valueId): array fehlt den param-Eintrag; ergänze oberhalb der Funktion einen
`@param` int $valueId Eintrag mit kurzer Beschreibung (z. B. "ID des Value-Slots,
dessen Repeater-Daten decodiert werden sollen"), sodass die PHPDoc konsistent
mit den umliegenden Methoden ist und der vorhandene `@return-Typ` erhalten bleibt.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: c7527985-18d1-4456-8c99-06b646f0dee4

📥 Commits

Reviewing files that changed from the base of the PR and between 3cc03fc and cc09ca8.

📒 Files selected for processing (4)
  • CHANGELOG.md
  • assets/js/formbuilder.js
  • docs/07_repeater.md
  • lib/MForm/Repeater/MFormRepeaterHelper.php
✅ Files skipped from review due to trivial changes (1)
  • CHANGELOG.md

Comment thread docs/07_repeater.md Outdated
@skerbis skerbis changed the title Feature/tabs 9.1.1 Feature/tabs 9.1.0 May 22, 2026
@skerbis skerbis merged commit 48f297d into main May 22, 2026
7 checks passed
@skerbis skerbis deleted the feature/tabs-9.1.0-demos branch May 22, 2026 21:14
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