Skip to content

feat: improve in-builder preview UX#66

Merged
liamwalder merged 4 commits intodevelopfrom
fix/in-builder-preview-ux
Mar 24, 2026
Merged

feat: improve in-builder preview UX#66
liamwalder merged 4 commits intodevelopfrom
fix/in-builder-preview-ux

Conversation

@tristan-mouchet
Copy link
Copy Markdown
Collaborator

Summary

Rework the in-builder preview to render as a fixed overlay instead of replacing
the canvas, eliminating layout shifts and iframe rebuilds on every toggle.

Changes

  • Render preview as a fixed overlay above the canvas (no sidebar/canvas resize)
  • Add independent zoom state for preview (separate from canvas zoom)
  • Extract shared ViewportZoomControls component for both canvas and preview toolbars
  • Add iframeRef support to useZoom hook for wheel zoom inside iframes
  • Add shortcutsEnabled flag to useZoom to toggle keyboard/wheel handlers per mode
  • Autofit preview on open and on breakpoint switch
  • Scroll canvas to selected layer on breakpoint change with smooth animation
  • Show YCode logo with shimmer text as preview loading indicator
  • Add "Open in browser" button to preview toolbar
  • Add external-link icon to Icon component
  • Fix zoom dropdown width for consistent layout

Test plan

  • Toggle preview mode — canvas should not resize or re-render
  • Cmd+wheel zoom works in both canvas and preview (independently)
  • Cmd+0/1/2 shortcuts only affect the active mode (canvas or preview)
  • Switching breakpoints in preview autofits and does not reload iframe
  • Switching breakpoints on canvas with a selected layer scrolls to it
  • "Open in browser" button opens the page in a new tab
  • Loading state shows YCode logo with shimmer text

@tristan-mouchet tristan-mouchet linked an issue Mar 20, 2026 that may be closed by this pull request
@liamwalder liamwalder self-assigned this Mar 24, 2026
@liamwalder liamwalder merged commit b98dccd into develop Mar 24, 2026
2 checks passed
@liamwalder liamwalder deleted the fix/in-builder-preview-ux branch March 24, 2026 07:47
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.

feat: improve preview loading speed

3 participants