Skip to content

Restore mockup controls and canvas rendering - #6

Merged
ehsanking merged 1 commit into
mainfrom
ehsanking-fix-export-dimensions
Oct 3, 2026
Merged

ehsanking merged 1 commit into
mainfrom
ehsanking-fix-export-dimensions

Conversation

@ehsanking

Copy link
Copy Markdown
Owner

Mockup creation had become inaccessible from the studio, and desktop/browser frames did not render as their intended device mockups. This restores the mockup panel and reconnects it to canvas layers so users can create these frames again.

The panel now exposes accessible, keyboard-friendly controls for all mockup types. Desktop and browser layers receive dedicated renderers, and newly added mockups are centered within the active canvas instead of starting at a fixed position.

Validation: lint, build, and the full test suite passed; the mockup panel and desktop/browser additions were also verified in the browser.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings October 3, 2026 20:25

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

Centering is incorrect in several cases, the perspective control has no effect, and the restored workflow lacks regression coverage.

Review effort: Balanced
Findings: 3 Medium severity · 1 Low severity

Open (4)
What changed in this PR

Restores mockup creation in the studio and rendering for desktop/browser frames.

Changes:

  • Restores the mockup sidebar panel with accessible controls.
  • Adds desktop and browser canvas renderers.
  • Centers newly created mockups.
File Description
src/​App.tsx Restores the panel and adds centered placement.
src/​components/​MockupComposer.tsx Improves control accessibility and styling.
src/​components/​DynamicLayerRenderer.tsx Adds desktop and browser frame rendering.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/App.tsx
const mockupSize = {
mobile: { width: 128, height: 256 },
tablet: { width: 192, height: 256 },
laptop: { width: 256, height: 154 },
Comment thread src/App.tsx
Comment on lines +586 to +587
x: Math.max(0, Math.round((displayWidth - mockupSize.width) / 2)),
y: Math.max(0, Math.round((displayHeight - mockupSize.height) / 2)),
Comment thread src/App.tsx
Comment on lines +2754 to +2756
{sidebarActiveTab === 'mockup' && (
<div className="animate-in fade-in duration-150">
<MockupComposer onAddMockup={handleAddMockupLayer} />
Comment thread src/App.tsx
Comment on lines +2754 to +2756
{sidebarActiveTab === 'mockup' && (
<div className="animate-in fade-in duration-150">
<MockupComposer onAddMockup={handleAddMockupLayer} />

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c9a5a2cab2

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/App.tsx
Comment on lines +2754 to +2756
{sidebarActiveTab === 'mockup' && (
<div className="animate-in fade-in duration-150">
<MockupComposer onAddMockup={handleAddMockupLayer} />

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Prevent mockups from being added to infographic assets

When the active asset is infographic, this unconditionally exposes the composer and handleAddMockupLayer appends the new layer to canvasLayers.infographic, but the infographic workspace and its export stage render only the infographic rows and stickers—not canvasLayers.infographic through DynamicLayerRenderer. The user receives a success toast, yet the mockup is absent from both preview and exported infographic; disable this panel for that asset or render the added layers there.

Useful? React with 👍 / 👎.

Comment thread src/App.tsx

{sidebarActiveTab === 'mockup' && (
<div className="animate-in fade-in duration-150">
<MockupComposer onAddMockup={handleAddMockupLayer} />

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Apply the selected 3D tilt to new mockups

The restored composer persists data.tilt3D, but the rendering path wired here is DynamicLayerRenderer, which never reads that property and always uses its ordinary rotate/scale transform. Consequently toggling between isometric and flat before adding any mockup produces identical output; pass this flag into the rendered transform or use the dedicated mockup renderer that implements it.

Useful? React with 👍 / 👎.


if (mockupType === 'browser') {
return (
<div className="w-60 h-44 rounded-2xl border-2 border-slate-700 bg-slate-900 shadow-2xl overflow-hidden flex flex-col select-none">

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Honor frame colors on browser mockups

For browser mockups, selecting silver, gold, or midnight in the composer has no visual effect: this new frame hardcodes bg-slate-900 border-slate-700 and does not apply the computed frameBg classes. Apply frameBg to the browser shell so its persisted frame-color setting is reflected.

Useful? React with 👍 / 👎.

@ehsanking
ehsanking merged commit c4ebd1b into main Oct 3, 2026
2 of 3 checks passed
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