Skip to content

fix: removed delete confirmation check dialogue#8417

Merged
jaycnz merged 4 commits intomainfrom
jaychen/nes-1013-existing-feature-improvement-delete-confirmation-check
Nov 27, 2025
Merged

fix: removed delete confirmation check dialogue#8417
jaycnz merged 4 commits intomainfrom
jaychen/nes-1013-existing-feature-improvement-delete-confirmation-check

Conversation

@jaycnz
Copy link
Contributor

@jaycnz jaycnz commented Nov 26, 2025

Summary by CodeRabbit

  • Updated Features

    • Block deletion now happens immediately on user action; confirmation dialog removed.
  • Documentation (Localization)

    • Removed card-deletion confirmation text and updated related labels; adjusted other cancellation/deletion strings.
  • Tests

    • Test suites updated to reflect immediate deletion flow (removed dialog interaction steps).

✏️ Tip: You can customize this high-level summary in your review settings.

@jaycnz jaycnz requested a review from edmonday November 26, 2025 00:53
@jaycnz jaycnz self-assigned this Nov 26, 2025
@jaycnz jaycnz added type: fix Iterations on existing features or infrastructure. effort: 1 labels Nov 26, 2025
@linear
Copy link

linear bot commented Nov 26, 2025

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 26, 2025

Walkthrough

The DeleteBlock confirmation dialog and its state/handlers were removed; delete actions now execute immediately. Tests were updated to stop interacting with a confirmation dialog and now assert the deletion mutation and cache changes directly. Locale entries for card deletion strings were removed or relocated.

Changes

Cohort / File(s) Summary
DeleteBlock component
apps/journeys-admin/src/components/Editor/Slider/Content/Canvas/QuickControls/DeleteBlock/DeleteBlock.tsx
Remove confirmation dialog import and state, remove open/close handlers, remove Typography and Dialog imports, and call delete mutation directly on user action (unified immediate delete flow).
Tests
apps/journeys-admin/src/components/Editor/Slider/Content/Canvas/QuickControls/DeleteBlock/DeleteBlock.spec.tsx
Remove waits/assertions and interactions targeting the "Delete Card?" confirmation dialog and "Delete" button; tests now assert the delete mutation invocation and cache state without dialog steps.
Locales
libs/locales/en/apps-journeys-admin.json
Remove card-deletion related keys ("Delete Card?", "Delete", "Cancel", "Are you sure you would like to delete this card?"); add/adjust unrelated keys (fonts/journeys sections) as shown in diff.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant DeleteBlock as DeleteBlock Component
    participant API as Delete Mutation
    participant Cache

    rect rgb(200,220,255)
    note over User,DeleteBlock: Before (old flow with confirmation)
    User->>DeleteBlock: Click delete
    DeleteBlock->>DeleteBlock: Open confirmation dialog
    User->>DeleteBlock: Confirm deletion
    DeleteBlock->>API: Call delete mutation
    API-->>Cache: Update cache
    end

    rect rgb(220,255,220)
    note over User,DeleteBlock: After (new immediate flow)
    User->>DeleteBlock: Click delete
    DeleteBlock->>API: Call delete mutation immediately
    API-->>Cache: Update cache
    end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Pay attention to: immediate-delete invocation sites and event handlers in DeleteBlock.tsx.
  • Verify tests fully cover cache updates and mutation error handling after removing confirmation.
  • Confirm no remaining unused locale keys or references to the removed dialog strings.

Possibly related PRs

Suggested reviewers

  • edmonday
  • jaco-brink

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: removing the delete confirmation dialog from the block deletion flow.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch jaychen/nes-1013-existing-feature-improvement-delete-confirmation-check

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 05ba9a6 and 4e5412d.

