mirror of
https://github.com/snapotter-hq/SnapOtter.git
synced 2026-08-03 07:46:42 +02:00
fix(files): record the source tool in toolChain on Save to Files (#435)
Save to Files posted only the blob, so userFiles.toolChain stayed null and the library showed "Tools Used: None". Thread the producing toolId through /api/v1/files/upload (validated optional field) and store it as a one-element toolChain, matching the pipeline path. Claude-Session: https://claude.ai/code/session_01UvVCMNUBrgpghk8gye5gav
This commit is contained in:
@@ -88,6 +88,9 @@ export function ReviewPanel({
|
||||
const res = await fetch(downloadUrl);
|
||||
const blob = await res.blob();
|
||||
const formData = new FormData();
|
||||
// Record which tool produced this file so the library shows it under
|
||||
// "Tools Used" (append before the file so the field is parsed first).
|
||||
if (currentToolId) formData.append("toolId", currentToolId);
|
||||
formData.append("file", new File([blob], filename, { type: fileType }));
|
||||
const uploadRes = await fetch("/api/v1/files/upload", {
|
||||
method: "POST",
|
||||
@@ -100,7 +103,7 @@ export function ReviewPanel({
|
||||
setSaveStatus("error");
|
||||
setTimeout(() => setSaveStatus("idle"), 3000);
|
||||
}
|
||||
}, [downloadUrl, filename, fileType]);
|
||||
}, [downloadUrl, filename, fileType, currentToolId]);
|
||||
|
||||
const hasBatchStats =
|
||||
totalCount != null && totalCount > 1 && successCount != null && failedCount != null;
|
||||
|
||||
Reference in New Issue
Block a user