Repository navigation
feat(core): grade groups grade a whole lane from one hf-color-group - #6678
Conversation
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Automations to automatically generate PRs for you. |
Edit accuracy: accurate 271 (base branch 271), smooth 143 of thoseThe gate passes. Quarantined, measured but not gated (0) |
There was a problem hiding this comment.
Verdict: APPROVE · 0 blocker · 2 important · 0 nits · head a93c183
Required checks are green. The red Comments check isn't required: the comment ratchet flags the new colorGroups.ts at 23% against the package's 12.7%, plus +2 comment lines in runtime/colorGrading.ts and colorGradingContract.ts.
- important
studio-server/src/helpers/freezeFrame.ts:141:COPIED_PICTURE_ATTRScopiesdata-color-gradingbut notdata-color-group. A freeze frame of a lane clip comes out ungraded inside a graded lane. Adddata-color-groupto the list.
Scope
Read in full: colorGroups.ts, the runtime selector/observer/read path, the engine shown-boxes change, the lint rule and the new tests. I grepped every data-color-grading reader (bundler LUT rebase/inline, producer scans, plan, freezeFrame, Studio) for group awareness. The Studio property panel and media-treatment gaps are listed in the PR's Limits.
— Claude (Genesis)
| * element sharing the id is never read as a lane's grade. | ||
| */ | ||
| export function resolveColorGroupElement(root: GroupLookupRoot, groupId: string): Element | null { | ||
| const el = root?.getElementById(groupId) ?? null; |
There was a problem hiding this comment.
important: this resolves the group with a document-wide getElementById. That brings back the collision compiler/mediaRenderIds.ts already fixed for audio groups (AUDIO_GROUP_RENDER_ID_ATTR / busForMember). Ids are only unique per composition file. If two scene files each declare <hf-color-group id="cam-a"> with different grades, every member in the second scene gets the first scene's grade, in preview and in render. measureVideoShownBoxes resolves the same way. Pairing the member with the group in its own [data-composition-id] subtree first (falling back to the first match) would match what audio groups do. The Desktop podcast pages declare one group per camera in one composition, so they aren't affected today.
An inert <hf-color-group> holds a lane's data-color-grading; <video>, <img> and <canvas> join with data-color-group. A member's own grading overrides its group's. The runtime discovers members, regrades them when the group's grading or a member's data-color-group changes, and ungrades them when the group element or its grading goes, drawing only members on screen. Render keeps group-graded video at full size like directly graded video, and lint accepts (and still validates) grading on hf-color-group. Co-Authored-By: Claude Opus 5.5 <[email protected]>
a93c183 to
4117d91
Compare
What
A grade group: one inert
<hf-color-group id data-color-grading>that any number ofvideo/img/canvaselements join withdata-color-group="<id>". It is the picture's twin of audio groups (<hf-audio-group>+data-audio-group): membership lives on the member, the group element is inert (display:contents, injected next to the audio-group style).Why: a podcast camera is cut into hundreds of clips. Grading the camera means editing one attribute, not hundreds, and the preview follows at once.
How
packages/core/src/colorGroups.ts: lookup and the effective grade. A member's owndata-color-gradingwins over its group's (v1).colorGrading.ts): members are found by[data-color-group]as well as[data-color-grading], and every read goes througheffectiveColorGrading. The existing observer also watchesdata-color-group, and treats adding or removing anhf-color-groupas a change. A group edit is onerefresh(), and WebGL draws only the members on screen.color_grading_non_mediaaccepts the group element and still validates its JSON.docs/reference/color-grading.mdx, plus the lint rule text.Tests
<img>members repaint after one edit of the group's grading.Limits
body, so a group placed in<head>is not watched.media-treatmentcannot write a group's grade yet.🤖 Generated with Claude Code