📒 Files selected for processing (1)
  • libs/locales/en/apps-journeys-admin.json (2 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-09-12T20:30:23.683Z
Learnt from: mikeallisonJS
Repo: JesusFilm/core PR: 7658
File: libs/locales/ms-MY/apps-watch.json:62-62
Timestamp: 2025-09-12T20:30:23.683Z
Learning: Interpolation spacing and localization fixes for i18n files are specific to journeys-admin context and may not apply to other apps like apps-watch.

Applied to files:

  • libs/locales/en/apps-journeys-admin.json
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: affected (22)
  • GitHub Check: lint (22)
  • GitHub Check: Analyze (javascript)
🔇 Additional comments (1)
libs/locales/en/apps-journeys-admin.json (1)

311-311: Locale string relocations align with deletion flow simplification.

The "Cancel" key (line 311) is appropriately positioned in the fonts settings section, and the "Delete" key (line 655) is properly grouped with journey-level deletion strings ("Delete Forever?" and related confirmation messaging). These generic action strings are well-suited for i18n reuse across contexts and support the removal of card-specific deletion dialogs.

Also applies to: 655-655


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@nx-cloud
Copy link

nx-cloud bot commented Nov 26, 2025

View your CI Pipeline Execution ↗ for commit 4e5412d

Command Status Duration Result
nx affected --target=build --base=b770e495ecd75... ✅ Succeeded 2m 36s View ↗
nx affected --target=codecov --base=b770e495ecd... ✅ Succeeded 3s View ↗
nx affected --target=test --base=b770e495ecd758... ✅ Succeeded 1m 14s View ↗
nx affected --target=test --base=b770e495ecd758... ✅ Succeeded 1m 18s View ↗
nx affected --target=test --base=b770e495ecd758... ✅ Succeeded 1m 14s View ↗
nx run-many --target=prisma-generate --all --pa... ✅ Succeeded 4s View ↗
nx affected --target=fetch-secrets --base=b770e... ✅ Succeeded 1s View ↗

☁️ Nx Cloud last updated this comment at 2025-11-26 02:47:54 UTC

@github-actions github-actions bot requested a deployment to Preview - journeys-admin November 26, 2025 00:54 Pending
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
apps/journeys-admin/src/components/Editor/Slider/Content/Canvas/QuickControls/DeleteBlock/DeleteBlock.tsx (1)

42-70: Consider removing the unnecessary fragment wrapper.

The fragment wrapper is no longer needed since it only contains a single child (the conditional render). Removing it would simplify the code.

Apply this diff to remove the fragment:

   return (
-    <>
-      {variant === 'button' ? (
-        <IconButton
-          id="delete-block-actions"
-          aria-label="Delete Block Actions"
-          aria-controls="delete-block-actions"
-          aria-haspopup="true"
-          aria-expanded="true"
-          disabled={disableAction}
-          onMouseUp={handleDeleteBlock}
-          sx={{
-            p: 1
-          }}
-        >
-          <Trash2Icon />
-        </IconButton>
-      ) : (
-        <MenuItem
-          label={t('Delete {{ label }}', {
-            label: blockType === 'Card' ? t('Card') : t('Block')
-          })}
-          icon={<Trash2Icon />}
-          disabled={disableAction}
-          onClick={handleDeleteBlock}
-        />
-      )}
-    </>
+    variant === 'button' ? (
+      <IconButton
+        id="delete-block-actions"
+        aria-label="Delete Block Actions"
+        aria-controls="delete-block-actions"
+        aria-haspopup="true"
+        aria-expanded="true"
+        disabled={disableAction}
+        onMouseUp={handleDeleteBlock}
+        sx={{
+          p: 1
+        }}
+      >
+        <Trash2Icon />
+      </IconButton>
+    ) : (
+      <MenuItem
+        label={t('Delete {{ label }}', {
+          label: blockType === 'Card' ? t('Card') : t('Block')
+        })}
+        icon={<Trash2Icon />}
+        disabled={disableAction}
+        onClick={handleDeleteBlock}
+      />
+    )
   )
 }
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between b770e49 and 05ba9a6.

