fix: clean up crop mode toggle, extend timeouts for long-running tools

- Remove content-aware crop mode toggle from tool-page (now handled internally)
- Add content-aware-resize/crop to LONG_RUNNING_TOOLS for extended XHR timeout
- Remove unused onModeChange prop from CropProps
- Bump HEIC converter test timeouts to 60s to fix flaky failures
This commit is contained in:
SnapOtter
2026-05-11 22:48:05 +08:00
parent 56e8cf7352
commit 7a2ea2069b
5 changed files with 159 additions and 363 deletions
+4 -1
View File
@@ -30,6 +30,9 @@ const IDLE_PROGRESS: ToolProgress = {
// AI tools return 202 and deliver results via SSE (not XHR response).
const AI_PYTHON_TOOLS = new Set<string>(PYTHON_SIDECAR_TOOLS);
// Tools that are not Python sidecar but still need an extended XHR timeout.
const LONG_RUNNING_TOOLS = new Set<string>(["content-aware-resize", "content-aware-crop"]);
const UPLOAD_WEIGHT = 15;
export function useToolProcessor(toolId: string) {
@@ -175,7 +178,7 @@ export function useToolProcessor(toolId: string) {
const xhr = new XMLHttpRequest();
xhrRef.current = xhr;
xhr.timeout = isAiTool ? 600_000 : 120_000;
xhr.timeout = isAiTool || LONG_RUNNING_TOOLS.has(toolId) ? 600_000 : 120_000;
xhr.upload.onprogress = (event) => {
if (event.lengthComputable) {