You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 Library projection contains only queries with zero Dashboard owners, computed across the complete Dashboard collection;
any query referenced by a tile is excluded from the Library, so the Library trash action cannot normally attempt to delete an owned query;
strict whole-workspace validation already rejects role, variant or query edits that would leave a tile invalid.
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;
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:
the Library projection excludes a query referenced by a tile on any Dashboard, not only the selected/compatibility Dashboard;
a Dashboard-owned query has no Library trash control;
deleting an ordinary zero-owner Library query still commits and reconciles linked tabs;
a query edit that would invalidate a Panel is rejected and leaves the workspace byte-identical;
repository search finds no production or test reference to planSavedQueryMutation, suggestRepairs, SavedQueryRepair, or remove-affected-tiles after removal.
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.tsstill has no production caller and explicitly documents an unsafe multi-Dashboard limitation:switch-variantis keyed only by tile ID even though tile IDs are Dashboard-local;suggestRepairsderives choices only from atilespath and is not mutation-specific, so it can advertise repairs that cannot fix the requested mutation;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.tstests/unit/saved-query-mutation.test.tsRemove 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:
Strengthen the current-model tests
Add or retain focused tests proving:
planSavedQueryMutation,suggestRepairs,SavedQueryRepair, orremove-affected-tilesafter removal.Tracking updates
Non-goals
Acceptance criteria
CHANGELOG.mdrecords the cleanup under[Unreleased].npm test,npx tsc --noEmit,npm run build, and applicable Playwright tests pass.