Repository navigation
feat(frontend): delete saved documents with confirmation - #58
Merged
Merged
Conversation
Co-authored-by: OpenAI Codex <noreply@openai.com>
Co-authored-by: OpenAI Codex <noreply@openai.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 installpassed 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-backendpassed, 221 tests with 1033 existing library and fixture warnings.MISE_YES=1 mise run test-frontendpassed, 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-runtimepassed, 7 offline tests.frontend,MISE_YES=1 mise exec -- bun ./node_modules/typescript/bin/tsc --noEmitpassed 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 18057reachedApplication startup complete, served the fixture requests, then reachedApplication shutdown completeafter 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 13057reached 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 --checkpassed. 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.pyinto it assitecustomize.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. Afail-deletefile 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.