feat(droid-control): code annotations + transition styles#23
Open
factory-ain3sh wants to merge 3 commits intomasterfrom
Open
feat(droid-control): code annotations + transition styles#23factory-ain3sh wants to merge 3 commits intomasterfrom
factory-ain3sh wants to merge 3 commits intomasterfrom
Conversation
Add an opt-in `codeAnnotations` layer and a `transitionStyle` resolver to the Remotion Showcase composition. Defaults are unchanged so existing props render identically; the new behavior only activates when those props are set. - Schema: `codeAnnotationSchema` (t, dur, code, language, title, highlight, focus, position) and `transitionStyleSchema` (motion-blur, flash, whip-pan, light-leak, glitch-lite). - CodeAnnotationOverlay: syntax-highlighted code cards via prism-react-renderer with palette-aware theming, line highlights, focus dimming, and enter/exit animation. Anchored top-right by default. - ShowcaseTransition: five Remotion-native transition presentations wired via `getTransitionPresentation(style, palette)`. Motion-blur preserves the existing look; the others are palette-aware (warm on Factory presets). - Docs: compose/SKILL.md gains authoring guidance and a full props reference for both features; showcase/SKILL.md adds preset-level style guidance. README and ARCHITECTURE.md updated to reflect the new composition surface. Validated: `tsc --noEmit` clean; three fixture renders (default, whip-pan + code annotation, flash) produce 9.5s 1920x1080 H.264 mp4s with expected content. Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
ffbd042 to
4530ed9
Compare
…m-react-renderer
The transitionStyle taxonomy ('whip-pan', 'light-leak', 'flash', 'glitch-lite')
and the 'selectable enum of named transitions' API shape are inspired by
@hyperframes/shader-transitions (Apache-2.0). Implementations are still
original Remotion-native CSS/SVG overlays.
Also adds prism-react-renderer (MIT) to the runtime dependency list since it
ships with the new CodeAnnotationOverlay.
Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
…e to real comparisons The skill guidance was tipping droids toward before/after side-by-side as the canonical video shape — primary JSON example used side-by-side with BEFORE/AFTER labels, Demo-mode goal was phrased as 'before/after comparison', delegation table led with 'Capture before branch / Capture after branch'. Result: droids were reaching for side-by-side even on brand-new features where there is no meaningful 'before', sometimes synthesizing a fake baseline. Fix (guidance only, no schema change — layoutSchema already supports both): - droid-control/SKILL.md: new 'Layout default' table under Workflow shape calling out single as the default with the specific cases that warrant side-by-side. Explicit 'do not synthesize a before' rule. - droid-control/SKILL.md: delegation table collapses the two pre-framed before/after rows into 'Capture clip' (single) + 'Capture both clips' (comparison). Parallel capture section heading/gate updated to read 'comparison flows only'. - compose/SKILL.md: primary JSON example now renders a single clip with labels: []. One-line note shows how to flip to side-by-side when a real comparison exists. Showcase-vs-Demo 'Goal' cell no longer pre-supposes before/after. Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds two opt-in props to the droid-control Remotion
Showcasecomposition:codeAnnotations(timed, syntax-highlighted code cards rendered above the captured clip) andtransitionStyle(selects betweenmotion-blur,flash,whip-pan,light-leak,glitch-litefor the title→content and content→outro crossfades). Both default to current behavior so existing callers render byte-equivalent output.The annotation overlay is implemented natively against
prism-react-renderer(palette-aware vsDark theme, line highlight + focus dimming, anchorable to top-right / center / bottom-left). The transition resolver replaces the hardcodedmotionBlurTransition()constant withgetTransitionPresentation(style, palette)and ships five Remotion-native presentations — no external transition framework or shader/WebGL pipeline introduced. The orphanedMotionBlurTransition.tsxis removed sinceShowcaseTransition.tsxnow owns the motion-blur presentation alongside the four new variants.Related Issue
N/A — no Linear ticket.
Potential Risk & Impact
transitionStyledefaults tomotion-blur(same code path as before, now living inShowcaseTransition.tsx), andcodeAnnotationsis unset/empty by default. Three fixture renders confirmed identical 9.5s 1920×1080 H.264 output for the no-prop case.prism-react-renderer@^2.4.1is added toplugins/droid-control/remotion. It is a popular, dependency-light Prism wrapper (3 packages added pernpm install). No security advisories at the pinned version. Recorded inNOTICES.md.transitionStyleenum names (whip-pan,light-leak,flash,glitch-lite) and the "selectable enum of named transitions" API shape were shaped by@hyperframes/shader-transitions(Apache-2.0). Implementations are original Remotion-native CSS/SVG overlays — no GLSL/WebGL involved. Credited inNOTICES.mdand in a header comment onShowcaseTransition.tsx.lib/schema.ts:codeAnnotationSchema,codeRangeSchema,transitionStyleSchema. These extendshowcaseSchemawith optional fields, so existing props validate unchanged.MotionBlurTransition.tsxdeleted. It was no longer imported anywhere insrc/after the resolver wiring landed; verified via ripgrep.codeAnnotationsdefaults declared in zod (highlight: [],focus: [],language: 'tsx',position: 'top-right') are not applied by Remotion when props arrive via--props=JSON, so the overlay reads them with?? defaultsto avoid undefined access at render time.compose/SKILL.mdgains 31 lines (2 props-table rows + tight schema table + 5-row transition style table);showcase/SKILL.mdgains 14 lines (preset×style matching table + a one-line bullet update). Both new sections inshowcase/SKILL.mdexplicitly redirect tocompose/SKILL.mdfor schema details to avoid duplication. Top-levelREADME.mdgets a one-line update;ARCHITECTURE.mdgains a "Composition surface" subsection.side-by-sidewith BEFORE/AFTER labels as the default shape, even on brand-new features where no "before" exists.droid-control/SKILL.mdnow has a "Layout default" table calling outsingleas the default and gatingside-by-sideto real comparison flows (regression, behavior-preserving refactor, explicit user request).compose/SKILL.md's primary JSON example renders a single clip; a one-line note shows the side-by-side variant. No schema change —layoutSchemaalready supported both.render-showcase.sh: untouched. Existing staging/duration/cleanup behavior preserved.How Has This Been Tested?
npx tsc --noEmitclean inplugins/droid-control/remotion/.scripts/render-showcase.shagainst a synthetic 3stestsrc2mp4:transitionStyle, nocodeAnnotations) — regression check, motion-blur path.transitionStyle: "whip-pan"+ onecodeAnnotationwithhighlightrange,top-rightanchor — exercises both new code paths.transitionStyle: "flash"withfactorypreset — exercises the warm-flash overlay branch.ffprobe: 1920×1080, H.264 (yuvj420p), 9.5s duration (matches4s title + 3s clip + 3.5s outro − 2×0.5s transitions).return nullbeforeuseMemo) and one undefined-array crash during fixture rendering; both fixed and re-validated before commit.