diff --git a/src/LibraryManager.jsx b/src/LibraryManager.jsx index cc42ffe..bbbb703 100644 --- a/src/LibraryManager.jsx +++ b/src/LibraryManager.jsx @@ -14,13 +14,14 @@ function fileSyncMeta(file) { const progress = Math.max(0, Math.min(100, Number(sync.progress) || 0)) const detail = String(sync.detail || '').trim() const error = String(sync.error || '').trim() + const enrichEnabled = !!file?.enrich_enabled if (status === 'ready') { return { status, progress: 100, label: 'Available', - detail: detail || 'Ready in chat.' + detail: detail || (enrichEnabled ? 'Ready in chat with enrichment enabled.' : 'Ready in chat with raw indexing only.') } } @@ -118,6 +119,22 @@ export default function LibraryManager({ } } + async function updateFileEnrichment(rel, enabled) { + if (!library) return + try { + await runAction(async () => { + const response = await fetch(`${apiBase}/libraries/${library.slug}/files/enrichment`, { + method: 'PATCH', + headers: { 'Content-Type': 'application/json' }, + body: JSON.stringify({ rel, enabled }) + }) + await expectOk(response) + }) + } catch (error) { + setErrorMessage(String(error?.message || error)) + } + } + async function deleteLibrary() { if (!library) return await runAction(async () => { @@ -192,6 +209,9 @@ export default function LibraryManager({
Files: {library.files?.length || 0}
+
0 ? 'ready' : ''}`}> + Enrich: {library.states?.enrichment_enabled_files || 0} +
{isSyncing ? 'Syncing' : isReadyForChat ? 'Ready' : library.files?.length ? 'Needs sync' : 'No data yet'}
@@ -209,6 +229,12 @@ export default function LibraryManager({
)} + {!!library.files?.length && !isSyncing && ( +
+ Raw indexing is the default fast path. Turn on enrichment only for files that need better summaries, entities, and semantic recall. +
+ )} + {hasFailedFiles && !isSyncing && (
Some files did not finish syncing. Their tiles show the failure state and error details. @@ -236,6 +262,9 @@ export default function LibraryManager({
{file.name || file.path}
{file.path}
+
+ {file.enrich_enabled ? 'Enrichment on' : 'Raw only'} +
{sync.label} @@ -257,8 +286,15 @@ export default function LibraryManager({
+ - +
)