feat(tools)!: SnapOtter 2.0 phase 4 wave 1: 45 core tools across all modalities (#219)

This commit is contained in:
SnapOtter
2026-06-13 10:18:49 +08:00
parent d647d8ed19
commit ae1337901d
115 changed files with 10026 additions and 924 deletions
+6 -1
View File
@@ -2,6 +2,7 @@ import { PYTHON_SIDECAR_TOOLS, TOOLS } from "@snapotter/shared";
import { useCallback, useEffect, useRef, useState } from "react";
import { useTranslation } from "@/contexts/i18n-context";
import { formatHeaders, parseApiError } from "@/lib/api";
import { MULTI_FILE_TOOLS } from "@/lib/tool-display-modes";
import { generateId } from "@/lib/utils";
import { useFileStore } from "@/stores/file-store";
@@ -343,7 +344,11 @@ export function useToolProcessor(toolId: string) {
delete cleanSettings._bgImageFile;
const formData = new FormData();
formData.append("file", files[capturedIndex] ?? files[0]);
if (MULTI_FILE_TOOLS.has(toolId) && files.length > 1) {
for (const f of files) formData.append("file", f);
} else {
formData.append("file", files[capturedIndex] ?? files[0]);
}
formData.append("settings", JSON.stringify(cleanSettings));
if (bgImageFile) {
formData.append("backgroundImage", bgImageFile);