From 7289dcc22c88c0c834d532ccac1cb2898c0b240a Mon Sep 17 00:00:00 2001 From: Victor Giers Date: Thu, 19 Mar 2026 21:24:20 +0100 Subject: [PATCH] Update LibraryManager.jsx to simplify job handling and improve UI messages --- src/LibraryManager.jsx | 56 +++++++++++++++++------------------------- 1 file changed, 22 insertions(+), 34 deletions(-) diff --git a/src/LibraryManager.jsx b/src/LibraryManager.jsx index 693eaa2..dfca0cf 100644 --- a/src/LibraryManager.jsx +++ b/src/LibraryManager.jsx @@ -2,9 +2,10 @@ import React, { useEffect, useState } from 'react' function statusLabel(job) { if (!job) return null + const type = job.type === 'prepare' ? 'prepare' : job.type const progress = typeof job.progress === 'number' ? `${job.progress.toFixed(0)}%` : null const detail = job.detail ? ` ${job.detail}` : '' - return `${job.type} · ${job.status}${progress ? ` · ${progress}` : ''}${detail}` + return `${type} · ${job.status}${progress ? ` · ${progress}` : ''}${detail}` } export default function LibraryManager({ @@ -110,30 +111,10 @@ export default function LibraryManager({ onDeleted?.(library.slug) } - async function startJob(kind) { - if (!library) return - try { - await runAction(async () => { - const endpoint = `${apiBase}/libraries/${library.slug}/jobs/${kind}` - const options = { - method: 'POST', - headers: { 'Content-Type': 'application/json' } - } - if (kind === 'embed') { - options.body = JSON.stringify({}) - } - const response = await fetch(endpoint, options) - await expectOk(response) - }) - } catch (error) { - setErrorMessage(String(error?.message || error)) - } - } - if (!library) { return (
-

Create a database, add files or folders, then build and index it for local RAG.

+

Create a database, add files, then add it to chat. Heimgeist will prepare retrieval automatically.

) } @@ -141,6 +122,7 @@ export default function LibraryManager({ const activeJobs = (jobs || []).filter(job => job.slug === library.slug && (job.status === 'queued' || job.status === 'running')) const usingInChat = chatLibrarySlug === library.slug const isPreparingForChat = pendingChatLibrarySlug === library.slug + const isReadyForChat = !!library.states?.is_indexed const canStartRename = () => { setRenameValue(library.name || '') setErrorMessage('') @@ -190,7 +172,7 @@ export default function LibraryManager({ {confirmDelete && (
-
Delete "{library.name}"? This removes the local index and metadata for this database.
+
Delete "{library.name}"? This removes the registered files and local retrieval data for this database.
- - -
{usingInChat && (
- This database will be queried before each chat request and its context will be appended to the prompt. + This database is attached to chat. Heimgeist retrieves relevant snippets before each message and appends them to the prompt.
)} {isPreparingForChat && (
- Preparing this database for chat. Heimgeist will build and index it automatically. + Preparing this database for chat. Heimgeist is reading files, enriching content, and building search indexes automatically.
)} - {!library.states?.is_indexed && !usingInChat && !isPreparingForChat && ( + {!library.files?.length && !usingInChat && !isPreparingForChat && (
- Use In Chat will prepare this database automatically if it is not ready yet. + Add files to make this database available in chat. +
+ )} + + {library.files?.length > 0 && !isReadyForChat && !usingInChat && !isPreparingForChat && ( +
+ Add To Chat will prepare this database automatically before it is used.
)}