Skip to content

feat(dashboard): add confirmation modal and toast notification for reset layout#3200

Open
deekshinowdu-collab wants to merge 1 commit into
Priyanshu-byte-coder:mainfrom
deekshinowdu-collab:feat/reset-layout-confirmation
Open

feat(dashboard): add confirmation modal and toast notification for reset layout#3200
deekshinowdu-collab wants to merge 1 commit into
Priyanshu-byte-coder:mainfrom
deekshinowdu-collab:feat/reset-layout-confirmation

Conversation

@deekshinowdu-collab

Copy link
Copy Markdown

Summary

This PR adds a confirmation dialog and success toast notification flow for the Reset Layout functionality in the Customizable Dashboard. This prevents accidental resets of customized dashboards by prompting the user with a ConfirmModal before resetting the layout in local storage and syncing with the database.

Closes #


Type of Change

  • 🐛 Bug fix (non-breaking change that fixes an issue)
  • ✨ New feature (non-breaking change that adds functionality)
  • 💥 Breaking change (fix or feature that changes existing behavior)
  • 📝 Documentation update
  • ♻️ Refactor / code cleanup (no functional change)
  • ⚡ Performance improvement
  • 🔒 Security fix
  • 🧪 Tests only

What Changed

  • CustomizableDashboard.tsx:
    • Imported ConfirmModal and toast from sonner.
    • Added isConfirmResetOpen boolean state to control modal visibility.
    • Implemented event handlers handleResetClick, handleResetConfirm, and handleResetCancel.
    • Passed handleResetClick to DashboardLayoutToolbar's onReset prop.
    • Rendered <ConfirmModal> at the bottom of the dashboard layout tree.

How to Test

  1. Click Edit Layout on the dashboard layout customization toolbar.
  2. Click the Reset Layout button (RotateCcw icon).
  3. Verify that the Reset Dashboard Layout confirmation modal appears, prompting you to reset or cancel.
  4. Click Reset in the modal.
  5. Verify that the layout is successfully restored to default coordinates, the modal closes, and a success toast notification appears.

Expected result:
The layout snaps back to its default configuration, and the user receives a success toast notification: "Dashboard layout has been reset to defaults."


Screenshots / Recordings

Before After

Checklist

  • Linked the related issue above
  • Self-reviewed my own diff
  • No unnecessary console.log, debug code, or commented-out blocks
  • npm run lint passes locally
  • No TypeScript errors (npm run type-check)
  • Added or updated tests where applicable
  • Updated documentation / comments if behavior changed

Accessibility (UI changes only)

  • Keyboard navigation works correctly
  • Color contrast meets WCAG AA standard
  • ARIA labels / roles added where needed
  • Tested on mobile / responsive layout

Additional Context

This is a GSSoC Level 1 (gssoc:level1) issue. It reuses existing styling and the pre-built ConfirmModal and sonner components to maintain project visual standards.

@github-actions

Copy link
Copy Markdown

Hi @deekshinowdu-collab — thanks for the PR! 🙌

DevTrack asks contributors to ⭐ star the repo before a PR can be merged. It takes two seconds and is the easiest way to support the project.

Once you've starred, the star-required check turns green automatically (give it a moment). Thanks for contributing!

@github-actions github-actions Bot added gssoc26 GSSoC 2026 contribution type:design GSSoC type bonus: UI/design (+10 pts) type:feature GSSoC type bonus: new feature type:bug GSSoC type bonus: bug fix type:performance GSSoC type bonus: performance (+15 pts) and removed gssoc26 GSSoC 2026 contribution labels Jul 13, 2026
@github-actions

Copy link
Copy Markdown

GSSoC Label Checklist 🏷️

@Priyanshu-byte-coder — please apply the appropriate labels before merging:

Difficulty (pick one):

  • level:beginner — 20 pts
  • level:intermediate — 35 pts
  • level:advanced — 55 pts
  • level:critical — 80 pts

Quality (optional):

  • quality:clean — ×1.2 multiplier
  • quality:exceptional — ×1.5 multiplier

Validation (required to score):

  • gssoc:approved — counts for points
  • gssoc:invalid / gssoc:spam / gssoc:ai-slop — does not score

Type labels (type:*) are auto-detected from files and title. Review and adjust if needed.
Points formula: (difficulty × quality_multiplier) + type_bonus

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type:bug GSSoC type bonus: bug fix type:design GSSoC type bonus: UI/design (+10 pts) type:feature GSSoC type bonus: new feature type:performance GSSoC type bonus: performance (+15 pts)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants