Skip to content

An empty page says which step comes next - #321

Merged
WaylandYang merged 1 commit into
devfrom
feat/an-empty-state-points-at-the-next-step
Sep 4, 2026
Merged

WaylandYang merged 1 commit into
devfrom
feat/an-empty-state-points-at-the-next-step

Conversation

@WaylandYang

Copy link
Copy Markdown
Contributor

Part of #313 — the half that works every time, not only the first.

That issue proposes two things: a dismissible first-run checklist, and empty states that connect to the next action. This is the second one. The checklist only helps once; an empty state helps on the third knowledge base, and the first time someone opens Search. It also needs no per-user progress to store — every page already had the data, it just never asked.

The actual defect

Each page assumed it was already set up, so each said one fixed thing:

  • Graph told everyone to configure a model — including while documents were mid-extraction.
  • Chat showed its greeting whatever the state, so a deployment with no model at all looked ready. You found out by typing a question.
  • Search said nothing until you had searched, then answered "No results found" on a base with no documents in it.

GET /kbs/{id}/readiness is the one judgement all four now share: has_chat_model, documents, processing, failed, entities. Viewer-level, because anyone who can see a base should know whether it is empty or still working. Booleans and counts only — the model flag comes from workspace settings, which need workspace admin to read, so this says whether one is configured and never what it is.

Chat deliberately gates on the model alone. An empty base still answers from mounted databases and memory; a missing model is the only state where nothing can be asked.

The copy

Old: "The graph is empty. Configure a chat model under Administration → Models first, then upload documents in the Library — entities and relations are extracted automatically."

One sentence carrying a state, two actions and a paragraph of theory. The rule now is state in one line, action on the button, no theory — someone staring at an empty page wants to know where to click, and the theory belongs in the docs.

State Line Action
No model, admin No chat model yet. Configure model
No model, anyone else No chat model yet. Ask an administrator. —
No documents No documents yet. Upload a document
Working Reading 2 documents… View progress
Done, nothing found Nothing extracted yet. Open Library

Actions appear only for those who can take them, which is why the second row has no button.

The ontology page needed a rewrite, not an addition. Its empty schema read "No schema to display yet. Add a class on the left, or import an OWL/RDFS/Turtle file to get started" — presenting a class or an OWL file as the price of entry, which is precisely the barrier #313 describes. It now says "No classes yet. Extraction adds them as documents arrive", which is also what actually happens (0003 grows the ontology from the corpus, on by default). The New class and Import buttons stay in the rail for anyone who wants them. My first attempt added a reassuring second line underneath; two sentences arguing with each other is worse than one correct one, so it went.

Library is untouched. It was already right: whoever can upload sees the drop zone, which is the action itself, and whoever cannot sees one line. Changing it for symmetry would have been noise.

Verified

Walked all four states in a browser against a fresh install, advancing the base one step at a time and watching each page follow: no model → model configured → two documents in flight → extraction finished with an empty graph. Screenshots in the thread below.

cargo fmt --check, cargo clippy -D warnings, cargo test --workspace with UTOPIA_TEST_REQUIRE_DB=1, and pnpm build all pass.

Found while testing, not fixed here

The General base created at registration installs no ontology pack, while creating a base through the UI installs the ones you tick (schema.org by default). So the first base of every deployment — the one a new user lands in — starts with an empty vocabulary. Filed separately; it is a cause of what #313 describes rather than a copy change.

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Signed-off-by: WaylandYang <wayland0916@gmail.com>
@WaylandYang
WaylandYang force-pushed the feat/an-empty-state-points-at-the-next-step branch from efb31eb to 15e346e Compare September 4, 2026 20:59
@WaylandYang
WaylandYang merged commit 90e5c0a into dev Sep 4, 2026
@WaylandYang
WaylandYang deleted the feat/an-empty-state-points-at-the-next-step branch September 4, 2026 21:01
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.

1 participant