Files
Epicnabbo-Catalogus-Updated…/src/components/admin/studio
openhands 3d7278e96d perf(studio): header-only nitro validation for fake/broken scan
The cleanup scan used to read every .nitro bundle in full and decompress
the large PNG texture just to confirm the file is structurally valid. On
directories with hundreds of thousands of bundles this took minutes, the
reverse proxy cut the request at its 30s timeoutable with an HTML 504, and
the panel then crashed with "Unexpected token '<'".

Validate bundles with a cheap header-only read (a few KB, no decompression)
that mirrors parseNitroBundle's byte layout; only files whose header looks
suspicious get the expensive full parse. Robust against downloads that
landed as an HTML error page, truncated or zero-filled files. The scan
drops from minutes to seconds on large nitro directories.

Also guard the panel against non-JSON (proxy error page / HTML) responses
so it reports a clear error message instead of a JSON parse failure.
2026-09-16 15:50:04 +02:00
..

Catalog Studio code map

studio-client.tsx composes the workspace, selection and actions. Keep reusable data handling outside its render tree.

Client responsibilities

  • studio-filters.ts: pure filtering and sorting of the loaded furniture list; never mutates the input array.
  • use-studio-translations.ts: language selection, persisted defaults and translation requests.
  • use-furniture-jobs.ts: queue submission, retry identity, polling and completion notifications.
  • furniture-jobs.tsx: job history and retry controls.
  • use-furniture-inspection.ts: cancellable inspection requests and explicit rechecks.
  • furniture-inspector.tsx: local component status, source comparison and repair controls.
  • import-review.tsx: import review, actionable review groups and attachment confirmation.
  • import-recommendation.ts: completion, conflict and verification recommendations from inspected component evidence.
  • studio-types.ts: shared client data types.

Server responsibilities

  • src/lib/services/furniture-inspection.ts: reads SQL, catalog offers, furnidata and asset presence.
  • src/lib/furni/studio-inspection.ts: shared validation, comparison and completeness classification.
  • src/lib/services/furniture-repair.ts: preflight, preservation options and post-repair verification.
  • src/lib/services/furni-job-worker.ts: durable queued work and per-item results.

Keep client modules free of filesystem/database imports. Background refreshes must not reset open editors or unsaved input. Completion status must come from verification, not optimistic UI flags.

Detail navigation keeps the mounted workspace state and restores the list scroll position and originating control on close. Escape closes an open detail before clearing selection. Furniture responses must belong to the latest list request; source changes invalidate pending detail, review and delete state. Selection is never persisted outside the mounted workspace.