📒 Files selected for processing (2)
  • apps/journeys-admin/src/components/Editor/Slider/Content/Canvas/QuickControls/DeleteBlock/DeleteBlock.spec.tsx (0 hunks)
  • apps/journeys-admin/src/components/Editor/Slider/Content/Canvas/QuickControls/DeleteBlock/DeleteBlock.tsx (4 hunks)
💤 Files with no reviewable changes (1)
  • apps/journeys-admin/src/components/Editor/Slider/Content/Canvas/QuickControls/DeleteBlock/DeleteBlock.spec.tsx
🧰 Additional context used
📓 Path-based instructions (3)
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (.cursor/rules/base.mdc)

**/*.{ts,tsx,js,jsx}: Use early returns whenever possible to make the code more readable.
Use descriptive variable and function/const names.
Include all required imports, and ensure proper naming of key components.

Files:

  • apps/journeys-admin/src/components/Editor/Slider/Content/Canvas/QuickControls/DeleteBlock/DeleteBlock.tsx
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/base.mdc)

Define a type if possible.

Files:

  • apps/journeys-admin/src/components/Editor/Slider/Content/Canvas/QuickControls/DeleteBlock/DeleteBlock.tsx
apps/**/*.{js,jsx,ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/apps.mdc)

apps/**/*.{js,jsx,ts,tsx}: Always use MUI over HTML elements; avoid using CSS or tags.
Use descriptive variable and function/const names. Also, event functions should be named with a “handle” prefix, like “handleClick” for onClick and “handleKeyDown” for onKeyDown.
Implement accessibility features on elements. For example, a tag should have a tabindex=“0”, aria-label, on:click, and on:keydown, and similar attributes.

Files:

  • apps/journeys-admin/src/components/Editor/Slider/Content/Canvas/QuickControls/DeleteBlock/DeleteBlock.tsx
🧠 Learnings (3)
📚 Learning: 2025-09-10T19:52:52.934Z
Learnt from: mikeallisonJS
Repo: JesusFilm/core PR: 7629
File: apis/api-journeys/schema.graphql:947-956
Timestamp: 2025-09-10T19:52:52.934Z
Learning: The canBlockHaveAction function in apis/api-journeys/src/app/modules/action/canBlockHaveAction/canBlockHaveAction.ts incorrectly includes 'MultiselectOptionBlock' in its allowlist, but MultiselectOptionBlock blocks should not have actions. Only MultiselectBlock (the container) should have actions, not the individual option blocks.

Applied to files:

  • apps/journeys-admin/src/components/Editor/Slider/Content/Canvas/QuickControls/DeleteBlock/DeleteBlock.tsx
📚 Learning: 2025-09-19T18:48:41.906Z
Learnt from: CR
Repo: JesusFilm/core PR: 0
File: apps/watch/AGENTS.md:0-0
Timestamp: 2025-09-19T18:48:41.906Z
Learning: Applies to apps/watch/**/*.{tsx} : Dialogs/Modals prefixed with 'Dialog', Sections with 'Section', Layout components with 'Layout'

Applied to files:

  • apps/journeys-admin/src/components/Editor/Slider/Content/Canvas/QuickControls/DeleteBlock/DeleteBlock.tsx
📚 Learning: 2025-09-19T18:48:41.906Z
Learnt from: CR
Repo: JesusFilm/core PR: 0
File: apps/watch/AGENTS.md:0-0
Timestamp: 2025-09-19T18:48:41.906Z
Learning: Applies to apps/watch/src/**/*.{tsx} : Navigation: design link-based content discovery through components

Applied to files:

  • apps/journeys-admin/src/components/Editor/Slider/Content/Canvas/QuickControls/DeleteBlock/DeleteBlock.tsx
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
  • GitHub Check: Deploy Preview (journeys-admin, 8417/merge, pull_request, 22)
  • GitHub Check: test (22, 3/3)
  • GitHub Check: test (22, 2/3)
  • GitHub Check: build (22)
  • GitHub Check: lint (22)
  • GitHub Check: Analyze (javascript)
