feat(#365): frontend refinement for libraries and knowledge stores#366
Merged
NoveliaYuki merged 3 commits intoMay 10, 2026
Conversation
Removes the redundant "Create with Knowledge Store" button from the Libraries tab, repoints the KS-detail "Add Content" button at the same unified Create Knowledge wizard with the current KS pre-selected at Step 3, and surfaces an "Add Content" / "Add" title/button when the wizard is launched in that mode. Step 2 (Library Content) now runs for existing-library flows too so users can queue new files / URLs into an existing library and ingest them in a single pass; Step 4 picker merges pending uploads with existing items behind a "NEW" badge and persists deselect state across navigation. Step 3 highlights missing required fields in red, auto-expands the Advanced section when fields are empty, and falls back to a text input for the embedding model when the org's options endpoint returns no models for the chosen vendor. Pre-flight check in Step 5 aggregates duplicate-name conflicts for both library and KS into a single message; server errors (string and dict-shaped detail bodies, including the FR-10 delete-blocked-by-KS payload) now surface verbatim in dialogs instead of bare "Request failed with status code N". Delete-blocked modal lists referencing knowledge stores with item counts and inline "Remove from KS" buttons. Wizard's "Open Library" / "Open Knowledge Store" / "Create another" honour the user's choice instead of always navigating to the freshly-created KS. PDF and other non-text uploads through the wizard route to markitdown_import to match the Library Detail inline-upload behaviour. Library detail page silently refreshes after upload / import / delete so the panel no longer flashes back to the loading skeleton, and the page header uses leading-tight so descenders aren't clipped at the sm breakpoint.
… count
- creator_interface/library_router.py: raise GET /libraries/{id}/items
limit cap from le=100 to le=500 so the wizard's 200-item picker
request stops 422-ing.
- library-manager/backend/routers/content.py: same cap raised on the
underlying library-manager endpoint that the LAMB backend forwards
to (the previous bump was useless without this).
- creator_interface/knowledge_store_client.py: when the org has not
configured allowed_embedding_models for a vendor, fall back to the
vendor plugin's own ``model`` parameter default so the wizard's
Embedding model dropdown is never silently empty (which left Step 3
Next disabled with no actionable hint).
- lamb/database_manager.py: get_accessible_libraries now returns an
``item_count`` derived from a correlated subquery on
{prefix}library_items. Counts every status (pending / completed /
failed) so the Libraries list column matches what users see in the
detail view, instead of always rendering as 0.
- prettier: format the six files prettier flagged after the initial commits. - prettierignore: exclude static/config.js (runtime-generated copy of config.js.sample, not meant to be linted). - eslint: drop unused imports (`user`), unused locals (`result`), unused catch parameters, and the leftover ``openWizard`` shortcut on /libraries/+page.svelte. Convert ``new Set(...)`` to ``new SvelteSet(...)`` for the polling-side ``pendingItemIds`` so it reuses Svelte's reactive collection. Park the legitimate ``$state(new SvelteSet(...))`` patterns behind ``// eslint-disable-next-line svelte/no-unnecessary-state-wrap`` with a comment explaining the reassignment-needs-$state nuance. - jsdoc: extend the ``WizardState`` typedef with ``selectionInitialized`` so svelte-check no longer flags the new field as unknown.
Collaborator
Author
|
Pushed Test results on the post-fix-up state:
|
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.
Purpose
Refine the libraries and knowledge stores wizard UX after end-to-end testing on top of the kbserver-integration branch. Removes the duplicate "Create with Knowledge Store" entry point, unifies the KS-detail "Add Content" button with the same Create Knowledge wizard, fixes a cluster of correctness bugs surfaced during testing, and improves error surfacing throughout the flow.
Changes
Single wizard for both creation paths. The "Create with Knowledge Store" button on the Libraries tab is gone. The KS-detail "Add Content" button now mounts the same
CreateKnowledgeWizard, pre-filling Step 3 with the current KS viainitialState = { ksPath: 'existing', existingKsId, ksName }. The wizard's title and submit button are context-aware — "Add Content" / "Add" when an existing KS is targeted, "Create Knowledge" / "Create" otherwise. Step 2 (Library Content) is no longer skipped for existing-library flows, so users can queue new uploads into an existing library and ingest them in one pass; Step 4 picker merges pending and existing items behind a "NEW" badge.Wizard correctness. Three loaders (
loadLibraries,loadStores,loadOptions) now use a*Loadedsentinel instead oflength === 0to gate their$effect, ending the infinite-loop "Loading…" state when the API returned 0 rows. Thepathradio choice is dispatched intowizardStateimmediately so the draft persists the last-clicked option even if other validation hasn't passed. Step 4 selection state is gated by aselectionInitializedflag so Back/Next no longer re-checks deselected items. Step 3 auto-expands the Advanced section when required fields are empty and falls back to a text input for the embedding model when the org has noallowed_embedding_modelsconfigured (with the vendor plugin's declared default seeded server-side as a safety net). Step 5 pre-flight check aggregates duplicate-name conflicts (library + KS) into a single message instead of failing one-at-a-time.Server error surfacing. A
readableErrorhelper extracts FastAPI'sdetailpayload (string and dict shapes) at every error site that previously fell through to Axios's bare "Request failed with status code N" — Step 8 Review/Create, Step 1 / 3 loaders, the standalone Library modal, and the Library Detail upload/delete handlers. The FR-10 delete-blocked-by-KS response (dict-shaped detail) is now rendered in a dedicated section inside the confirmation modal: each referencing KS gets a row with item count and an inline "Remove from KS" button callingremoveContentso users can clear the references without leaving the dialog.Backend caps and fallbacks. The
/creator/libraries/{id}/itemscap wasle=100, but the wizard requestslimit=200for the picker — a mismatch that surfaced as 422 in Step 4. Cap raised tole=500on both the LAMB router and the underlying library-manager endpoint.get_org_optionsnow seedsembedding_models[vendor]with the vendor plugin's declaredmodeldefault when the org'sallowed_embedding_modelsis empty, so the dropdown is never silently empty.get_accessible_librariesreturns anitem_countfrom a correlated subquery onlibrary_itemsso the libraries list column reflects reality instead of always showing 0.UX polish. PDF / DOCX / etc. uploads through the wizard now route to
markitdown_importvia the samepluginForFileextension check the Library Detail page uses (the wizard previously always sentsimple_import, which 400'd on anything buttxt/md/html). Library detail refreshes after upload / import / delete are silent so the panel no longer flashes back to the loading skeleton. Wizard's Done step honours the user's choice between "Open Knowledge Store" / "Open Library" / "Create another" — both mounting points (/librariespage andKnowledgeStoreDetail) check the dispatchedtargetfield and route accordingly. Added two compact navigation shortcuts (Go to start,Go to review) in the wizard footer. Long descriptions clamp to 3 lines with full text in tooltip; the page header<h1>usesleading-tightso descenders aren't clipped at thesm:breakpoint.Related