Skip to content

Preserve the current repeater draft when adding an item - #383

Merged
PercolatingStudio merged 1 commit into
mainfrom
codex/issue-319-preserve-repeater-edits
Nov 13, 2026
Merged

PercolatingStudio merged 1 commit into
mainfrom
codex/issue-319-preserve-repeater-edits

Conversation

@PercolatingStudio

Copy link
Copy Markdown
Owner

Fixes #319.

Reproduction

On the published 3.2.5 package with PrestaShop 9.1.4, select a FAQ question, type a new value without saving, then add another item. The current editing panel disappears and the draft is lost.

Fix

Do not call the selection-changing callback with an incomplete item ID before creating a repeater item. The existing ordinary refresh already preserves the active selection and form state. This keeps the draft in memory until the user's explicit Save, as permitted by the issue's expected behavior, without introducing automatic saves or a new draft system.

This is scoped to adding items; it does not change the usual behavior of leaving an unsaved form by navigation.

Thanks to @Daaaaad for the report.

Validation

  • Three new regression tests execute the real SFC add action in isolation with stubbed network/UI dependencies. All fail on the previous action and pass with the fix: same-parent add, failed request, and add to another parent. Included in the package build tests.
  • All 43 Node tests and the normal ZIP build pass. Exact local candidate SHA-256: 984cec95ad4cfac6189bc4ef20cd807028da4c499a5567408f6d619bd5e87646.
  • That exact ZIP installs and passes smoke/manifest/assets checks on PS 8.2.7/PHP 8.1.33 and PS 9.1.4/PHP 8.5.0.
  • Browser-tested both shops: type without saving, add, confirm the same form and text remain, explicitly Save, reopen and verify both the modified question and newly added item. A failed add request also leaves the draft intact and creates no item.
  • Native ZIP replacement on the existing disposable PS9.1 shop preserved the stored block rows (including config/state) and 16 hook registrations exactly; the browser regression passed again.
  • Local merge simulations show no conflicts with Disable sorting on PrettyBlocks action columns #380, Prevent stale saves from restoring deleted repeater items #381 or Separate the content hash in uploaded filenames #382.

No backend/schema changes, version bump, merge or release.

@PercolatingStudio
PercolatingStudio merged commit 70ae639 into main Nov 13, 2026
3 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.

Current repeater item is lost when adding a new item in PrettyBlocks

1 participant