Commit Graph
972 Commits
Author SHA1 Message Date
SnapOtter 84e62e6132 refactor: rename tool display name to "PNG Transparency Fixer" 2026-05-06 18:53:37 +08:00
SnapOtter c47ec34021 fix: show tool name instead of bundle name in install prompt, add queued state 2026-05-06 18:47:34 +08:00
SnapOtter 75e48f2738 test: add transparency-fixer to GUI AI tools and tools-all E2E tests 2026-05-06 10:39:15 +08:00
SnapOtter eb3d0828cb docs: add transparency-fixer endpoint documentation 2026-05-05 23:24:22 +08:00
SnapOtter 4745e435a4 test: add Playwright E2E tests for transparency-fixer tool 2026-05-05 23:17:24 +08:00
SnapOtter c263834037 test: add integration tests for transparency-fixer tool 2026-05-05 23:14:42 +08:00
SnapOtter 52f355ef8f feat: register transparency-fixer in frontend tool registry 2026-05-05 23:09:15 +08:00
SnapOtter 06d6c0ef1e feat: add transparency-fixer settings component 2026-05-05 23:09:10 +08:00
SnapOtter b1959e977d fix: improve defringe quality and add defensive guards in transparency-fixer 2026-05-05 23:07:14 +08:00
SnapOtter 423711ac42 feat: add transparency-fixer API route with defringe post-processing 2026-05-05 23:03:07 +08:00
SnapOtter d5a808dbc7 feat: register transparency-fixer in shared constants, features, and i18n 2026-05-05 22:58:30 +08:00
SnapOtter 9db19a01a2 feat: add BiRefNet HR-matting model download and manifest entry 2026-05-05 22:56:31 +08:00
SnapOtter a329dac004 fix: guard against division-by-zero in HR-matting predict and register session in installer
The BiRefNetHRMattingSession.predict normalization crashes when all
pixels share the same value (ma == mi). Use a guarded denominator so
uniform-alpha inputs produce a zero mask instead of a NaN explosion.

Also adds _register_birefnet_hr_matting() to install_feature.py so the
HR-matting model can be downloaded during feature installation, matching
the existing registration in remove_bg.py.
2026-05-05 22:54:43 +08:00
SnapOtter a44f6c7592 feat: add BiRefNet HR-matting model support for transparency fixer 2026-05-05 22:49:41 +08:00
SnapOtter 563c420d86 ci: add workflow_dispatch trigger to CI workflow
Allows manual re-runs when GitHub-hosted runners are unresponsive.
2026-05-05 22:46:39 +08:00
SnapOtter 5e45cb292b test: increase QR max-size test timeout to 180s for CI
The 10000x10000 QR generation exceeds 120s on GitHub-hosted runners.
2026-05-05 22:31:53 +08:00
SnapOtter 83fa0a39dc test: add fake transparency PNG fixture for transparency-fixer tool 2026-05-05 21:50:43 +08:00
SnapOtter d46510138f fix: custom logo not showing in sidebar and silent upload failures
The desktop sidebar never rendered the custom logo because only mobile
views used the customLogo state. Added a logo section at the top of
the desktop sidebar that displays the custom logo (or the default
OtterLogo when none is set).

The upload handler used raw fetch() without checking response.ok, so
HTTP 4xx errors (e.g. file too large) were silently ignored and the UI
falsely reported success. Now checks response status and surfaces the
server error message.

Closes #125
2026-05-05 21:45:51 +08:00
SnapOtter f856c26fcb fix: upscale tool times out on CPU-only systems (NAS/low-power hardware)
The upscale function called runPythonWithProgress without a timeout parameter,
defaulting to the bridge's 10-minute hard limit. On CPU-only systems like
Synology NAS devices, Real-ESRGAN 4x upscaling easily exceeds this for modest
images. Additionally, when the timeout fired on the dispatcher path, the Python
process was left running and blocked all subsequent AI operations.

This fix adds an adaptive timeout based on input megapixels, scale factor, and
GPU availability (180s/effective-MP on CPU, 30s/effective-MP on GPU, floor of
10 minutes). It also kills the dispatcher on timeout so subsequent requests can
proceed via a fresh restart.

Closes #119
2026-05-05 21:14:56 +08:00
SnapOtter 7ff100c4f9 docs: update tagline to "Your images never leave your home" 2026-05-05 21:12:44 +08:00
SnapOtter 2460ab3fc2 Merge fix/122-crop-portrait-overflow: crop tool overflows viewport with tall portrait images
Closes #122
2026-05-05 20:55:31 +08:00
SnapOtter a85f4db97c test: add portrait fixture images and extreme-height regression test
Add test-portrait-tall.png (200x4000) and test-portrait-extreme.png
(100x6000) fixtures. Update crop overflow tests to use fixture files
instead of generating images at runtime, and add a second test case
for extremely tall images.
2026-05-05 20:53:02 +08:00
SnapOtter 1807a43f2d fix: crop tool overflows viewport with tall portrait images
The crop area flex container lacked min-h-0, preventing it from shrinking
below its content's intrinsic height. For tall images, react-image-crop's
CSS (max-height: inherit at specificity 0-1-1) overrides the Tailwind
max-h constraint, and without min-h-0 the flex item refuses to shrink,
causing viewport overflow.

