Skip to content

feat(preview): add browser-chrome and phone-bezel frames to previews - #627

Open
Fardin7798 wants to merge 1 commit into
abi:mainfrom
Fardin7798:feat/preview-device-frames
Open

feat(preview): add browser-chrome and phone-bezel frames to previews#627
Fardin7798 wants to merge 1 commit into
abi:mainfrom
Fardin7798:feat/preview-device-frames

Conversation

@Fardin7798

Copy link
Copy Markdown

Closes #176.

What

Adds a lightweight visual frame around the desktop and mobile previews so they look like a real browser window / phone, instead of a bare iframe:

  • Desktop: macOS-style toolbar (red/yellow/green traffic-light dots) above the rendered page, rounded corners, subtle shadow.
  • Mobile: dark bezel with a top notch and bottom home-indicator bar, rounded corners.

How

The transform/scale that fits the preview to the available pane was previously applied directly to the <iframe>. It's now applied to a wrapping "frame" div that contains the chrome + the iframe together, so the toolbar/bezel scale down in proportion with the page — the same way a real browser window looks when you resize it. The iframe itself is unchanged for event handling / select-and-edit purposes (ref, load listeners, etc. all still target the iframe directly).

Testing

  • tsc --noEmit — clean
  • eslint on the changed file — clean
  • vite build — succeeds
  • Manually reasoned through the scale math for both fit/actual desktop modes and the fixed-scale mobile mode to make sure the frame fills the pane the same way the iframe did before.

Screenshots showing before/after happy to add if useful — let me know if you'd like a different visual treatment (e.g. lighter/no shadow, different bezel color).

Adds a lightweight visual frame around the desktop and mobile previews:

- Desktop: macOS-style toolbar (traffic-light dots) above the page,
  rounded corners and a subtle shadow around the whole window.
- Mobile: dark bezel with a top notch and a bottom home-indicator bar,
  rounded corners like a phone.

The transform/scale that fits the preview to the available pane is now
applied to the frame (chrome + iframe together) instead of the iframe
alone, so the toolbar/bezel scale down in proportion with the page -
the same way a real browser window looks when resized.

Closes abi#176
@Fardin7798
Fardin7798 force-pushed the feat/preview-device-frames branch from 28517f3 to 416dc1f Compare August 30, 2026 10:58
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.

Add a better looking frame for mobile and web previews

1 participant