diff --git a/src/lib/project-revision.ts b/src/lib/project-revision.ts index d1251dd..04bb822 100644 --- a/src/lib/project-revision.ts +++ b/src/lib/project-revision.ts @@ -113,6 +113,7 @@ export async function reviseProjectRun(args: { run.origin = previous.origin; run.revisedFrom = previous.id; run.commentAuthorCoverage = previous.commentAuthorCoverage; + run.reviewAuthorCoverage = previous.reviewAuthorCoverage; run.mapping = plan.mapping; run.matchModes = Object.fromEntries(Object.entries(previous.matchModes ?? {}) .filter(([key]) => key in plan.mapping)); diff --git a/src/lib/velum-project.ts b/src/lib/velum-project.ts index a1e4202..492c969 100644 --- a/src/lib/velum-project.ts +++ b/src/lib/velum-project.ts @@ -30,6 +30,8 @@ export type ProjectRun = { revisedFrom?: string; /** Word comment authors were reviewed with the explicit author recognizer. */ commentAuthorCoverage?: boolean; + /** Word tracked-change authors and deleted text were reviewed. */ + reviewAuthorCoverage?: boolean; }; const DOCUMENTS = new Set([".docx", ".xlsx", ".pptx", ".pdf"]); diff --git a/src/pseudonymize-project-files.tsx b/src/pseudonymize-project-files.tsx index 0bb6ce9..4c19eeb 100644 --- a/src/pseudonymize-project-files.tsx +++ b/src/pseudonymize-project-files.tsx @@ -117,9 +117,10 @@ async function prepare(root: string, files: ProjectFile[], rules: ProjectRule[], for (const file of files) { const data = await fs.readFile(file.absPath); const hash = digest(data); - const recheckCommentAuthors = entityTypes.includes("PERSON") && file.kind === "document" - && extname(file.relPath).toLowerCase() === ".docx" && !latest?.commentAuthorCoverage; - if (!recheckCommentAuthors && previousDirectory && previousOutputs.has(file.relPath) + const recheckWordReviews = entityTypes.includes("PERSON") && file.kind === "document" + && extname(file.relPath).toLowerCase() === ".docx" + && (!latest?.commentAuthorCoverage || !latest?.reviewAuthorCoverage); + if (!recheckWordReviews && previousDirectory && previousOutputs.has(file.relPath) && await matchesPreviousOutput(previousDirectory, file.relPath, hash)) { retained.push({ file, hash }); continue; @@ -291,6 +292,7 @@ function HitReview(props: { root: string; rules: ProjectRule[]; whitelist: Proje run.mapping = mappingForSelection(props.preview.mapping, props.preview.previousMapping, acceptedHits, activeMerges); run.commentAuthorCoverage = props.preview.entityTypes.includes("PERSON"); + run.reviewAuthorCoverage = props.preview.entityTypes.includes("PERSON"); run.matchModes = props.preview.matchModes; run.sourceInPlace = props.preview.sourceInPlace || inPlace; const usedPaths = new Set(); @@ -432,7 +434,8 @@ function HitReview(props: { root: string; rules: ProjectRule[]; whitelist: Proje tintColor: selectedGroups.has(group.key) ? Color.Green : Color.SecondaryText }} title={group.original} subtitle={`→ ${group.placeholder}`} accessories={[{ text: `${group.hits.length} Vorkommen` }, - ...(group.hits.some((hit) => hit.source === "Kommentarautor") ? [{ text: "Word-Kommentator" }] : [])]} + ...(group.hits.some((hit) => hit.source === "Kommentarautor") ? [{ text: "Word-Kommentator" }] : []), + ...(group.hits.some((hit) => hit.source === "Änderungsautor") ? [{ text: "Word-Bearbeiter" }] : [])]} keywords={[type, labelForType(type)]} actions={ + onChange={setSelectedTypes} info="Die Auswahl wird beim Prüfen für diesen Projektordner gespeichert. Word-Kommentatoren und Bearbeiter von Änderungen werden mit der Kategorie Personen maskiert. Bei neuen Projekten sind Orte zunächst abgewählt."> {availableTypes.map((type) => )} diff --git a/src/velum.ts b/src/velum.ts index ac37351..768dd3f 100644 --- a/src/velum.ts +++ b/src/velum.ts @@ -143,7 +143,8 @@ export async function requireProjectCapabilities(): Promise { if (!response.ok) throw new Error("Die Velum-API muss für die Projektfunktionen aktualisiert werden."); const capabilities = await parseJsonResponse>(response); if (!capabilities.request_force_masks || !capabilities.document_hit_review - || !capabilities.document_restoration || !capabilities.comment_author_review) { + || !capabilities.document_restoration || !capabilities.comment_author_review + || !capabilities.revision_author_review) { throw new Error("Die Velum-API unterstützt die Projektfunktionen noch nicht vollständig."); } }