Skip to content

Remove obsolete saved-query repair planner and retire #429 repair phase #500

Description

@BorisTyshkevich

Part of #429 — final repair-planner decision after the direct Dashboard/Panel deletion work in #494.

Closes the remaining disposition from #449 and the surviving part of #431.

Decision

Delete planSavedQueryMutation / suggestRepairs; do not wire a repair dialog.

The planner was written before the current query-ownership and Dashboard-tree UX settled. Under the current model it is not the correct production path:

The exact #431 scenario — deleting a query from the Library while another Dashboard references it — is therefore no longer reachable through the current Library UI. The original “unreachable Dashboard” premise was already removed by the Dashboard tree. No automatic repair UI is required.

Why the existing planner must not be wired

src/dashboard/application/saved-query-mutation.ts still has no production caller and explicitly documents an unsafe multi-Dashboard limitation:

  • one repair object is applied to every Dashboard;
  • switch-variant is keyed only by tile ID even though tile IDs are Dashboard-local;
  • matching tile IDs in different Dashboards can therefore rewrite an unrelated tile;
  • suggestRepairs derives choices only from a tiles path and is not mutation-specific, so it can advertise repairs that cannot fix the requested mutation;
  • wiring it would duplicate Dashboard tree: replace overflow menus with direct Panel focus, edit and delete actions (#429 phase 4) #494’s ownership-safe direct delete commands with a second, broader mutation system.

Keeping the module and hundreds of tests after the product chose direct member deletion would leave fully-covered dead code and two competing ownership models.

Implementation

Remove dead planner code

Delete:

  • src/dashboard/application/saved-query-mutation.ts
  • tests/unit/saved-query-mutation.test.ts

Remove any remaining imports, exports, comments or current documentation that claim these functions are awaiting a production caller.

Do not rewrite historical release notes solely to erase that the planner once existed. Add an [Unreleased] correction stating that the unused repair planner was removed after direct ownership-safe Dashboard/Panel deletion became the supported UX.

Preserve the current safety boundary

Do not weaken deleteSaved, commitSavedQuery, workspace validation or query-ownership validation.

The supported behaviour remains:

  • Library trash deletes only a zero-owner Library query;
  • Panel trash is the way to delete a Panel-owned query;
  • Dashboard trash is the way to delete a Dashboard and its dedicated owned queries;
  • a role/variant/query edit that would invalidate a live Panel is rejected atomically with the workspace unchanged;
  • malformed or multiply-owned data remains fail-closed and is never auto-repaired.

Strengthen the current-model tests

Add or retain focused tests proving:

  1. the Library projection excludes a query referenced by a tile on any Dashboard, not only the selected/compatibility Dashboard;
  2. a Dashboard-owned query has no Library trash control;
  3. deleting an ordinary zero-owner Library query still commits and reconciles linked tabs;
  4. a query edit that would invalidate a Panel is rejected and leaves the workspace byte-identical;
  5. Dashboard tree: replace overflow menus with direct Panel focus, edit and delete actions (#429 phase 4) #494’s Panel/Dashboard trash commands remain the only paths that cascade from a Dashboard member to owned queries;
  6. repository search finds no production or test reference to planSavedQueryMutation, suggestRepairs, SavedQueryRepair, or remove-affected-tiles after removal.

Tracking updates

Non-goals

  • no repair dialog;
  • no automatic cross-Dashboard tile removal;
  • no query remapping UI;
  • no automatic variant switching;
  • no weakening of whole-workspace validation;
  • no guessed repair for malformed/shared ownership;
  • no change to the Library Query row’s normal edit, favourite or delete UX.

Acceptance criteria

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions