Skip to content

DataViews: Remove trash confirmation dialog for move-to-trash action - #82297

Open
shail-mehta wants to merge 6 commits into
trunkfrom
remove-trash-confirm-dialog-box
Open

DataViews: Remove trash confirmation dialog for move-to-trash action#82297
shail-mehta wants to merge 6 commits into
trunkfrom
remove-trash-confirm-dialog-box

Conversation

@shail-mehta

@shail-mehta shail-mehta commented Sep 1, 2026

Copy link
Copy Markdown
Member

What?

Closes #60383

Removes the confirmation dialog when moving posts and pages to the trash in DataViews (for example, Site Editor → Pages). Trashing now runs immediately, consistent with classic wp-admin.

Why?

Issue #60383 reported confusing trash/delete flows in the Site Editor pages list:

After #67824, permanent delete gained a confirm step, but the trash confirmation was never removed.
Moving to trash should not require confirmation; permanently deleting should.

How?

Refactored trashPost in @wordpress/fields from a modal action (RenderModal) to a callback action, matching restorePost

  • Trash runs on action click via callback.
  • Existing logic is preserved: deleteEntityRecord, success/error snackbars, and onActionPerformed.
  • Removed modal UI (RenderModal, Cancel/Trash buttons, and related modal props).

Testing Instructions

  1. Open the Site Editor.
  2. Go to Pages (list view).
  3. On a Published page, open the row Actions menu (⋯) and choose Trash.
  4. Confirm no confirmation dialog appears.
  5. Confirm the page moves to the Trash tab (for example, "Page title" moved to the trash.).
  6. Repeat with bulk select: select multiple pages → bulk Trash → no dialog; snackbar reflects the count.
  7. Open the Trash tab, choose Permanently delete on a trashed page.
  8. Confirm a confirmation dialog still appears with Cancel and Delete permanently.
  9. Confirm Permanent Delete Still works after Confirming.

Use of AI Tools

  • Yes (Cursor)

@shail-mehta shail-mehta self-assigned this Sep 1, 2026
@shail-mehta shail-mehta added [Type] Bug An existing feature does not function as intended [Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). [Feature] Site Editor Related to the overarching Site Editor (formerly "full site editing") labels Sep 1, 2026
@github-actions github-actions Bot added the [Package] Fields /packages/fields label Sep 1, 2026
@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown

🤖 PR meta 🤖

📦 Bundle size

Size Change: -137 B (0%)

Total Size: 7.91 MB

📦 View Changed
Filename Size Change
build/scripts/editor/index.min.js 582 kB -137 B (-0.02%)

cedfc62 Run

⚡ Performance

Show the results

Client side metrics exclude the server response time.

front-end-block-theme

Metric 9ccfc83 trunk % Change
timeToFirstByte 53 ms +5.94% -6.89% 51.1 ms +6.26% -6.56% 3.72%
largestContentfulPaint 80 ms +7.5% -5% 76 ms +5.26% -0% 5.26%
lcpMinusTtfb 26.9 ms +6.51% -1.67% 26.05 ms +14.97% -4.8% 3.26%
wpBeforeTemplate 27.73 ms +3.28% -14.46% 26.93 ms +2.93% -13.67% 2.97%
wpTemplate 20.81 ms +5.05% -1.83% 20.58 ms +6.8% -1.65% 1.12%
wpTotal 48.6 ms +3.37% -5.37% 47.21 ms +5.27% -5.91% 2.94%
wpMemoryUsage 7.54 MB +0% -0% 7.50 MB +0% -0% 0.46%
wpDbQueries 17 +0% -0% 17 +0% -0% 0%

front-end-classic-theme

Metric 9ccfc83 trunk % Change
timeToFirstByte 38.05 ms +11.17% -2.89% 40.5 ms +12.47% -7.65% -6.05%
largestContentfulPaint 76 ms +5.26% -5.26% 76 ms +7.89% -2.63% 0%
lcpMinusTtfb 37.9 ms +2.77% -7.26% 36.9 ms +3.12% -4.07% 2.71%
wpBeforeTemplate 19.51 ms +13.94% -1.69% 19.94 ms +22.32% -4.31% -2.16%
wpTemplate 15.55 ms +3.54% -3.22% 15.78 ms +6.53% -2.34% -1.46%
wpTotal 35.28 ms +11.9% -2.72% 36.58 ms +14.76% -5.93% -3.55%
wpMemoryUsage 6.16 MB +0% -0% 6.12 MB +0% -0% 0.58%
wpDbQueries 14 +0% -0% 14 +0% -0% 0%

media-processing

Metric 9ccfc83 trunk % Change
mediaProcessingJpeg 322.02 ms +1.46% -0.6% 327.1 ms +4.48% -1.2% -1.55%
mediaProcessingAvif 4981.76 ms +0.43% -0.03% 4964.93 ms +0.1% -0.17% 0.34%
mediaProcessingJpegToAvif 3579.12 ms +0.93% -1.18% 3547.07 ms +0.22% -0.6% 0.9%

media-upload

Metric 9ccfc83 trunk % Change
jpegUploadProcessing 1416.35 ms +1.26% -1.71% 1409.68 ms +0.99% -1.81% 0.47%
pngUploadProcessing 191.31 ms +2.33% -8.88% 194.41 ms +31.02% -5.91% -1.59%
largeJpegUploadProcessing 1405.65 ms +0.63% -0.27% 1400.34 ms +0.54% -0.73% 0.38%
multipleImageUploadProcessing 1459.84 ms +2.58% -0.55% 1488.13 ms +0.7% -0.67% -1.9%

post-editor

Metric 9ccfc83 trunk % Change
serverResponse 325.44 ms +6.91% -3.33% 347.49 ms +3.14% -8.58% -6.35%
firstPaint 175.16 ms +24.93% -11.47% 155.65 ms +14.31% -3.93% 12.53%
domContentLoaded 985.92 ms +2.68% -1.61% 1002.45 ms +3.44% -2.5% -1.65%
loaded 987.01 ms +2.67% -1.61% 1003.71 ms +3.45% -2.52% -1.66%
firstContentfulPaint 332.16 ms +2.49% -3.82% 330.18 ms +6.29% -3.71% 0.6%
firstBlock 2680.14 ms +0.51% -0.89% 2714.32 ms +1.54% -1.87% -1.26%
type 17.16 ms +10.49% -16.67% 17.83 ms +12.9% -19.8% -3.76%
typeWithoutInspector 18.02 ms +6.71% -26.8% 16.82 ms +17.54% -12.01% 7.13%
typeWithTopToolbar 19.09 ms +6.55% -19.07% 20.44 ms +5.68% -13.31% -6.6%
typeContainer 7.68 ms +5.99% -2.21% 8.45 ms +7.81% -5.8% -9.11%
focus 70.27 ms +9.36% -8.15% 70.38 ms +15.6% -3.96% -0.16%
firstFocus 147.33 ms +0% -0% 134.34 ms +0% -0% 9.67%
selectAll 473.13 ms +2.64% -1.94% 466.57 ms +3.39% -0.62% 1.41%
listViewOpen 52.25 ms +21.76% -1.07% 56.92 ms +8.47% -8.82% -8.2%
inserterOpen 19.69 ms +8.23% -8.58% 19.82 ms +2.22% -6.96% -0.66%
inserterHover 3.5 ms +15.71% -8.86% 3.79 ms +12.4% -16.36% -7.65%
inserterSearch 7.13 ms +4.21% -6.45% 7.11 ms +8.02% -9.42% 0.28%
loadPatterns 512.34 ms +3.58% -4.08% 533.6 ms +2.33% -3.74% -3.98%
wpTotal 316.57 ms +7.21% -3.32% 338.61 ms +3.26% -8.89% -6.51%
wpMemoryUsage 13.13 MB +0% -0% 13.10 MB +0% -0% 0.22%
wpDbQueries 54 +0% -0% 54 +0% -0% 0%

site-editor

Metric 9ccfc83 trunk % Change
serverResponse 560.65 ms +2.9% -3.53% 582.51 ms +0.6% -6.98% -3.75%
firstPaint 261.26 ms +23.66% -16.05% 232.76 ms +13.99% -6.14% 12.24%
domContentLoaded 1473.1 ms +1.76% -2.03% 1500.59 ms +0.91% -1.73% -1.83%
loaded 1474.54 ms +1.75% -2.03% 1501.9 ms +0.91% -1.72% -1.82%
firstContentfulPaint 461.58 ms +2.29% -1.2% 472.89 ms +3.61% -2.03% -2.39%
firstBlock 4677.2 ms +2.18% -1.52% 4707.61 ms +1.41% -0.38% -0.65%
type 23.04 ms +8.03% -23.61% 22.71 ms +16.2% -17.53% 1.45%
navigate 121.38 ms +4.35% -11.59% 111.78 ms +9.97% -1.75% 8.59%
loadPatterns 1472.54 ms +17.22% -4.53% 1420.47 ms +13.27% -7.92% 3.67%
loadPages 1215.11 ms +4.33% -2.46% 1644.21 ms +6.76% -22.98% -26.1%
wpTotal 550.91 ms +2.72% -3.66% 572.53 ms +0.58% -7.04% -3.78%
wpMemoryUsage 12.02 MB +0% -0% 11.99 MB +0% -0% 0.31%
wpDbQueries 43 +2.33% -0% 43 +2.33% -0% 0%

cedfc62 Run

@shail-mehta
shail-mehta marked this pull request as ready for review September 1, 2026 17:51
@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: shail-mehta <shailu25@git.wordpress.org>
Co-authored-by: annezazu <annezazu@git.wordpress.org>
Co-authored-by: ammar-mohamed-massoud <ammarmassoud@git.wordpress.org>
Co-authored-by: jameskoster <jameskoster@git.wordpress.org>
Co-authored-by: joedolson <joedolson@git.wordpress.org>
Co-authored-by: afercia <afercia@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

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

Labels

[Feature] Site Editor Related to the overarching Site Editor (formerly "full site editing") [Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). [Package] Fields /packages/fields [Type] Bug An existing feature does not function as intended

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Data Views: Pages: Improve clarity of the Trash and Permanently delete flows

1 participant