Repository navigation
feat(website): Sprite Sheet Generator app (mocked backend) - #20866
mariana953 wants to merge 15 commits into
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
Comment |
📦 Bundle Size
🧩 Custom Nodes Ecosystem Matrix: 🟡 Withheld — could not measureExecutes the frontend JS of every registry pack that ships any, against this change, in both renderers. The eight This candidate changes nothing the matrix measures, so every expensive stage was skipped. Reproduce locally# build one shard's fixture, then run it
python3 scripts/registry-census/build_matrix.py --shard 1/4
MATRIX_RENDERER=vue MATRIX_VUE=1 \
npx vitest run --config vitest.matrix.config.mts
Full docs: scripts/registry-census/README.md 🌾 Fallow: ✅ PassedFallow audits the diff for duplication, complexity and dead code. It gates on new findings only, so when the audit completes, a red is something this PR introduced or moved — never inherited backlog. A red can also mean the audit itself did not finish; the details below say which happened. No new findings in the changed files. Reproduce locally# the base the gate compared against
npx fallow audit --root . --quiet --format json \
--changed-since fa6d451f5d507b9e31956425e939e0ee8d12cd1d
Full docs: ADR-DEVEX-LINT-0015 🌐 Website E2ETip All tests passed.
🔗 Website PreviewWebsite Preview: https://comfy-website-preview-pr-20866.vercel.app Models is built and gated by PostHog (workshop-enabled), using staging Cloud. This commit: https://website-frontend-1cg30usjk-comfyui.vercel.app Last updated: 2026-10-14T01:28:59Z for |
# Conflicts: # apps/website/src/components/workshop/cinematic-studio/CinematicStudioPage.vue
…/app-sprite-sheet
…th undo, and starts from an example card
…/app-sprite-sheet
dante01yoon
left a comment
There was a problem hiding this comment.
Thanks. Pose/pixel logic is nicely separated and tested, and playback respects reduced motion. Requesting changes for the copy approach (shared with the sibling app PRs) and internal comments.
Size. This PR is about 3,300 lines (excluding binaries). That is far past the ~300-line guideline and hard to review well in one pass. Could you split it, e.g. (1) wiring: catalogue, routes, flag, Hub card; (2) pure lib/ logic with its tests; (3) components and e2e?
Stacking. Base is mariana/editor-kit (#20630), which is still open with changes requested. Every app PR edits the same shared lists (routes.ts, apps.ts, catalogue-apps.ts, CinematicStudioPage.vue, schema enums, locales, vercel.json), so they will conflict with each other as they land. The identical helpers (app-copy.ts, load-image.ts, useSnapshotHistory.ts, nudge.ts) would be better landed once in #20630 than duplicated in every app branch.
Checks: CI is green; I didn't run tests locally.
| named: CopyValues = {} | ||
| ): string { | ||
| const [one, many = one] = (entry[locale] ?? entry.en).split(' | ') | ||
| return (named.n === 1 ? one : many).replace( |
There was a problem hiding this comment.
issue: appCopy fills placeholders with .replace and parses | plurals by hand, and the app's strings live in a TS copy.ts instead of src/locales/<locale>/main.json. apps/website/AGENTS.md says copy goes in main.json and is read with translationsFor(locale).t, and to "never fill a placeholder with .replace". Doing it this way also skips the catalog test that compiles each message and checks zh-CN coverage. It also treats a literal {word} the visitor types (a star name, a light name) as a placeholder whenever named has that key.
Could the app's strings move under a namespaced key in main.json (moveAnything.*, relight.*, …) and be read through t(key, named, { locale })? If keeping them out of the site-wide bundle is the real goal (as for catalogue-apps.ts), please get that exception agreed on #20630 first, where all seven apps can share it, without hand-rolled interpolation.
| phase.value = next | ||
| } | ||
|
|
||
| /** Shows `next`, keeping the setup, releasing the previous upload. */ |
There was a problem hiding this comment.
issue: this PR adds comments to internal, non-exported code, like this one and the others on inner functions of this composable. The repo rule only allows a short JSDoc on exported API. Please drop the internal ones and let the names carry the meaning.
| } | ||
|
|
||
| /** Changes the setup; changes sharing a `key` in a row undo as one. */ | ||
| function change(patch: Partial<SpriteSetup>, key?: string) { |
There was a problem hiding this comment.
suggestion: this is another hand-rolled undo stack (past/future/lastEdit) that matches useSnapshotHistory from the sibling PRs, keyed coalescing included. Reusing it would drop ~30 lines and keep undo behaviour identical across apps.
|
|
||
| type Thumbnails = Partial<Record<SpriteStyle, string>> | ||
|
|
||
| const cache = new Map<string, Thumbnails>() |
There was a problem hiding this comment.
suggestion: the module-level cache is keyed by the image URL and never pruned. Each upload is a new blob: URL, so every character a visitor tries keeps its three PNG data-URL thumbnails for the rest of the session, even after the blob is revoked. Caching only the current source (or the examples) would bound it.
| * What the Sprite sheet backend receives for one run, as the multipart | ||
| * fields of `POST /api/run/sprite-generator`: `image` is sent as the file. | ||
| */ | ||
| export interface SpriteSheetRequest { |
There was a problem hiding this comment.
question: SpriteSheetRequest is a hand-written request/response contract for a backend that doesn't exist yet. Is there a tracking issue for the endpoint? Once it ships in the OpenAPI spec, these types should be imported from @comfyorg/ingest-types rather than kept by hand. Could you link the issue here (or in the PR body) so the swap isn't forgotten?
Summary
Adds the Sprite Sheet Generator to the Workshop at
/hub/apps/sprite-sheet/. You give it one character and get back a sprite sheet of 8 frames (4×2), which you can view as the sheet or play as an animation. It works like the reference app (/api/run/sprite-generator) and uses the shared editor kit from #20630. The backend is mocked. Built on the shared editor kit (#20630), with no dependency on Relight or Move anything. Replaces #19825. The image loader is nowlib/workshop/load-image.ts, so nothing is borrowed from another app.Changes
workshop-sprite-sheet-app-enabled(PostHog), wired throughworkshop-model-availability.jsonlike Relight.EditorPickerRow). Each row shows a thumbnail and the current value, and on desktop opens a grid of tiles beside the panel in the kit'sEditorPicker, the same pattern as Cinematic's Light and Paparazzi me's Scene. Style tiles show the character drawn in each style; Motion tiles are animated. On phones the grid unfolds inside the sheet instead.EditorTray'sfield-label).lib/workshop/sprite-sheet/copy.ts).EditorPickerRowandEditorPickerfor Style and Motion,EditorDropZoneandEditorUploadSloton the Character row,useImagePaste, andEditorRun'sprogress(the job's queued and percent stages). Removed the localSpriteSheetPickerRowand the Character row's own drop and file-input code.columns,frameSizeandbackgroundfrom the request<character>-<style>-<motion>-sheet.png(.webpfor the example's prepared sheets).public/images/apps/sprite-sheet/explorer.webp, a 512×640 cutout with alpha). It comes with prepared walk sheets, one per style (explorer-walk-{pixel,toon,3d}.webp, 1792×896, eight equal 448 px square cells on a clear background, the figure centred on a common baseline so Preview plays without jumps). The hub card usesexplorer-card.jpg. The drawn fox example is removed.runSpriteSheet(lib/workshop/sprite-sheet/mock-run.ts):Backend contract (
lib/workshop/sprite-sheet/contract.ts)One-to-one with the reference endpoint: multipart
POST /api/run/sprite-generator.The frame count is not sent; the 4×2 grid of 8 frames is fixed on both sides. There are no extension fields. The run button maps
SpriteSheetProgressto the kit'sRunProgress.Review Focus
EditorPicker) instead of over the stage.EDITOR_APPSlist on the studio page (one entry), and its copy goes throughlib/workshop/app-copy.ts. Shared helpers (app-copy.ts, and where usedload-image.ts,nudge.ts,useSnapshotHistory.ts) are identical in every app PR, so they merge cleanly whichever lands first.Screenshots (if applicable)
Taken locally against the production build. They cover desktop 1440 with the example, the Style and Motion pickers, Preview, running at NN%, the result as Sheet and as Preview, phone 390 (sheet, inline style grid, result) and layout E (desktop tray, phone). There is no horizontal overflow on phone in either layout.
Generated by Claude Code