Spaces:
Sleeping
Sleeping
harryagasi
[NOTICKET] feat(knowledge,analysis): add deletion confirmation, duplicate-name guard, and unusable-analysis lockout
3baad7e Quickstart: Verifying Knowledge Source Deletion Guardrails
Manual verification steps (no test framework configured in this project β see plan.md Testing).
Prerequisites
- Run the app:
pnpm dev(ornpm run devperpackage.jsonscripts) and sign in with a user that has at least:- One document knowledge source bound to at least one analysis
- One database knowledge source not bound to any analysis
- Two existing analyses with distinct names
User Story 1 β Deletion confirmation with impact preview
- Open the Knowledge menu, find a document bound to an analysis, click its delete icon.
- Verify a confirmation dialog opens (not a browser
confirm()popup) listing the bound analysis by name and a warning that it will become unusable. - Click Cancel β verify the document is still listed and no analysis state changed.
- Click delete again, click Confirm β verify the document disappears from the list.
- Delete a database source with no bound analyses β verify the dialog still appears but states no analyses will be affected.
- Click "Clear all" on documents with multiple docs (some bound to analyses) β verify the dialog lists the combined, deduplicated set of affected analyses.
User Story 2 β Duplicate analysis name guard
- Open "New Analysis", enter a title that exactly matches an existing analysis's title (try exact, then with different case/leading spaces).
- Verify submission is blocked and an inline message indicates the name is already in use.
- Change the title to something unique β verify the create button becomes usable and creation succeeds.
- Repeat step 1 with a different set of bound knowledge sources selected β verify the duplicate-name check still blocks submission the same way (FR-008).
User Story 3 β Unusable analysis after source deletion
- From User Story 1 step 4, open the analysis that was bound to the now-deleted document.
- Verify the existing "some bound sources are no longer available" banner is shown and now also states the analysis can no longer be used (this feature extends that banner rather than adding a new one).
- Verify: chat input textarea, Send button, Help button, and every suggested/recommended question button are disabled.
- Verify: the "Generate report" action is disabled.
- Verify: the "N sources" button and the banner's "Update binding" button are both disabled β clicking them does nothing, and the bound-data editor cannot be opened at all. This is intentional: per product decision, an unusable analysis has no in-app way to recover by re-binding a replacement source.
- Verify: existing chat messages are still visible/scrollable, and any previously generated report can still be opened and read.
- Try pressing Enter in the (disabled) chat textarea β verify no message is sent.
Regression checks
- An analysis with no bound sources at all still behaves exactly as before (not flagged unusable).
- An analysis with multiple bound sources where only one was deleted is still flagged unusable (any single missing source is sufficient).
- The Analysis sidebar list (
listAnalyses({ status: "active" })) still shows the unusable analysis β confirmingstatuswas not repurposed/changed by this feature.