Goal
Reduce maintenance risk in the Studio web app by splitting apps/web/src/App.tsx into smaller modules with clear responsibilities.
Scope
apps/web/src/App.tsx
- New files under
apps/web/src/components/
- New files under
apps/web/src/hooks/
- New files under
apps/web/src/lib/
Background
App.tsx currently handles API calls, polling, payload building, gallery actions, asset detail handling, and rendering. The feature set is useful, but the file has become a high-change concentration point.
Required changes
- Move API request helpers into
apps/web/src/lib/api.ts
- Move request/reuse payload builders into
apps/web/src/lib/payloads.ts
- Move job polling logic into
apps/web/src/hooks/useJobPolling.ts
- Extract presentational pieces into components such as:
StagePreview
- gallery panel/list
- asset detail panel
- Keep current UI behavior and endpoint usage intact
- Prefer low-risk refactoring over redesign
Constraints
- Do not change visible product behavior unless necessary for correctness
- Keep endpoint contracts unchanged
- Avoid introducing new dependencies unless clearly justified
Acceptance criteria
npm run build passes in apps/web
App.tsx becomes a composition/root container instead of a large mixed-responsibility file
- Existing generation, polling, gallery selection, reuse, export, and project binding flows still work
Validation
- Run
cd apps/web && npm run build
- Manually smoke-check:
- media type switching
- queue generation
- latest job polling
- gallery item selection
- asset reuse/export/project binding
Goal
Reduce maintenance risk in the Studio web app by splitting
apps/web/src/App.tsxinto smaller modules with clear responsibilities.Scope
apps/web/src/App.tsxapps/web/src/components/apps/web/src/hooks/apps/web/src/lib/Background
App.tsxcurrently handles API calls, polling, payload building, gallery actions, asset detail handling, and rendering. The feature set is useful, but the file has become a high-change concentration point.Required changes
apps/web/src/lib/api.tsapps/web/src/lib/payloads.tsapps/web/src/hooks/useJobPolling.tsStagePreviewConstraints
Acceptance criteria
npm run buildpasses inapps/webApp.tsxbecomes a composition/root container instead of a large mixed-responsibility fileValidation
cd apps/web && npm run build