Skip to content

More tolerant diagram layout width - #158

Merged
cyanzhong merged 1 commit into
mainfrom
develop
Aug 2, 2026
Merged

More tolerant diagram layout width#158
cyanzhong merged 1 commit into
mainfrom
develop

Conversation

@cyanzhong

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Improves how Mermaid diagrams behave when the preview page is zoomed in, aiming to prevent diagrams from shrinking due to reduced effective layout width during zoom.

Changes:

  • Centralized preview zoom application via setPageZoom() and added a zoomed-in marker class when zoom > 1.
  • Added Mermaid-specific CSS in the zoomed-in state to enable horizontal scrolling and adjust SVG sizing behavior.

Reviewed changes

Copilot reviewed 2 out of 4 changed files in this pull request and generated 1 comment.

File Description
styles/main.css Adds .zoomed-in Mermaid layout overrides (scrolling + SVG sizing).
src/view.ts Introduces setPageZoom() and uses it for cached zoom restore and keyboard zoom handling.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread styles/main.css Outdated
@cyanzhong
cyanzhong merged commit 018bebb into main Aug 2, 2026
1 check 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