Files
EpicNext-Cms/src/components/admin/studio
openhands 7f07c111ac
Gitea Actions Runner Test / test-job (push) Successful in 1s
CI / check (push) Successful in 30s
CI / tests-integration (push) Successful in 1m48s
CI / tests-unit (push) Successful in 1m52s
CI / tests-ui (push) Successful in 2m44s
CI / preflight (push) Skipped
CI / deploy (push) Successful in 2m34s
perf(studio): load motion's minimal entry instead of the full component library
/admin/studio/furni sat at 94.9% of its initial-JS budget (427436 of
450560 gzip bytes), so the next feature would have broken the build. Of the
98228 gzip bytes unique to that route, a large part is framer-motion.

This file uses motion twice, for one thing: a 150ms opacity fade on the result
pane when viewMode changes. Importing `motion/react` to get it pulls in
framer-motion's complete component library — 73 internal modules — plus its
render components, drag/gesture and projection code, none of which is
rendered here.

`motion/react-m` ships only the element factories: 2 internal modules, and the
same initial/animate/transition props, so the fade is unchanged. It exports the
elements flat rather than under a `motion.` namespace, so the import becomes
`div as Mdiv` and the two JSX tags are renamed to match.

I could not measure the resulting bundle here: the local build is OOM-killed
(exit 137) with the running containers on the host, so the actual saving is
unverified. The CI build reports it in build-reports, and the number in this
commit message should be read as a hypothesis, not a measurement.

Verified: typecheck clean, lint clean, and the 10 studio UI tests pass —
including the pane and navigation specs that exercise the view switch.
2026-10-03 19:21:02 +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.