## What was wrong Every `MediaUploadApi` upload method (`UploadImage`, `UploadAudio`, `UploadNewEngineAsset`, `UploadSpzFile`, `UploadNewScene`, `UploadNewVideo`, `UploadPmx`) defaulted `maybe_visibility` to `Visibility.Public` and sent it in the form. The upload handlers only fall back to the account's preferred visibility when the field is absent, so this client default overrode a private/hidden preference whenever a caller didn't pass a choice. Affected paths include frame-extractor saves, 3D model / splat uploads from the upload modal, and their thumbnails, which then showed up in public listings. Separately, the video editor's automatic project cover (`thumbnail-capture.ts`) uploaded a render of the timeline through `UploadImage` with no visibility, so a private project got a public cover image. ## What changed - `MediaUploadApi`: removed the `= Visibility.Public` defaults. The field is sent only when the caller chooses a value; otherwise the server applies the account preference (unchanged server logic). - `thumbnail-capture.ts`: reads the project's `creator_set_visibility` and uploads the cover with the same visibility; if it can't be read, the cover is private. - `Visibility` is now exported from `@storyteller/api` so the webapp can pass it. ## Blast radius Uploads from callers that don't choose a visibility now follow the account's preferred visibility instead of always being public. Accounts with no preference get the server default, as before. Explicit choices are unchanged. Existing covers are not updated, and changing a project's visibility later does not update its cover. ## Checks run - `npx vitest run src/lib/MediaUploadApi.spec.ts` in `libs/api`: 8/8 pass (7 fail on `main`). - `npx vitest run src/pages/video-editor/adapters/thumbnail-capture.spec.ts` in `apps/artcraft-webapp`: 2/2. - `tsc -p tsconfig.lib.json` / `tsconfig.spec.json` for `libs/api` and `tsc -p tsconfig.app.json` for the webapp: no errors in touched files (existing errors elsewhere are unchanged). ## Checks not run - Uploads against a running API with a private preferred visibility. - Propagating visibility changes to existing covers (needs a server-side change). Addresses CodeRabbit security findings (CWE-200). <!-- This is an auto-generated comment: release notes by coderabbit.ai --> <!-- coderabbit-ai-generated:v1 --> ## Summary by CodeRabbit * **New Features** * Media uploads without an explicitly selected visibility now use the account’s preferred visibility. * **Bug Fixes** * Video cover uploads now retain a project’s public or hidden visibility. If visibility is missing or unrecognized, the cover is uploaded as private. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
Frontend
This is the Nx workspace for ArtCraft web apps and shared libraries. The desktop frontend is maintained in storytold/artcraft.
All commands to run these projects are performed from this directory (except the repo-root launcher scripts noted below).
Requirements
- Node.js 20+ (Nx 21 / Vite 6 requirement). Install via nvm,
nodejs.org, or
brew install node. - npm (ships with Node).
We use npm, not pnpm. pnpm was briefly adopted ("add pnpm to solve build issues") and later removed ("fix(frontend): consume video-editor libs via nx path aliases, drop pnpm"). If you have leftovers from that era — a
pnpm-lock.yaml,pnpm-workspace.yaml, or anode_modules/.pnpmdirectory — npm installs will fail (typically withENOTEMPTYrename errors). See Troubleshooting below.
Install dependencies
npm install
Running the apps in dev mode
From the repository root, the launcher scripts (these preflight your environment, install dependencies, and free the dev port first):
./script/website/unix_frontend_website_dev.sh # artcraft-website-next (marketing site), port 3000
./script/website/unix_frontend_webapp_dev.sh # artcraft-webapp (user dashboard), port 4201
Run the webapp from artcraft-services, not the separate artcraft desktop
checkout. The webapp launcher also works from another directory when invoked
by its full or relative path:
../artcraft-services/script/website/unix_frontend_webapp_dev.sh
Or directly from this directory:
npx nx dev @frontend/artcraft-webapp
Building
npx nx build artcraft-webapp
Netlify deploys run apps/<app>/script/netlify_build.sh (see each app's
netlify.toml).
Troubleshooting
npm install fails with ENOTEMPTY: directory not empty, rename ...
Your node_modules tree is corrupted — usually an interrupted install, or a
tree written by pnpm back when the repo briefly used it. Fix:
./clean_modules.sh
npm install
Or the manual minimum:
rm -rf node_modules .nx pnpm-lock.yaml pnpm-workspace.yaml
npm install
Stale build state after switching branches
Call this when starting on main or a new branch:
./clean_modules.sh
It removes all dist/ outputs, resets the nx cache, and removes
node_modules.
Import aliases
The names for @frontend and @storyteller come from the package.json file
in the libs folder:
import { Login } from "@frontend/login";
import { api } from "@storyteller/api";
For shared UI components, import from @storyteller/ui-[componentname]:
import { Button } from "@storyteller/ui-button";
import { Modal } from "@storyteller/ui-modal";
Generating a new component library
# 1. Generate the library
npx nx g @nx/react:library libs/components/toaster --import-path=@storyteller/ui-toaster --bundler=vite
npm install
# 2. Import it somewhere in code
# 3. Sync and build
nx sync
nx build