Skip to content

fix(widget-list): restore controls for erroneous typed items - #7988

Open
sridharkalaibala wants to merge 1 commit into
decaporg:mainfrom
sridharkalaibala:7973-fix-erroneous-list-controls
Open

fix(widget-list): restore controls for erroneous typed items#7988
sridharkalaibala wants to merge 1 commit into
decaporg:mainfrom
sridharkalaibala:7973-fix-erroneous-list-controls

Conversation

@sridharkalaibala

Copy link
Copy Markdown

Summary

Fixes #7973. Editors can once again remove list items whose type is missing or unknown, while respecting the list's allow_remove and allow_reorder settings.

The erroneous-item path now passes those flags to the real top bar. It also passes the click event correctly to handleRemove (the old extra key argument would make clicking the restored button throw at event.preventDefault()) and uses the list's stored key as the sortable row and handle ID.

Test plan

  • Added six React Testing Library tests using the real list and top-bar components. They click Remove for missing/unknown types, verify the updated value, and check all removal/reorder permission combinations.
  • Before the fix, five of these six regression cases failed; all pass after the fix.
  • pnpm test passed: repository lint, formatting, TypeScript check, four Cypress-runner tests, and Jest (113 passing suites, 1,390 passing tests, 138 passing snapshots; 2 suites and 1,304 tests skipped by the existing suite).
  • List-widget suite: 37 tests and 11 snapshots passed.
  • Final focused ESLint and Prettier checks passed.

Validated on Windows with Node 24 and pnpm 11.12.0. Browser drag gestures and the full Cypress E2E suite were not run; control rendering and deletion are exercised in jsdom. No dependency or lockfile changes.

Prepared with AI assistance and validated locally.

Checklist

@sridharkalaibala
sridharkalaibala requested a review from a team as a code owner September 11, 2026 18:40
@netlify

netlify Bot commented Sep 11, 2026

Copy link
Copy Markdown

Deploy Preview for decap-cms ready!

Name Link
🔨 Latest commit f3578f8
🔍 Latest deploy log https://app.netlify.com/projects/decap-cms/deploys/6aa44b22c7bf45000808fa7e
😎 Deploy Preview https://deploy-preview-7988--decap-cms.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

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.

List items that lose their type cannot be removed — the delete button is not rendered

1 participant