Closes #122
2026-05-05 17:51:01 +08:00
SnapOtter e358634f8b fix: production CSP blocking PostHog/Sentry/Scalar and silent failure hardening
The production CSP had connect-src/script-src/font-src set to 'self' only,
silently blocking all analytics and error reporting in production while
working fine in dev (where CSP is not applied).

CSP fixes:
- Add PostHog ingest + assets origins to connect-src and script-src
- Add Sentry ingest origin to connect-src
- Add Scalar fonts origin to font-src for API docs pages
- Extract CSP construction into testable buildCsp() function

Silent failure hardening:
- Settings/features stores now set loadError flag and allow retry on
  subsequent fetch() calls instead of permanently caching failed state
- Analytics init no longer sets initialized=true before the try block,
  allowing retry on failure
- Settings dialog Tools section disables save button when settings
  failed to load, preventing accidental config wipe
- Branding logo storage moved from process.cwd() to FILES_STORAGE_PATH
  so logos persist across Docker container recreation

Test coverage:
- 16 CSP directive tests covering all external service domains
- Store retry-on-error behavior tests for settings and features stores
- Analytics init retry-after-failure test
2026-05-05 17:16:19 +08:00
SnapOtter fe86c5ac9c fix: update APP_VERSION constant to 1.16.0
The health endpoint was reporting 1.15.11 because APP_VERSION in
shared/constants.ts was not updated with the version bump.
v1.16.0
2026-05-01 21:13:20 +08:00
SnapOtter 9f23a1b39f chore: bump version to 1.16.0 for Docker release
88 commits since v1.15.11 including feat commits.
2026-05-01 20:39:41 +08:00
SnapOtter 69deeb075f fix: increase vectorize HEIF test timeout to 180s for CI
Vectorize + HEIF decoding is particularly slow on CI runners.
120s was not enough; bump to 180s.
2026-05-01 20:25:12 +08:00
SnapOtter d1f2f63453 fix: add 120s timeout to all HEIF/HEIC integration tests for CI
Comprehensively adds { timeout: 120_000 } to every HEIF/HEIC
integration test across 40 test files. HEIF decoding on CI runners
is significantly slower than local, causing sporadic timeouts at
the default 5s or previous 60s limits.
2026-05-01 19:51:47 +08:00
SnapOtter 6a44c455a3 fix: remove printf banner from docker commands in docs
The printf welcome banner was overflowing code blocks on
docs.snapotter.com, making docker commands hard to read and copy.
2026-05-01 19:42:11 +08:00
SnapOtter 332c79f4ce fix: increase all HEIF/HEIC integration test timeouts to 120s for CI
The sharpening HEIF test was timing out at 60s in GitHub Actions.
Bumps all remaining HEIF/HEIC test timeouts from 60s to 120s across
14 integration test files for consistency with vectorize.
2026-05-01 19:05:51 +08:00
SnapOtter 66211ed6a7 fix: resolve 20 Sentry issues and fix navbar test flakiness
Sentry fixes:
- Only send 5xx errors to Sentry (was sending 4xx rate-limit, media type errors)
- Encode non-ASCII chars in X-Output-Filename header (encodeURIComponent)
- Handle FK constraint failures gracefully in file upload, pipeline save, API keys
- Harden getDirSize against ENOENT race on readdirSync

Test fixes:
- Wrap navbar test renders in act() to flush async useEffect state updates
- Add useEffect cleanup to navbar to prevent state updates on unmounted component
- Fixes timeout when running in full test suite
2026-05-01 19:01:05 +08:00
SnapOtter ff8dcf63c7 fix: resolve 14 security, correctness, and robustness issues found during QA sweep
Security fixes:
- Add auth + ownership check to thumbnail endpoint (was unauthenticated)
- Validate ExifTool fieldsToRemove against safe tag name pattern
- Add SVG sanitization to pipeline execute and batch endpoints
- Replace basename() with sanitizeFilename() in 16 tool routes
- Escape SQL LIKE wildcards in file search to prevent pattern injection
- Improve settings HTML tag validation pattern

Bug fixes:
- Skip autoOrient for SVG inputs in pipeline (prevents misinterpretation)
- Remove double-encode in compress targetSize (was degrading quality)
- Fix bg-effects alpha value from 255 to 1.0 (Sharp expects float)
- Guard download stream error handler against headers-already-sent race
- Use O_EXCL atomic file creation for install lock (fixes TOCTOU race)
- Truncate collage file array to template image count

UX fixes:
- Accept empty JSON bodies on POST endpoints (install/uninstall)
- Custom JSON content type parser that treats empty body as {}
2026-05-01 18:11:49 +08:00
SnapOtter 1a2288f99b chore: standardize all contact emails to contact@snapotter.com
Replace security@snapotter.local and snapotter.hq@gmail.com with the
official contact@snapotter.com address across SECURITY.md,
CODE_OF_CONDUCT.md, and README.md.
2026-05-01 17:56:10 +08:00
SnapOtter 84f24b8736 chore: add Discord community links across README, docs, and landing page
- README: Discord badge in header + community section link
- Docs: GitHub and Discord social links in VitePress config
- Landing: Discord in navbar, footer, open-source section, pricing copy
2026-05-01 16:13:38 +08:00
SnapOtter b50e1e0fb3 fix: increase vectorize HEIF test timeout to 120s for CI
Vectorize + HEIF decoding exceeds 60s on CI runners because potrace
(CPU-intensive bitmap tracing) runs on top of slow HEIF decoding.
2026-05-01 15:24:19 +08:00
SnapOtter e466c06cad fix: add 60s timeout to all HEIF integration tests for CI
HEIF decoding via heif-convert is slow on CI runners (~15-30s per
image) and exceeds the default 30s Vitest timeout. Add explicit
60s timeouts to all 16 HEIF input tests across integration suite.
2026-05-01 14:50:03 +08:00
SnapOtter 64a8ab6944 chore: ignore major version bumps in dependabot for pip and docker
Dependabot was creating orphaned branches for risky major bumps
(Node 22->25, CUDA 12->13, Pillow 11->12, onnxruntime 1.20->1.25)
without opening PRs. These require manual evaluation, not auto-update.
Aligns pip and docker config with the npm ecosystem which already
ignores major bumps.
2026-05-01 14:16:32 +08:00
SnapOtter fa479dcee4 fix: resolve 3 pre-existing issues found during test coverage expansion
1. passport-photo 404 vs 501: add base route at /api/v1/tools/passport-photo
   that returns 501 FEATURE_NOT_INSTALLED when the AI bundle is missing,
   matching other AI tools. The /generate sub-route is Sharp-only (no
   sidecar) so it correctly skips the isToolInstalled guard.

2. AuthGuard analytics consent race: don't evaluate shouldShowConsent()
   until analyticsConfig has been fetched (guard on analyticsConfig !== null).
   Prevents redirect to /analytics-consent before config is loaded.

3. Fragile sidebar Settings selector: add openSettings(page) helper to
   E2E helpers that checks sidebar visibility with fallback to button role.
   Replace all 134 occurrences of page.locator("aside").getByText("Settings")
   across 18 test files.
2026-05-01 13:44:04 +08:00
SnapOtter 7ce0f7b431 Merge branch 'worktree-agent-a5c6c830' 2026-05-01 05:28:37 +08:00
SnapOtter 8e3e212146 Merge branch 'worktree-agent-ab98adb0' 2026-05-01 05:28:37 +08:00
SnapOtter d05337ad49 Merge branch 'worktree-agent-a8a8fe4d' 2026-05-01 05:28:37 +08:00
SnapOtter 1889f00554 test: comprehensive GUI settings E2E including API Keys tab and full RBAC coverage 2026-05-01 05:28:00 +08:00
SnapOtter ae241cec19 test: deepen GUI resilience, accessibility, and performance tests 2026-05-01 04:47:55 +08:00
SnapOtter 7342d9d8fd test: add tablet visual regression baselines and cross-browser tests 2026-05-01 04:17:19 +08:00
SnapOtter 43cac02331 Merge branch 'worktree-agent-a3a33bf5' 2026-05-01 04:13:56 +08:00
SnapOtter b5b66248f1 Merge branch 'worktree-agent-a062c389' 2026-05-01 04:13:56 +08:00
SnapOtter d40adb9789 Merge branch 'worktree-agent-a63c6a97' 2026-05-01 04:13:56 +08:00
SnapOtter e071c2868b test: comprehensive GUI E2E for all 47 tools including 13 AI tools 2026-05-01 04:12:57 +08:00
SnapOtter 241dedc31f test: deepen GUI navigation with mobile viewport, footer, responsive, and keyboard tests 2026-05-01 03:35:07 +08:00
SnapOtter b6ee96ed04 test: deepen GUI batch, pipeline, and file-carry E2E tests 2026-05-01 03:33:52 +08:00