🔇 Additional comments (2)
apps/journeys-admin/src/components/Editor/Slider/Content/Canvas/QuickControls/DeleteBlock/DeleteBlock.tsx (2)

3-3: LGTM: Import cleanup is correct.

The import statement now includes only ReactElement, which is appropriate after removing the confirmation dialog.


37-40: Based on my verification, I have found that the codebase has a comprehensive undo/redo system that fully addresses the concerns raised in the review comment. The DeleteBlock component integrates with useBlockDeleteCommand, which uses the command pattern to register delete operations with full undo capability.

Key findings:

  1. Undo mechanism exists: The useBlockDeleteCommand hook registers deletion commands with useCommand(), including both execute() and undo() implementations
  2. Block restore capability: A blockRestore mutation handles undoing deletions with proper state restoration
  3. Multiple undo methods available: Users can undo via:
    • Toolbar Undo button (CommandUndoItem)
    • Keyboard shortcut (Mod+Z)
    • Redo button (CommandRedoItem)
  4. Tests confirm functionality: DeleteBlock.spec.tsx includes test "should restore card on undo click" (line 380)

The immediate deletion without confirmation is safe and intentional, aligned with the PR title "fix: removed delete confirmation check dialogue". Users have full recovery capability through the built-in undo system.


Immediate deletion is intentional and safe due to built-in undo/redo mechanism.

The addBlockDelete function integrates with the command pattern (useBlockDeleteCommand hook) which automatically registers deletion operations with full undo capability. Users can recover deleted blocks via:

  • Toolbar Undo button
  • Keyboard shortcut (Ctrl+Z / Cmd+Z)
  • Redo button in toolbar

The command pattern ensures proper state management and restoration, making accidental data loss recoverable.

@github-actions github-actions bot temporarily deployed to Preview - watch-modern November 26, 2025 01:00 Inactive
@github-actions github-actions bot temporarily deployed to Preview - journeys-admin November 26, 2025 01:00 Inactive
@github-actions github-actions bot temporarily deployed to Preview - journeys November 26, 2025 01:00 Inactive
@github-actions github-actions bot temporarily deployed to Preview - videos-admin November 26, 2025 01:00 Inactive
@github-actions
Copy link
Contributor

The latest updates on your projects.

Name Status Preview Updated (UTC)
watch-modern ✅ Ready watch-modern preview Wed Nov 26 14:03:06 NZDT 2025

@github-actions
Copy link
Contributor

The latest updates on your projects.

Name Status Preview Updated (UTC)
journeys ✅ Ready journeys preview Wed Nov 26 14:03:29 NZDT 2025

@github-actions
Copy link
Contributor

The latest updates on your projects.

Name Status Preview Updated (UTC)
watch ✅ Ready watch preview Wed Nov 26 14:04:25 NZDT 2025

@github-actions
Copy link
Contributor

The latest updates on your projects.

Name Status Preview Updated (UTC)
journeys-admin ✅ Ready journeys-admin preview Wed Nov 26 14:05:36 NZDT 2025

@github-actions
Copy link
Contributor

The latest updates on your projects.

Name Status Preview Updated (UTC)
videos-admin ✅ Ready videos-admin preview Wed Nov 26 14:06:03 NZDT 2025

@jaycnz jaycnz added this pull request to the merge queue Nov 27, 2025
Merged via the queue into main with commit 01ce895 Nov 27, 2025
30 of 34 checks passed
@jaycnz jaycnz deleted the jaychen/nes-1013-existing-feature-improvement-delete-confirmation-check branch November 27, 2025 00:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

effort: 1 type: fix Iterations on existing features or infrastructure.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants