feat: run Velum project jobs in the background and process DOCX locally

This commit is contained in:
muena
2026-11-30 16:12:11 +01:00
parent 11ddd6d70f
commit d2ed7130f0
32 changed files with 2325 additions and 462 deletions

View File

@@ -24,6 +24,7 @@ import { ContextPicker, type ContextFormValues } from "./context-picker";
import { prepareTextInContext } from "./text-context";
import { TextHitReview } from "./text-hit-review";
import { getPreferences } from "./preferences";
import RelocateProjectCommand from "./relocate-project";
type FormValues = ContextFormValues & {
text: string;
@@ -33,6 +34,7 @@ type FormValues = ContextFormValues & {
export default function Command(props: { initialSource?: "selection" | "clipboard"; autoOutput?: boolean;
forcePaste?: boolean } = {}) {
const [text, setText] = useState("");
const [contextVersion, setContextVersion] = useState(0);
const [sessions, setSessions] = useState<VelumSession[]>([]);
const [activeSessionId, setActiveSessionId] = useState<string>();
const [entityTypes, setEntityTypes] = useState<EntityType[]>([]);
@@ -151,6 +153,8 @@ export default function Command(props: { initialSource?: "selection" | "clipboar
icon={Icon.EyeDisabled}
onSubmit={handleSubmit}
/>
<Action.Push title="Projektordner ändern" icon={Icon.Folder}
target={<RelocateProjectCommand onMoved={() => setContextVersion((version) => version + 1)} />} />
<Action
title="Markierten Text übernehmen"
icon={Icon.TextSelection}
@@ -171,7 +175,7 @@ export default function Command(props: { initialSource?: "selection" | "clipboar
onChange={setText}
placeholder="Zu pseudonymisierender Text"
/>
<ContextPicker sessions={sessions} activeSessionId={activeSessionId}
<ContextPicker key={contextVersion} sessions={sessions} activeSessionId={activeSessionId}
availableEntityTypes={entityTypes} onEntityTypesChange={setSelectedEntityTypes} />
{entityTypes.length > 0 ? (
<Form.TagPicker