Repository navigation
feat(frontend): re-index saved documents from the dashboard - #54
Merged
Merged
Conversation
Add an explicit document indexing action with pending and retry feedback. Ignore late results after leaving the selected document, and capture offline browser and retrieval proof. 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 detail view now lets an operator re-index saved content without creating another document. It keeps the content visible, prevents repeated submission while pending, reports success or a safe retryable error, and ignores late results after leaving the selected document.
Part of #5. Closes #53.
Verification
All commands used a cleared inherited environment with
env -i HOME="$HOME" PATH="$PATH". This worktree has no root or backend.env; no real token was read or changed.UV_PYTHON=3.13 MISE_YES=1 mise run installpassed for backend, frontend and runtime. Generated lock-file changes were 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, 209 tests with 928 existing-library and fixture warnings.MISE_YES=1 mise run test-frontendpassed, 35 tests and 261 assertions, including 13 new cases covering explicit submission, duplicate clicks, HTTP 404/422/503 and network failures, retry, and late success/failure after selection, search, page and tab changes.MISE_YES=1 mise run test-runtimepassed, 7 offline tests.MISE_YES=1 mise exec -- bun frontend/node_modules/typescript/bin/tsc --noEmit -p frontend/tsconfig.jsonpassed using the installed TypeScript 5.9.3 compiler.UV_PYTHON=3.13 UV_FROZEN=1 MISE_YES=1 PYTHONPATH="$PWD/.tmp/offline:$PWD/backend" SLACK_BOT_TOKEN=xoxb-fixture-only SLACK_SIGNING_SECRET=fixture-only DATABASE_URL="sqlite:///$PWD/.tmp/offline/proof.db" mise run dev-backend -- --host 127.0.0.1 --port 18053reachedApplication startup complete, served the browser and curl requests, then reachedApplication shutdown completeafter Ctrl-C.MISE_YES=1 NEXT_PUBLIC_API_URL=http://127.0.0.1:18053 mise run dev-frontend -- --hostname 127.0.0.1 --port 3053served the changed dashboard for browser capture and was stopped afterwards.git diff --checkpassed. No migration is needed.Proof
Capture methods (a), (b) and (c) succeeded. No capture method was blocked.
The browser used the actual local API with temporary SQLite and local Chroma. The proof hook, copied to
.tmp/offline/sitecustomize.py, mocks Slack authentication, blocks Slack API calls and Socket Mode startup, and supplies fixed embeddings through the existing vector-store singleton. Afail-embeddingmarker injected the first failure and was removed before the browser retry.Review notes
This adds a UI for the existing indexing endpoint. It does not persist indexing status; the document list represents saved records. Leaving the view cancels the browser wait, but backend work already started can still finish. The UI explains this and the possible embedding cost. Provider and database details from errors are not displayed.
The existing management API access controls and indexing limitations still apply, including possible historical chunks without document ownership. No Slack message, live workspace connection, real token, remote database, model request or paid embedding request was used. Production embedding-provider behaviour remains unverified. A live Slack workspace is not needed for this slice. Parent #5 stays open; child #53 closes only when this PR merges.