Skip to content

fix: switch delete to trash and add dialogue for forms#365

Merged
cataladev merged 1 commit intomainfrom
myNUTS
Feb 13, 2026
Merged

fix: switch delete to trash and add dialogue for forms#365
cataladev merged 1 commit intomainfrom
myNUTS

Conversation

@cataladev
Copy link
Contributor

@cataladev cataladev commented Feb 13, 2026

Why

The remove-response action in per-user form responses used a generic cross icon and deleted immediately on click. This made the destructive action less clear and increased risk of accidental deletions.

What

Issue(s):

  • N/A (no linked issue provided)

Changes made:

  • Updated the remove-response action icon from X to Trash2 in:
    • /Users/carlos/Development/forge/apps/blade/src/app/admin/forms/[slug]/responses/_components/PerUserResponsesView.tsx
  • Added a confirmation dialog before deleting a response.
    • Dialog includes:
      • Title: Delete Response
      • Warning text that the action is irreversible
      • Cancel and Delete actions
  • Preserved existing mutation behavior:
    • Shows loading spinner while deleting
    • Shows success/error toast
    • Invalidates responses query and refreshes router on success
    • Closes dialog on successful delete

Test Plan

  • Ran targeted lint:
    • pnpm --filter @forge/blade lint 'src/app/admin/forms/[slug]/responses/_components/PerUserResponsesView.tsx'
    • Result: pass
  • Ran app typecheck:
    • pnpm --filter @forge/blade typecheck
    • Result: pass

Checklist

  • Database: No schema changes, OR I have contacted the Development Lead to run db:push before merging
  • Environment Variables: No environment variables changed, OR I have contacted the Development Lead to modify them on Coolify BEFORE merging.

Summary by CodeRabbit

  • New Features

    • Added modal confirmation dialog for deleting responses, requiring explicit user confirmation before permanent removal.
    • Automatic cache refresh after successful deletion.
  • UI/UX Improvements

    • Updated delete button with new icon and refined interaction pattern.
    • Incorporated cancel option in confirmation flow; maintains loading states and error notifications throughout the process.

@coderabbitai
Copy link

coderabbitai bot commented Feb 13, 2026

📝 Walkthrough

Walkthrough

The delete button in PerUserResponsesView.tsx has been refactored to use a modal confirmation dialog instead of a direct action. The component now manages an isOpen state to control dialog visibility, displays a Trash2 icon trigger, and includes Cancel/Delete actions within the modal, while preserving existing error handling and cache refresh logic on successful deletion.

Changes

Cohort / File(s) Summary
Delete Confirmation Modal
apps/blade/src/app/admin/forms/[slug]/responses/_components/PerUserResponsesView.tsx
Refactored DeleteResponseButton component to replace inline delete button with Dialog-based confirmation flow. Added isOpen state for modal control, replaced X icon with Trash2, included Cancel/Delete action buttons, maintained loading spinner during mutation, and preserved cache refresh and error toast handling.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Suggested labels

Blade, Bug, Minor

🚥 Pre-merge checks | ✅ 5 | ❌ 2
❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Title check ⚠️ Warning The PR title does not include the required issue number in brackets format (e.g., [#365]); it only includes 'fix:' prefix, missing the mandatory identifier. Update the title to start with the issue number: '[#365] Fix: switch delete to trash and add dialogue for forms' to meet the requirement.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Merge Conflict Detection ✅ Passed ✅ No merge conflicts detected when merging into main
No Hardcoded Secrets ✅ Passed Reviewed PerUserResponsesView.tsx (408 lines) for hardcoded secrets including API keys, passwords, tokens, and credentials. No sensitive data found—only UI text and type constants.
Validated Env Access ✅ Passed Modified file PerUserResponsesView.tsx contains zero direct process.env usage, complying with validated env imports convention.
No Typescript Escape Hatches ✅ Passed No TypeScript escape hatches (any, @ts-ignore, @ts-expect-error, or non-null assertions) detected in the PR modifications.

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

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch myNUTS

No actionable comments were generated in the recent review. 🎉

Tip

Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord.


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

@cataladev cataladev self-assigned this Feb 13, 2026
@cataladev cataladev added the Blade Change modifies code in Blade app label Feb 13, 2026
@cataladev cataladev merged commit 5418605 into main Feb 13, 2026
7 of 8 checks passed
@cataladev cataladev deleted the myNUTS branch February 13, 2026 21:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Blade Change modifies code in Blade app

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant