Repository navigation
feat(website): Relight app, place new lights on a photo and relight it - #20860
mariana953 wants to merge 18 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-20860.vercel.app Models is built and gated by PostHog (workshop-enabled), using staging Cloud. This commit: https://website-frontend-r8x5ihe50-comfyui.vercel.app Last updated: 2026-10-14T01:40:14Z for |
# Conflicts: # apps/website/src/components/workshop/cinematic-studio/CinematicStudioPage.vue
…e panel and removes it with an X
dante01yoon
left a comment
There was a problem hiding this comment.
Thanks. The shading and light-map maths are well isolated in lib/ with good tests, and the WebGL renderer is disposed on unmount. Requesting changes for the copy approach (shared with the sibling app PRs), internal comments, and a duplicate mask-ID bug.
Size. This PR is about 7,200 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? At this size a WebGL renderer and shader belong in their own PR.
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.
| } | ||
|
|
||
| const image = shallowRef<RelightImage>() | ||
| /** The photo taken out last, kept so it can be put back. */ |
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.
| const label = subject.trim() | ||
| if (!label) return | ||
| const { masks } = setup.value | ||
| const mask = newMask(`mask-${masks.length + 1}`, label, masks.length) |
There was a problem hiding this comment.
issue: mask IDs come from masks.length + 1, so they repeat after a delete. Repro: the example starts with mask-1; add a mask (mask-2), add another (mask-3), remove mask-2, then add one: masks.length + 1 is 3 again, so two masks share mask-3. After that, updateMask/removeMask hit both, the v-for keys collide, and a light's mask reference is ambiguous. Could this use a counter like nextId() for lights? A composable test for add → remove → add would cover it. (CONFIRMED)
| } from './lights' | ||
| import { renderRelitImage } from './render-image' | ||
|
|
||
| export interface RelightRequest { |
There was a problem hiding this comment.
question: RelightRequest 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?
| const relight = useRelight(locale) | ||
| const { image, removed, phase } = relight | ||
| const result = ref<EditorView>('compare') | ||
| const panel = computed(() => layout !== 'e') |
There was a problem hiding this comment.
suggestion: ?ux=e keeps a second, review-only layout (bottom composer + trays) in production code and in the e2e suite. Once the team picks a layout, could the other one be removed? Each app carries roughly a third more components and tests for a variant visitors aren't meant to use.
Summary
Adds Relight as a Workshop app at
/hub/apps/relight/, built on the shared editor kit (#20630): place point and directional lights on a photo, watch them shade it live, and get a result rendered from those lights. Mocked until the backend exists. Replaces #19760, and no longer depends on Move anything; the other image apps no longer depend on Relight.Changes
?ux=ekeeps the bottom composer for review.runRelightanswers after a short wait with the example's relit image or a render of the visitor's photo.workshop-relight-app-enabled.lib/workshop/nudge.ts(arrow-key nudging) is added here as in Move anything (feat(website): Move anything app, an image editor with a floating side panel #20854), identical, so whichever lands first carries it.Review Focus
runRelight(request, signal)resolves{ url, seed }. The request holdsimageUrl,lights[](kind, position as image fractions, colour, intensity, softness, direction, elevation, shadows, visible, mask),masks[],sceneandgeneration.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)
Preview (once deployed): https://comfy-website-preview-pr-20860.vercel.app/hub/apps/relight/
Generated by Claude Code