Skip to content

UI: Delete saved dashboard view #437

Description

@TerrifiedBug

Problem

Saved dashboard views support Create, Update, and List in the UI (trpc.dashboard.createView and updateView in src/components/dashboard/view-builder-dialog.tsx + custom-view.tsx; listViews query), but Delete is missing.

dashboard.deleteView (src/server/routers/dashboard.ts:772) — withTeamAccess("VIEWER"), audited (dashboard.delete_view) — has no client caller, so users can accumulate saved views with no way to remove them.

Proposed solution

Add a Delete affordance to the saved-views UI (src/components/dashboard/custom-view.tsx):

  • A per-view delete control (menu item or trash icon) calling dashboard.deleteView with { environmentId, id }.
  • Confirm before delete; on success invalidate the ["dashboard","listViews"] query (same pattern the create/update mutations already use).

Alternatives considered

  • Leave deletion to a future bulk-management screen — overkill; the gap is one missing verb in an otherwise-complete CRUD surface.

Additional context

Completes CRUD for saved views. Input: { environmentId, id }. Mirror the onSuccess cache-invalidation already in view-builder-dialog.tsx.

Part of #431

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions