From 4b8b675a6448bcb39fbcbfc962b9b3243cfa8b58 Mon Sep 17 00:00:00 2001 From: davegilligan Date: Mon, 25 May 2026 08:40:39 +0200 Subject: [PATCH] redact: unify save to single 'Save to My Docs' button; fix DOCX content type MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Remove js-save-corpus button from redact output (was failing with 'no_workspace' for users without a linked CaveauAI workspace) - Single save path now goes through showSaveResultButton() → api/case/save-result.php, which works for all paid (Plus/Pro) users without workspace dependency - Relabel 'Save result' → 'Save to My Docs' and update success message - Fix DOCX: contentTypesXml() had wrong ContentType for docProps/core.xml (application/package/... → application/vnd.openxmlformats-package.core-properties+xml); Word validates this strictly and was rejecting the file Co-Authored-By: Claude Sonnet 4.6 --- api/redact-download.php | 2 +- assets/js/tools.js | 7 ++----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/api/redact-download.php b/api/redact-download.php index 0b77db5..5fdaa9f 100644 --- a/api/redact-download.php +++ b/api/redact-download.php @@ -88,7 +88,7 @@ function contentTypesXml(): string . '' . '' . '' - . '' + . '' . ''; } diff --git a/assets/js/tools.js b/assets/js/tools.js index 9eda1c6..7647ad7 100644 --- a/assets/js/tools.js +++ b/assets/js/tools.js @@ -1551,13 +1551,10 @@ function renderMainFinding(data) { ? `` : ''; - const sourceDocIds = lastToolPayload?.doc_ids?.join(',') || ''; - const suggestedTitle = `Redacted document — ${new Date().toLocaleDateString()}`; const dlRow = `
-
`; return `${viewToggle}
${highlightRedactedText(lastRedactedText)}
${inventoryHtml}${upgradeBtn}${dlRow}`; @@ -2506,7 +2503,7 @@ function showSaveResultButton(tool, inputPayload, outputPayload, meta, container widget.className = 'save-result-widget'; widget.innerHTML = `
- +
`;