Skip to content

add confirmation dialogs for discard all variants#13

Merged
guitavano merged 3 commits into
mainfrom
rafavalls/discard-all-variants-btn
May 8, 2026
Merged

add confirmation dialogs for discard all variants#13
guitavano merged 3 commits into
mainfrom
rafavalls/discard-all-variants-btn

Conversation

@rafavalls
Copy link
Copy Markdown
Contributor

@rafavalls rafavalls commented May 8, 2026

Summary

  • Adds a confirmation AlertDialog before removing all section variants, preventing accidental destructive actions
  • Adds a "Discard all page variants" button with its own confirmation dialog to the page-level variant list header
  • Implements handleRemoveAllPageVariants which unwraps the multivariate page structure back to the default (always) variant and auto-saves

Test plan

  • Open a page with section-level variants, click the trash icon — confirm dialog appears before removal
  • Open a page with page-level variants, click the trash icon in the page variants header — confirm dialog appears, accepting reverts to single-version page and auto-saves
  • Cancel in either dialog leaves variants untouched

🤖 Generated with Claude Code


Summary by cubic

Add confirmation dialogs before discarding section or page variants to prevent accidental deletions. Adds a “Discard all page variants” action that unwraps to the default variant and auto-saves with a preview refresh.

  • New Features

    • Confirmation dialog when removing all section variants.
    • “Discard all page variants” button with confirmation in the page variants list header.
    • handleRemoveAllPageVariants unwraps to the default variant (prefers “always” rule, falls back to first), clears selection, auto-saves, and refreshes preview.
  • Refactors

    • Reformatted panel/header markup after adding a fragment wrapper (no behavior change).

Written for commit 537d664. Summary will update on new commits.

rafavalls and others added 3 commits May 8, 2026 13:55
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@rafavalls rafavalls force-pushed the rafavalls/discard-all-variants-btn branch from 4a22d4e to 537d664 Compare May 8, 2026 16:55
@guitavano guitavano merged commit 2a32d4c into main May 8, 2026
2 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