Skip to content

🎨 Palette: Add confirmation for deleting sections#493

Closed
aafre wants to merge 1 commit into
mainfrom
palette-section-delete-confirmation-18413180632263056216
Closed

🎨 Palette: Add confirmation for deleting sections#493
aafre wants to merge 1 commit into
mainfrom
palette-section-delete-confirmation-18413180632263056216

Conversation

@aafre
Copy link
Copy Markdown
Owner

@aafre aafre commented Apr 24, 2026

💡 What: Added a ResponsiveConfirmDialog confirmation prompt before deleting a resume section.
🎯 Why: To prevent accidental data loss when users click the delete section button.
📸 Before/After: Before, clicking delete immediately removed the section. After, a standard, mobile-friendly confirmation dialog requires user confirmation.
♿ Accessibility: Leverages the existing ResponsiveConfirmDialog which handles proper role="dialog", ARIA attributes, and focus management.


PR created automatically by Jules for task 18413180632263056216 started by @aafre

Added ResponsiveConfirmDialog to SectionControls.tsx to prevent accidental deletion of resume sections.

Co-authored-by: aafre <8656674+aafre@users.noreply.github.com>
@google-labs-jules
Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a confirmation dialog for deleting sections within the SectionControls component. The review feedback points out a redundant state update in the deletion handler and identifies a missing focus trap in the ResponsiveConfirmDialog component, which is an important accessibility requirement.

Comment on lines 22 to +23
setSections(newSections);
setIsConfirmOpen(false);
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.

medium

The call to setIsConfirmOpen(false) is redundant here because the ResponsiveConfirmDialog component already calls its onClose prop (which updates this state) immediately after the onConfirm callback finishes. Additionally, since the section is being deleted, this component will likely be unmounted, making the state update unnecessary.

Suggested change
setSections(newSections);
setIsConfirmOpen(false);
setSections(newSections);

Comment on lines +66 to +75
<ResponsiveConfirmDialog
isOpen={isConfirmOpen}
onClose={() => setIsConfirmOpen(false)}
onConfirm={deleteSection}
title="Delete Section"
message="Are you sure you want to delete this section? This action cannot be undone."
confirmText="Delete Section"
cancelText="Cancel"
isDestructive={true}
/>
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.

medium

The ResponsiveConfirmDialog component does not implement a focus trap, which is required by the accessibility guidelines to ensure keyboard focus remains within the modal while it is open. Please update the ResponsiveConfirmDialog component to include a focus trap (e.g., using a library like react-focus-lock or manual focus management).

References
  1. For accessibility, all modals must implement a focus trap to ensure keyboard focus remains within the modal's focusable elements while it is open.

@aafre
Copy link
Copy Markdown
Owner Author

aafre commented May 25, 2026

Closing duplicate — the most recent version of this change is PR #543.

@aafre aafre closed this May 25, 2026
@google-labs-jules
Copy link
Copy Markdown
Contributor

Closing duplicate — the most recent version of this change is PR #543.

Understood. Acknowledging that this PR is a duplicate of PR #543 and work on this specific PR will be stopped.

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.

1 participant