Skip to content

增强 Mermaid 全屏缩放预览并发布 1.2.6 - #18

Merged
bifrost-proxy merged 1 commit into
mainfrom
codex/mermaid-fullscreen-preview
Aug 14, 2026
Merged

bifrost-proxy merged 1 commit into
mainfrom
codex/mermaid-fullscreen-preview

Conversation

@bifrost-proxy

Copy link
Copy Markdown
Owner

功能

  • Markdown 内嵌 Mermaid 与独立 Mermaid 文件增加右上角全屏入口
  • 全屏查看器支持触控板捏合缩放,兼容 Ctrl/Command+wheel 与 macOS WebKit gesture 事件
  • 普通双指滚动保留原生水平/垂直平移
  • 右上角提供缩小、百分比重置、放大与关闭按钮
  • 支持 Escape 退出、焦点恢复和中文操作提示
  • 发布版本更新为 1.2.6

验证

  • npm test:2402 passed,7 skipped
  • npm run lint
  • npm run renderer:build
  • node scripts/sync-tauri-version.mjs --check 1.2.6
  • cargo metadata --format-version 1 --no-deps --locked

@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: a98035fc10

ℹ️ 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 on lines +109 to +110
const handleKeyDown = (event: KeyboardEvent) => {
if (event.key !== "Escape") return;

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 global shortcuts from opening behind the viewer

While the fullscreen viewer is open in the main or note window, shortcuts such as Cmd/Ctrl+K and the quick-switcher shortcut still reach App.tsx's useGlobalShortcuts, because this capture handler only handles Escape. Those dialogs render at z-50, below this viewer's zIndex: 20000, but their inputs still take focus, so subsequent typing goes into an invisible dialog; pressing Escape then closes the viewer and reveals the unexpectedly opened dialog. Suspend the global shortcuts while this modal is active or integrate the viewer with the existing modal state.

Useful? React with 👍 / 👎.

Comment on lines +232 to +233
<div
className="absolute right-4 top-4 z-10 flex items-center gap-1 rounded-lg p-1"

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 Keep viewer controls clear of native caption buttons

On Windows and Linux, the app uses titleBarOverlay and explicitly reserves the top-right 140px for native minimize/maximize/close controls in EditorChromeBar and detached-note UnifiedBar. Positioning this toolbar at right-4 top-4 puts its close button and part of its zoom controls inside that native caption region, so clicks near the top of the viewer can minimize or close the application instead of operating the Mermaid viewer. Offset the toolbar below the 34px titlebar strip or reserve the native-control inset.

Useful? React with 👍 / 👎.

Comment on lines +182 to +184
viewport.scrollLeft = clampScrollOffset(
(viewport.scrollLeft + pending.pointerOffsetX) * ratio -
pending.pointerOffsetX,

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 Exclude fixed viewport padding from anchor scaling

The viewport has fixed 32px horizontal and 64px top padding, but this formula scales scrollLeft + pointerOffsetX as though the diagram began at the viewport's scroll origin. Consequently, trackpad or toolbar zoom does not keep the selected point stationary: zooming from 100% to 800% accumulates about 224px of horizontal and 448px of vertical anchor error from the padding alone. Subtract the unscaled padding before applying the ratio and add it back afterward; the corresponding scrollTop calculation has the same issue.

Useful? React with 👍 / 👎.

@bifrost-proxy
bifrost-proxy merged commit bc96890 into main Aug 14, 2026
7 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