Add better deletion flow - #439
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors the WebUI deletion UX into a single “redirect-first” delete flow that can optionally record UUID redirects (moved_from) on a chosen replacement entity before staging the deletion, and unifies delete handling across detail pages and child cards.
Changes:
- Introduces a shared delete-flow composable (
createDeleteFlow) and a newDeleteEntityModalthat supports redirect-first deletes (including variant two-step selection). - Adds an entity registry + redirect service to centralize per-entity CRUD adapters and implement “redirect + delete” staging with repo-identity normalization.
- Removes legacy delete/deprecate components and per-page delete modal state, updating routes and E2E/unit tests accordingly.
Reviewed changes
Copilot reviewed 21 out of 21 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| webui/src/routes/stores/[store]/+page.svelte | Switches store delete handling to the new delete flow + modal. |
| webui/src/routes/brands/[brand]/+page.svelte | Uses delete flow for brand deletion and material-card deletions (no navigation for cards). |
| webui/src/routes/brands/[brand]/[material]/+page.svelte | Uses delete flow for material deletion and filament-card deletions. |
| webui/src/routes/brands/[brand]/[material]/[filament]/+page.svelte | Uses delete flow for filament + variant-card deletions; removes deprecate modal usage. |
| webui/src/routes/brands/[brand]/[material]/[filament]/[variant]/+page.svelte | Uses delete flow for variant deletion with the new modal. |
| webui/src/lib/utils/useEntityDelete.svelte.ts | Removes the legacy delete-handler composable. |
| webui/src/lib/utils/useDeleteFlow.svelte.ts | Adds the new delete-flow composable that drives a single modal per page. |
| webui/src/lib/utils/entityState.svelte.ts | Removes delete modal state and deleting flags from shared page state. |
| webui/src/lib/utils/tests/useDeleteFlow.test.ts | Adds unit tests covering navigation vs child-card behavior and async identity resolution. |
| webui/src/lib/stores/changes.ts | Updates commentary around moved_from preservation for redirect-on-delete. |
| webui/src/lib/services/redirectService.ts | Adds redirect+delete staging and absorbMovedFrom, plus variant target loading. |
| webui/src/lib/services/entityRegistry.ts | Adds a central per-entity ops registry (get/save/href/identity normalization). |
| webui/src/lib/services/tests/redirectService.test.ts | Adds unit tests to keep TS redirect rules aligned with the Python implementation. |
| webui/src/lib/components/ui/index.ts | Exposes DeleteEntityModal and drops legacy delete/deprecate modal exports. |
| webui/src/lib/components/ui/EntityActionDropdown.svelte | Removes the deprecate action; updates delete menu labeling. |
| webui/src/lib/components/ui/DeprecateModal.svelte | Removes the old “deprecate & redirect” modal. |
| webui/src/lib/components/ui/DeleteEntityModal.svelte | Adds the new redirect-first delete modal (search + optional variant step). |
| webui/src/lib/components/ui/DeleteConfirmationModal.svelte | Removes the old confirmation-only delete modal. |
| webui/src/lib/components/entity/EntityCard.svelte | Updates delete action labeling to indicate a modal flow. |
| webui/e2e/flows/redirect-delete.spec.ts | Adds E2E coverage for redirect-first delete behavior and variant two-step selection. |
| webui/e2e/flows/crud-operations.spec.ts | Updates CRUD E2E flows to explicitly choose “delete without redirect” when needed. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.