Skip to content

feat(studio): export the canvas edit overlay so a host can mount its handles - #4708

Merged
miguel-heygen merged 1 commit into
mainfrom
feat/studio-export-dom-edit-overlay
Sep 29, 2026
Merged

miguel-heygen merged 1 commit into
mainfrom
feat/studio-export-dom-edit-overlay

Conversation

@miguel-heygen

@miguel-heygen miguel-heygen commented Sep 28, 2026 •

Copy link
Copy Markdown
Collaborator

What

DomEditOverlay, the canvas layer that draws Studio's move, resize and rotate handles and its snap lines, is exported from the package entry, with its props type DomEditOverlayProps and DomEditGroupPathOffsetCommit.

Why

A host that runs its own preview and picker could only mount ConnectedDomEditOverlay, which throws outside DomEditProvider and reads every handler from a full useDomEditSession. The plain overlay takes its selection and commits as props, but it was declared in the package types without being exported, so a host could not import it.

How

One export line and one export keyword on the props interface. No behaviour change.

Before

A host page with its own preview: the package has no DomEditOverlay to import.

Before: the host cannot import the overlay

After

The same host page mounts DomEditOverlay over its preview with its own selection: the handles draw on the title, and a drag moves it live. Saving the move comes with the geometry commit hook in the stacked PR, so this page passes commits that refuse.

After: handles mounted over the host preview

After: a live drag with the host-mounted handles

Test plan

  • Unit test added (DomEditOverlayHover.test.tsx): the package entry exports the same overlay Studio renders. Removing the export fails it.
  • Manual testing performed: the host page above, driven with Playwright against Studio's dev server and a fixture built for it.
  • Documentation updated (if applicable)
  • Comments follow CONTRIBUTING.md "Comments"

@jrusso1020 jrusso1020 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review at eea028de592ad6d519a915d4ed9d1bb64766b9ab.

Verdict: APPROVE

This adds an export and changes no behaviour. DomEditOverlay, DomEditOverlayProps and DomEditGroupPathOffsetCommit are now exported from the package entry, next to the existing ConnectedDomEditOverlay. The body's claims hold. The component itself is unchanged, and Studio still renders it through ConnectedDomEditOverlay.

Findings

Blocking: none.

Non-blocking:

  1. DomEditOverlayProps uses four types that the package still doesn't export by name: PreviewMouseDownOptions (onCanvasMouseDown), GestureRecordingState (recordingState), and ZOrderPatch and ZOrderAction (onApplyZIndex). A host can still type its handlers, for example as DomEditOverlayProps["onApplyZIndex"], so nothing is blocked. Exporting them would help a host that writes those handlers separately.

Claims checked

  • "Declared in the package types without being exported." True at the base: index.ts exported ConnectedDomEditOverlay and DomEditSelection, but not the plain overlay.
  • The published entry carries it. publishConfig points . at dist/index.js and dist/index.d.ts. After bun run build at this head, dist/index.d.ts exports DomEditOverlay, type DomEditOverlayProps and type DomEditGroupPathOffsetCommit, and dist/index.js exports DomEditOverlay.
  • "Removing the export fails it." True. With the export { DomEditOverlay } line deleted from index.ts, the new test fails (1 failed, 2 passed). I restored the line afterwards.

Tests run

  • bun install --frozen-lockfile and bun run build: clean.
  • vitest run src/components/editor/DomEditOverlayHover.test.tsx: 3/3 pass.
  • tsc --noEmit in packages/studio: clean.

Checks

37 checks pass and none fail, including Typecheck, Build, Test (studio), Lint, Fallow audit, regression, Studio and player captures, and Test reachability. Smoke: global install was still pending when I posted this. The rest are skipped by path filters.

Gate

There were no reviews on this head when I posted. reviewDecision is REVIEW_REQUIRED and mergeStateStatus is BLOCKED. The branch requires approval of the last push, so an approval at this head clears the review requirement.

— Rames

@miguel-heygen
miguel-heygen added this pull request to the merge queue Sep 29, 2026
Merged via the queue into main with commit cc792d4 Sep 29, 2026
94 of 95 checks passed
@miguel-heygen
miguel-heygen deleted the feat/studio-export-dom-edit-overlay branch September 29, 2026 00:50
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.

2 participants