From 7dd6023b8ef98d48c4c8f2d2ca7c41d75f55488b Mon Sep 17 00:00:00 2001 From: ashim-hq Date: Mon, 20 Apr 2026 21:52:41 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20frontend=20unlimited=20=E2=80=94=20rais?= =?UTF-8?q?e=20all=20client-side=20caps=20and=20timeouts?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - XHR timeouts: doubled across all tool categories (120s/300s/600s) - Pipeline timeout: 180s → 600s - Favicon/PDF/barcode timeouts raised to 300s - Files page: fetch 200 per page - Split grid: 20 → 100 max columns/rows - Image viewer zoom: 25-300% → 10-1000% - Collage zoom: 3x → 10x, pan: ±100 → ±200 - Passport photo: face adjust ±15% → ±30%, zoom 3x → 5x --- apps/web/src/components/common/image-viewer.tsx | 2 +- .../src/components/tools/barcode-read-settings.tsx | 2 +- apps/web/src/components/tools/collage-preview.tsx | 12 ++++++------ apps/web/src/components/tools/favicon-settings.tsx | 2 +- .../src/components/tools/image-to-pdf-settings.tsx | 2 +- .../src/components/tools/passport-photo-settings.tsx | 8 ++++---- apps/web/src/hooks/use-pipeline-processor.ts | 4 ++-- apps/web/src/hooks/use-tool-processor.ts | 4 ++-- apps/web/src/stores/files-page-store.ts | 2 +- apps/web/src/stores/split-store.ts | 4 ++-- 10 files changed, 21 insertions(+), 21 deletions(-) diff --git a/apps/web/src/components/common/image-viewer.tsx b/apps/web/src/components/common/image-viewer.tsx index bb2dd4c6..83ffee95 100644 --- a/apps/web/src/components/common/image-viewer.tsx +++ b/apps/web/src/components/common/image-viewer.tsx @@ -27,7 +27,7 @@ interface ImageViewerProps { imageWrapperStyle?: React.CSSProperties; } -const ZOOM_STEPS = [25, 50, 75, 100, 125, 150, 200, 300]; +const ZOOM_STEPS = [10, 25, 50, 75, 100, 150, 200, 300, 500, 1000]; const DEFAULT_ZOOM = 100; export function ImageViewer({ diff --git a/apps/web/src/components/tools/barcode-read-settings.tsx b/apps/web/src/components/tools/barcode-read-settings.tsx index 9502c24d..589dfb60 100644 --- a/apps/web/src/components/tools/barcode-read-settings.tsx +++ b/apps/web/src/components/tools/barcode-read-settings.tsx @@ -72,7 +72,7 @@ function scanOneFile( formData.append("settings", JSON.stringify({ tryHarder })); const xhr = new XMLHttpRequest(); - xhr.timeout = 60_000; + xhr.timeout = 300_000; xhr.upload.onprogress = (e) => { if (e.lengthComputable) onUploadProgress((e.loaded / e.total) * 100); diff --git a/apps/web/src/components/tools/collage-preview.tsx b/apps/web/src/components/tools/collage-preview.tsx index 41bfe2bd..084151eb 100644 --- a/apps/web/src/components/tools/collage-preview.tsx +++ b/apps/web/src/components/tools/collage-preview.tsx @@ -349,8 +349,8 @@ function CollageCell({ if (first) memo = { panX: transform.panX, panY: transform.panY }; const rect = cellRef.current?.getBoundingClientRect(); if (!rect || !memo) return memo; - const panX = Math.max(-100, Math.min(100, memo.panX + (mx / rect.width) * 100)); - const panY = Math.max(-100, Math.min(100, memo.panY + (my / rect.height) * 100)); + const panX = Math.max(-200, Math.min(200, memo.panX + (mx / rect.width) * 100)); + const panY = Math.max(-200, Math.min(200, memo.panY + (my / rect.height) * 100)); store.setCellTransform(cellIndex, { panX, panY }); return memo; }, @@ -360,11 +360,11 @@ function CollageCell({ const bindPinch = usePinch( ({ offset: [scale] }) => { if (!image || !isSelected) return; - const zoom = Math.max(1, Math.min(3, scale)); + const zoom = Math.max(1, Math.min(10, scale)); store.setCellTransform(cellIndex, { zoom }); }, { - scaleBounds: { min: 1, max: 3 }, + scaleBounds: { min: 1, max: 10 }, from: () => [transform.zoom, 0], }, ); @@ -378,7 +378,7 @@ function CollageCell({ const handleWheel = (e: WheelEvent) => { e.preventDefault(); const delta = e.deltaY > 0 ? -0.1 : 0.1; - const zoom = Math.max(1, Math.min(3, zoomRef.current + delta)); + const zoom = Math.max(1, Math.min(10, zoomRef.current + delta)); store.setCellTransform(cellIndex, { zoom }); }; el.addEventListener("wheel", handleWheel, { passive: false }); @@ -555,7 +555,7 @@ function CollageCell({ { if (event.lengthComputable) { diff --git a/apps/web/src/components/tools/image-to-pdf-settings.tsx b/apps/web/src/components/tools/image-to-pdf-settings.tsx index 82c4842b..0df9391d 100644 --- a/apps/web/src/components/tools/image-to-pdf-settings.tsx +++ b/apps/web/src/components/tools/image-to-pdf-settings.tsx @@ -167,7 +167,7 @@ export function ImageToPdfSettings() { const xhr = new XMLHttpRequest(); xhrRef.current = xhr; - xhr.timeout = 180_000; + xhr.timeout = 300_000; xhr.upload.onprogress = (event) => { if (event.lengthComputable) { diff --git a/apps/web/src/components/tools/passport-photo-settings.tsx b/apps/web/src/components/tools/passport-photo-settings.tsx index 9159e560..be79d456 100644 --- a/apps/web/src/components/tools/passport-photo-settings.tsx +++ b/apps/web/src/components/tools/passport-photo-settings.tsx @@ -1062,8 +1062,8 @@ export function PassportPhotoPreview() { if (!dragStartRef.current) return; const dx = (e.clientX - dragStartRef.current.x) * 0.001; const dy = (e.clientY - dragStartRef.current.y) * 0.001; - setAdjustX(Math.max(-0.15, Math.min(0.15, dragStartRef.current.ax - dx))); - setAdjustY(Math.max(-0.15, Math.min(0.15, dragStartRef.current.ay - dy))); + setAdjustX(Math.max(-0.3, Math.min(0.3, dragStartRef.current.ax - dx))); + setAdjustY(Math.max(-0.3, Math.min(0.3, dragStartRef.current.ay - dy))); } function handleMouseUp() { @@ -1083,7 +1083,7 @@ export function PassportPhotoPreview() { const handleWheel = useCallback( (e: React.WheelEvent) => { e.preventDefault(); - setZoom(Math.max(0.5, Math.min(3, zoom + (e.deltaY > 0 ? -0.1 : 0.1)))); + setZoom(Math.max(0.5, Math.min(5, zoom + (e.deltaY > 0 ? -0.1 : 0.1)))); }, [zoom, setZoom], ); @@ -1138,7 +1138,7 @@ export function PassportPhotoPreview() {