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({