Skip to content

Add better deletion flow - #439

Merged
coffandro merged 2 commits into
mainfrom
deletion_flow
Aug 10, 2026
Merged

Add better deletion flow#439
coffandro merged 2 commits into
mainfrom
deletion_flow

Conversation

@coffandro

Copy link
Copy Markdown
Collaborator

No description provided.

Copilot AI left a comment

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.

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 new DeleteEntityModal that 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.

Comment thread webui/src/lib/utils/useDeleteFlow.svelte.ts
Comment thread webui/src/routes/stores/[store]/+page.svelte Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@coffandro
coffandro merged commit 5244e65 into main Aug 10, 2026
1 check passed
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.

2 participants