Skip to content

feat(studio): catalog panel with Ask agent, block preview, and composition context#1025

Merged
miguel-heygen merged 19 commits into
mainfrom
feat/studio-catalog-panel
May 22, 2026
Merged

feat(studio): catalog panel with Ask agent, block preview, and composition context#1025
miguel-heygen merged 19 commits into
mainfrom
feat/studio-catalog-panel

Conversation

@miguel-heygen
Copy link
Copy Markdown
Collaborator

Summary

  • Add Catalog tab (behind VITE_STUDIO_ENABLE_BLOCKS_PANEL flag) with registry block/component browser
  • Runtime env injection so VITE_STUDIO_* flags work in embedded mode without rebuilding
  • Replace fullscreen hover popup with inline preview in the main player area
  • "Ask agent" copies category-specific prompts with full composition context (playhead time, visible elements, dimensions)
  • "Add" button for VFX, Social, Scenes categories; Ask agent only for Captions, Transitions, Effects, Data
  • Search matches category names and tags
  • Show main composition behind component sub-composition previews (no more black void)
  • Rewrite block dimensions to match host project on install
  • Read z-index from live iframe DOM instead of regex
  • Format inserted HTML with proper indentation
  • Blocks start at current playhead, root duration auto-extends
  • Lift block drop handling above DomEditOverlay
  • Rename "Layer" to "Z-index" in design panel
  • Tooltips on tabs and action buttons

Test plan

  • VITE_STUDIO_ENABLE_BLOCKS_PANEL=1 npx hyperframes preview shows Catalog tab
  • Clicking "Ask agent" copies prompt with composition state to clipboard
  • VFX/Social/Scenes cards show Add + Ask agent; others show Ask agent only
  • Search "captions" returns caption blocks
  • Viewing a component in Comps tab shows main composition behind it

Each catalog card now shows two hover buttons:
- "Add" — inserts the block/component into the composition at the
  current playhead position (existing behavior, now with + icon)
- "Agent prompt" — copies a contextual prompt to clipboard tailored
  to the block's category (captions, transitions, VFX, etc.) so the
  user can paste it into their AI agent for guided customization
Remove the Add button and drag-and-drop from catalog cards — blocks
and components need agent-guided customization, not blind insertion.

Each card now shows a single "Ask agent" button that copies a rich,
category-specific prompt to clipboard with context about what the
block does and how to customize it (captions: transcribe + style,
transitions: place at cut point, data: replace values, etc.).
Registry blocks are authored at 1920x1080 but projects may use
different dimensions (e.g. 1280x720). After installing a block, the
server now reads the host project's data-width/data-height from
index.html and rewrites the block's viewport meta and CSS dimensions
to match, preventing overflow.
…previews

