Skip to content

fix(web): wire saved-template delete in New Project flow#2296

Open
nehaprasad-dev wants to merge 2 commits into
nexu-io:mainfrom
nehaprasad-dev:fix/svd-temp-del-prj
Open

fix(web): wire saved-template delete in New Project flow#2296
nehaprasad-dev wants to merge 2 commits into
nexu-io:mainfrom
nehaprasad-dev:fix/svd-temp-del-prj

Conversation

@nehaprasad-dev
Copy link
Copy Markdown

fix : #2237

why

  • Delete on New Project → From template did nothing (onDeleteTemplate not passed to the modal).

What users will see

  • Delete → confirm dialog → template removed on success.
  • Cancel keeps the template; failure shows an inline error.

Surface area

[x] UI
[x] i18n keys

Screenshots

  • New Project → From template → delete → confirmation dialog.

Bug fix verification

  • Test: apps/web/tests/components/NewProjectPanel.test.tsx
  • Red/green on main: not checked
  • Ran: web unit tests for that file

Validation

  • pnpm --filter @open-design/web test — NewProjectPanel
  • pnpm --filter @open-design/web typecheck

The delete button in From Template was a no-op because onDeleteTemplate
never reached the modal. Forward the callback through EntryShell and
NewProjectModal, confirm before DELETE, and show errors on failure.
@lefarcen lefarcen requested a review from mrcfps May 19, 2026 18:22
@lefarcen lefarcen added size/M PR changes 100-300 lines risk/medium Medium risk: regular code changes type/bugfix Bug fix labels May 19, 2026
Copy link
Copy Markdown
Contributor

@lefarcen lefarcen left a comment

Choose a reason for hiding this comment

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

Hi @nehaprasad-dev! Thanks for tying this directly back to #2237 — the user-facing delete flow and failure case are clear.

Quick PR-description cleanup before review continues: could you update the body into the current template shape so the Why, What users will see, Surface area, and Validation sections are recognized cleanly? You already have most of the right content; the main thing is to use the Surface area checklist format and mark UI / i18n keys there so reviewers can scope the change quickly.

Once that metadata is cleaned up, @mrcfps has been requested for the code review.

Copy link
Copy Markdown
Contributor

@mrcfps mrcfps left a comment

Choose a reason for hiding this comment

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

@nehaprasad-dev Thanks for wiring the saved-template delete flow back up through the New Project modal. I found one keyboard interaction regression that would be good to tighten up before merge.

🔁 Powered by Looper · runner=reviewer · agent=opencode · An autonomous AI dev team for your GitHub repos.

onClick={(e) => e.stopPropagation()}
role="alertdialog"
aria-modal="true"
data-testid="template-delete-confirm-dialog"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Opening this nested confirmation inside NewProjectModal introduces an Escape-key regression: while this dialog is open, pressing Escape still hits the parent modal's document-level handler and closes the entire New Project flow instead of just dismissing the delete confirmation. That drops any in-progress form state the user has already entered, so the new safety prompt becomes destructive for keyboard users. Please intercept Escape while confirmTarget is set (or temporarily suppress the parent handler) so Escape cancels only this dialog.

🔁 Powered by Looper · runner=reviewer · agent=opencode · An autonomous AI dev team for your GitHub repos.

Capture Escape while the nested template-delete dialog is open so the
parent modal handler does not close the whole flow and discard form data.
@nehaprasad-dev
Copy link
Copy Markdown
Author

@mrcfps please check the updates

@lefarcen lefarcen requested a review from mrcfps May 19, 2026 18:50
@lefarcen lefarcen added size/L PR changes 300-700 lines and removed size/M PR changes 100-300 lines labels May 19, 2026
Copy link
Copy Markdown
Contributor

@mrcfps mrcfps left a comment

Choose a reason for hiding this comment

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

@nehaprasad-dev I re-checked the saved-template delete flow end to end on the latest head: the callback is now wired through the modal, the nested confirmation keeps Escape scoped to the confirm instead of closing New Project, and the updated panel/modal tests cover the success, failure, and keyboard-dismiss paths. Thanks for tightening up both the fix and the follow-up regression coverage.

🔁 Powered by Looper · runner=reviewer · agent=opencode · An autonomous AI dev team for your GitHub repos.

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

Labels

risk/medium Medium risk: regular code changes size/L PR changes 300-700 lines type/bugfix Bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Saved templates cannot be deleted from New Project

3 participants