Skip to content

Fix: Post Editor: Canvas animates from the left when switching mobile/tablet preview to desktop - #81484

Open
hbhalodia wants to merge 4 commits into
WordPress:trunkfrom
hbhalodia:fix/issue-81417
Open

Fix: Post Editor: Canvas animates from the left when switching mobile/tablet preview to desktop#81484
hbhalodia wants to merge 4 commits into
WordPress:trunkfrom
hbhalodia:fix/issue-81417

Conversation

@hbhalodia

Copy link
Copy Markdown
Contributor

What?

Closes #81417

Why?

  • PR aims to fix the animation issue, when viewport is changed from tablet --> desktop and mobile -->desktop. It animates from the left edge, while all other animation are centrally expands.

How?

  • This PR adds the little CSS fix and provide, flex-direction: column. The parent container was meant to handle centering with align-items: center, and its comment even said (flex-direction is column) — but flex-direction was never actually set. It defaults to row, where align-items: center centers vertically, not horizontally. So horizontal centering quietly fell back to that conditional margin.

Testing Instructions

Testing Instructions for Keyboard

  1. Open any post or page in the Post Editor.
  2. Open the viewport selector in the top toolbar.
  3. Select Mobile or Tablet.
  4. Switch back to Desktop.
  5. Observe the editor canvas transition. This should be same as how tablet to mobile or mobile to tablet is.

Screenshots or screencast

Before

Screen.Recording.2026-08-12.at.2.55.25.PM.mov

After

Screen.Recording.2026-08-12.at.2.54.55.PM.mov

Use of AI Tools

  • Claude Code, Opus 5.
  • Used for initial drafting and edge case check for the animation. Implementation was reviewed and test by me.

Detailed AI Summary

See the comment here in the issue.

@github-actions github-actions Bot added the [Package] Editor /packages/editor label Aug 12, 2026
@github-actions

github-actions Bot commented Aug 12, 2026

Copy link
Copy Markdown

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: hbhalodia <hbhalodia@git.wordpress.org>
Co-authored-by: t-hamano <wildworks@git.wordpress.org>
Co-authored-by: adithya-naik <adithyanaik@git.wordpress.org>
Co-authored-by: sergiu-radu <sergiuradu@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@hbhalodia hbhalodia added [Type] Bug An existing feature does not function as intended General Interface Parts of the UI which don't fall neatly under other labels. labels Aug 12, 2026
@hbhalodia hbhalodia self-assigned this Aug 12, 2026
@hbhalodia
hbhalodia requested review from mirka and t-hamano August 12, 2026 09:30
@t-hamano

Copy link
Copy Markdown
Contributor

Thanks for the PR. I haven't tested this yet, but it looks good, so let's consider it for a minor release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

General Interface Parts of the UI which don't fall neatly under other labels. [Package] Editor /packages/editor [Type] Bug An existing feature does not function as intended

Projects

Status: 🔎 Needs Review

Development

Successfully merging this pull request may close these issues.

Post Editor: Canvas animates from the left when switching mobile/tablet preview to desktop

2 participants