Skip to content

feat(frontend): delete saved documents with confirmation - #58

Merged
johnnyhuy merged 2 commits into
mainfrom
agent/issue-57-dashboard-document-delete
Nov 16, 2026
Merged

johnnyhuy merged 2 commits into
mainfrom
agent/issue-57-dashboard-document-delete

Conversation

@johnnyhuy

Copy link
Copy Markdown
Contributor

The Documents tab can now delete a saved document after explicit confirmation of its title and ID. It prevents overlapping actions in the current detail view, offers retry after uncertain failures, and refreshes page one of the applied search when the record is removed or already absent.

Part of #5. Closes #57.

Verification

All mise commands ran with inherited variables cleared using env -i HOME="$HOME" PATH="$PATH". This worktree has no root, backend or frontend environment files. No real token was read or changed.

  • UV_PYTHON=3.13 MISE_YES=1 mise run install passed for all three codebases. Its incidental backend lock-file update was discarded; dependencies are unchanged.
  • UV_PYTHON=3.13 UV_FROZEN=1 MISE_YES=1 SLACK_BOT_TOKEN=xoxb-fixture-only SLACK_SIGNING_SECRET=fixture-only DATABASE_URL=sqlite:///.tmp-tests.db mise run test-backend passed, 221 tests with 1033 existing library and fixture warnings.
  • MISE_YES=1 mise run test-frontend passed, 51 tests and 370 assertions. The 16 new cases cover confirmation/cancellation and focus, duplicate clicks, mutual exclusion with re-indexing, a successful deletion or an already absent record, preserving the applied search while returning to page one, safe errors and retry, list refresh failures, and late successes/failures after selection, search, page or tab changes.
  • MISE_YES=1 mise run test-runtime passed, 7 offline tests.
  • From frontend, MISE_YES=1 mise exec -- bun ./node_modules/typescript/bin/tsc --noEmit passed using the installed project compiler. An initial supplemental check from the repository root resolved an older unrelated compiler; the command here corrected the invocation.
  • UV_PYTHON=3.13 UV_FROZEN=1 MISE_YES=1 PYTHONPATH="$PWD/.tmp/offline-dashboard-delete:$PWD/backend" SLACK_BOT_TOKEN=xoxb-fixture-only SLACK_SIGNING_SECRET=fixture-only DATABASE_URL="sqlite:///$PWD/.tmp/offline-dashboard-delete/proof.db" mise run dev-backend -- --host 127.0.0.1 --port 18057 reached Application startup complete, served the fixture requests, then reached Application shutdown complete after SIGINT.
  • MISE_YES=1 NEXT_TELEMETRY_DISABLED=1 NEXT_PUBLIC_API_URL=http://127.0.0.1:18057 mise run dev-frontend -- --hostname 127.0.0.1 --port 13057 reached ready and served the dashboard. Playwright CLI exercised the changed screen at desktop and 390-pixel widths. Both local servers and the browser were stopped afterwards.
  • git diff HEAD~2 --check passed. No migration is required.

Proof

Capture methods (a) and (b) succeeded. No capture path was blocked. Retrieval inspection provides additional fixture evidence; this slice does not change retrieval policy or the backend implementation.

The browser used the actual local API with SQLite and local Chroma. To reproduce the fixture process, create .tmp/offline-dashboard-delete/ and copy the existing .tmp/proof/document-delete-sitecustomize.py into it as sitecustomize.py, then use the backend command above with a fresh local proof database. The hook mocks Slack authentication, blocks Slack API calls and Socket Mode, and supplies fixed embeddings through the existing vector-store singleton. Seed two documents through the local API; the screenshots use a VPN guide and office hours. A fail-delete file in that directory injects the deletion outage; removing it lets the same confirmation succeed.

Review notes

HTTP 404 is treated as an already absent record, so a retry after a lost acknowledgement can recover. Other failures retain the confirmation and explain that some chunks may already have been removed. Leaving the detail view aborts browser waiting and ignores late results; backend deletion may still finish.

The current view prevents concurrent deletion and re-indexing, but other views, users and backend workers are not coordinated. The UI warns to wait for their indexing first. Historical unowned chunks and previous answers can retain the content. Existing management endpoints require trusted access controls and have no built-in authentication.

No Slack message, Socket Mode connection, remote database, model request or paid embedding request was used. No live Slack verification is needed. Parent #5 remains open; child #57 closes only on merge.

johnnyhuy and others added 2 commits November 16, 2026 21:24
Co-authored-by: OpenAI Codex <noreply@openai.com>
Co-authored-by: OpenAI Codex <noreply@openai.com>
@johnnyhuy
johnnyhuy merged commit 8efb707 into main Nov 16, 2026
10 checks passed
@johnnyhuy
johnnyhuy deleted the agent/issue-57-dashboard-document-delete branch November 16, 2026 14:18
@github-actions github-actions Bot mentioned this pull request Nov 16, 2026
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.

Delete a saved document from the dashboard with confirmation

1 participant