When previewing a component (compositions/components/*), render the
main composition player as a backdrop behind the transparent component
overlay. This lets users see captions, vignettes, and other overlays
in context instead of against a black void.
The "Ask agent" button now copies the current composition state along
with the category-specific prompt: playback time, active composition
path, dimensions, and all elements visible at the current time with
their track, timing, and source paths. Gives the agent full context
to place and customize the block correctly.
Components (hyperframes:component) get both "Add" and "Ask agent"
buttons since they work as drop-in overlays. Blocks (scenes, data,
VFX, transitions) show only "Ask agent" since they need agent-guided
customization.
Add button rules: VFX, Social, Scenes get Add + Ask agent. Captions,
Transitions, Effects, Data get Ask agent only.

Search now matches category names and tags, so searching "captions"
shows all caption blocks.
- Ask agent button turns green with checkmark on copy
- Add button shows tooltip "Add to composition at current time"
- Ask agent shows tooltip "Copy a prompt to paste into your AI agent"
- Tab tooltips: Code, Comps, Assets, Catalog each explain their purpose
- Search placeholder updated to "Search by name, category, or tag…"
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 22, 2026

Fallow audit report

Found 24 findings.

Dead code (5)
Severity Rule Location Description
major fallow/unused-export packages/studio/src/components/ui/index.ts:2 Re-export 'Button' is never imported by other modules
major fallow/unused-export packages/studio/src/components/ui/index.ts:2 Re-export 'IconButton' is never imported by other modules
major fallow/unused-export packages/studio/src/components/ui/index.ts:3 Re-export 'StatusFrame' is never imported by other modules
major fallow/unused-type packages/studio/src/components/ui/index.ts:4 Type re-export 'HyperframesLoaderProps' is never imported by other modules
major fallow/unused-type packages/studio/src/hooks/useBlockCatalog.ts:5 Type export 'CatalogItem' is never imported by other modules
Duplication (10)
Severity Rule Location Description
minor fallow/code-duplication packages/cli/src/server/studioServer.ts:300 Code clone group 1 (14 lines, 2 instances)
minor fallow/code-duplication packages/cli/src/server/studioServer.ts:336 Code clone group 2 (8 lines, 2 instances)
minor fallow/code-duplication packages/studio/src/components/AskAgentModal.tsx:72 Code clone group 3 (21 lines, 2 instances)
minor fallow/code-duplication packages/studio/src/components/TimelineToolbar.tsx:14 Code clone group 4 (6 lines, 2 instances)
minor fallow/code-duplication packages/studio/src/components/editor/FileTree.tsx:20 Code clone group 5 (8 lines, 2 instances)
minor fallow/code-duplication packages/studio/src/components/sidebar/BlocksTab.tsx:530 Code clone group 3 (21 lines, 2 instances)
minor fallow/code-duplication packages/studio/src/components/sidebar/LeftSidebar.tsx:44 Code clone group 5 (8 lines, 2 instances)
minor fallow/code-duplication packages/studio/src/player/components/Timeline.tsx:95 Code clone group 4 (6 lines, 2 instances)
minor fallow/code-duplication packages/studio/vite.adapter.ts:233 Code clone group 1 (14 lines, 2 instances)
minor fallow/code-duplication packages/studio/vite.thumbnail.ts:15 Code clone group 2 (8 lines, 2 instances)
Health (9)
Severity Rule Location Description
minor fallow/high-crap-score packages/cli/src/server/studioServer.ts:313 'generateThumbnail' has CRAP score 31.6 (threshold: 30.0, cyclomatic 10)
critical fallow/high-crap-score packages/studio/src/components/StudioRightPanel.tsx:37 'StudioRightPanel' has CRAP score 306.0 (threshold: 30.0, cyclomatic 17)
major fallow/high-crap-score packages/studio/src/components/sidebar/BlocksTab.tsx:108 '<arrow>' has CRAP score 56.0 (threshold: 30.0, cyclomatic 7)
minor fallow/high-crap-score packages/studio/src/components/sidebar/BlocksTab.tsx:193 'formatCompositionContext' has CRAP score 30.0 (threshold: 30.0, cyclomatic 5)
critical fallow/high-crap-score packages/studio/src/components/sidebar/BlocksTab.tsx:282 'BlockCard' has CRAP score 240.0 (threshold: 30.0, cyclomatic 15)
minor fallow/high-crap-score packages/studio/src/components/sidebar/BlocksTab.tsx:558 '<arrow>' has CRAP score 30.0 (threshold: 30.0, cyclomatic 5)
critical fallow/high-crap-score packages/studio/src/components/sidebar/LeftSidebar.tsx:64 'LeftSidebar' has CRAP score 600.0 (threshold: 30.0, cyclomatic 24)
major fallow/high-crap-score packages/studio/src/hooks/useBlockCatalog.ts:29 '<arrow>' has CRAP score 56.0 (threshold: 30.0, cyclomatic 7)
major fallow/high-crap-score packages/studio/src/player/components/PlayerControls.tsx:58 'PlayerControls' has CRAP score 44.1 (threshold: 30.0, cyclomatic 39)

Generated by fallow.

Clicking "Ask agent" now opens a modal that shows the full generated
prompt so the user can read it before copying. The modal has a "Copy
prompt" button that turns green on success. This replaces the silent
clipboard copy that gave no visibility into what was copied.
When seeking via the slider or timeline scrub, explicitly pause all
<video> and <audio> elements inside the preview iframe. The GSAP
timeline pauses but iframe media elements can continue playing
independently, causing audio to keep going after a seek.
Call tl.pause() both before AND after tl.seek() in the adapter.
GSAP's seek() can reactivate a timeline depending on internal state;
the second pause() guarantees it stays frozen at the seeked position.
Add title attributes to interactive elements that were missing them:
- PlayerControls: Play/Pause, playback speed, shortcuts panel, clear
  in/out-point buttons, and jump-to-frame Go button
- StudioRightPanel: Design, Layers, Motion, and Renders tab buttons
Create a Tooltip component with styled popover (dark bg, border,
shadow) that appears on hover with a 400ms delay. Applied to:
- Left sidebar tabs: Code, Comps, Assets, Catalog
- Right panel tabs: Design, Layers, Motion, Renders

Replaces native title attributes with proper styled tooltips.
@miguel-heygen miguel-heygen merged commit 772d6c7 into main May 22, 2026
30 of 32 checks passed
@miguel-heygen miguel-heygen deleted the feat/studio-catalog-panel branch May 22, 2026 02:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant