Skip to content

feat: knowledge-graph datasets admin UI with paginated list (#532) - #821

Merged
Weegy merged 5 commits into
mainfrom
feat/532-datasets-admin-ui-v2
Aug 21, 2026
Merged

feat: knowledge-graph datasets admin UI with paginated list (#532)#821
Weegy merged 5 commits into
mainfrom
feat/532-datasets-admin-ui-v2

Conversation

@Weegy

@Weegy Weegy commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

What

Admin page web-ui/app/admin/datasets/ for Knowledge-Graph datasets: upload CSV, browse inferred schema + row preview, delete. Closes #532 — and with it the last open triage criterion of #430 ("deletable via admin UI"), whose backend shipped in #533.

Salvages the closed PR #598/#728 work (commit 1) and resolves every blocker from that review (commit 2):

  1. Real list pagination end-to-end — plugin-api listDatasets gains offset, new optional countDatasets (1.7.0 MINOR, API snapshot updated); implemented in neon + inmemory graphs, forwarded by the extras wrappers only when the inner graph supports it; GET /api/v1/datasets parses limit/offset (400 on invalid) and returns { items, totalMatched }. Datasets past the old 50-cap were invisible and undeletable — now paged.
  2. Stale-response guards — monotonic request ids for list + detail; one dataset's rows can no longer render under another's schema.
  3. Delete errors get their own slot (never dressed as a load failure) and resync the list; deleting the last row of the last page steps back a page.
  4. Owner-scoped copy, localized error headlines (never raw exception text), explicit i18n timeZone (kills per-row IntlError spam), page.tsx split into _components/ (<500-line rule).

Test plan

  • middleware: build, lint, typecheck green; full suite 7061 pass / 16 skipped / 0 fail (API-snapshot test regenerated for the additive surface)
  • middleware: new route tests (limit/offset passthrough, totalMatched, 400 on invalid query) + inmemory offset/count tests
  • web-ui: eslint 0 errors, tsc clean, i18n:check OK (3613 keys, en/de parity incl. ICU args)
  • web-ui vitest: 17 datasets-page tests incl. list paging (60-dataset fixture), step-back after delete, count-less fallback warning, delete-failure resync, stale-response race regression

Risk / blast radius

Low-medium. Interface change is additive (optional method + optional param, MINOR bump); route change is additive (totalMatched alongside items; new query params validated). UI is reachable only from the new admin route.

Completes #430 — after merge, #430 can be closed.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

SecurID and others added 5 commits August 21, 2026 09:49
#430 shipped the CSV dataset pipeline API-only and deferred the admin UI
its own triage criteria asked for ("deletable via admin UI"), so
upload/browse/delete has been curl-only since. Frontend-only change: the
five endpoints under /api/v1/datasets already existed and are untouched.

The row preview paginates server-side (limit/offset, 25 per page) rather
than fetching the table and slicing locally. A dataset holds up to
MAX_DATASET_ROWS (50 000) rows — pulling that into the DOM to show one
screenful is the case queryDatasetRows exists to prevent. The schema is
read once on open, so turning a page costs one request, not two.

GET /v1/datasets passes no limit, so listDatasets applies its default of 50
and the route offers no way to raise it. Hitting exactly 50 is
indistinguishable from "there are more", so the page says so instead of
letting the list end silently.

The import receipt surfaces privacyScan scanned/masked cell counts because
this path runs the same scan as chat-attachment auto-ingest: an operator
uploading customer data should be able to see that masking ran rather than
take it on trust.

The server ACL is owner-only, so the page lists only datasets the logged-in
account imported. That is stated in the UI copy — on an admin page a
silently personal subset would otherwise read as the instance's.

Dataset types are re-declared in _lib/api.ts rather than imported, since
web-ui does not build against the middleware workspace (same convention as
MemorableKnowledgeNode). Error copy maps the route's dataset.* codes
locally rather than via errorHelp.ts, whose coverage test scopes it to five
route files and fails on outside codes as orphans.

Closes #532.
- plugin-api 1.7.0 (MINOR, snapshot updated): listDatasets gains offset;
  new optional countDatasets — back-compat for external implementers
- neon + inmemory graphs implement offset/count; the three extras wrappers
  forward countDatasets only when the inner graph supports it (no
  fabricated totals — the UI falls back to an explicit cap warning)
- GET /api/v1/datasets parses limit/offset (400 on invalid) and returns
  { items, totalMatched } — datasets past the old 50-cap are now reachable
  and deletable from the admin UI (#598 review must-fix 1)
- web-ui: real prev/next list pagination with range copy (en+de); request
  guards so a stale detail/list response can never overwrite a newer one
  (#598 must-fix 2); delete failures get their own error slot and resync
  the list (#598 must-fix 3); empty last page steps back after delete
- non-ApiError failures render a localized headline, never the raw
  exception message; tooLarge copy parameterizes {maxMb}
- i18n request config sets an explicit timeZone (kills per-row IntlError)
- page.tsx split into _components/ to stay under the 500-line rule
- handoff doc: REST/interface sections updated to match
- tests: middleware route + inmemory pagination/count; web-ui list paging,
  step-back after delete, count-less fallback, delete-failure, stale race
…in-ui-v2

# Conflicts:
#	middleware/package-lock.json
@Weegy
Weegy merged commit 1ace3cc into main Aug 21, 2026
8 checks passed
@Weegy
Weegy deleted the feat/532-datasets-admin-ui-v2 branch August 21, 2026 08:38
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.

Knowledge Graph datasets: admin UI (upload/schema/delete page)

2 participants