Skip to content

fix: #5884 remove the extra Edit menu separator on Windows/Linux - #5885

Open
Jocs wants to merge 1 commit into
developfrom
codex/fix-5884-edit-menu-separator
Open

Jocs wants to merge 1 commit into
developfrom
codex/fix-5884-edit-menu-separator

Conversation

@Jocs

@Jocs Jocs commented Oct 25, 2026

Copy link
Copy Markdown
Member

Closes #5884

Summary

On Windows, opening Edit still shows two separators between Find in Folder and Line Ending, even after #4797. That fix sets visible: false on the separator following the macOS-only Screenshot item, but Chromium's SimpleMenuModel::IsVisibleAt bypasses command visibility for separators. The existing test filtered out hidden separators itself, so it missed the native behavior.

Build the Screenshot item and its trailing separator only on macOS. Windows/Linux now receive exactly one separator between Find in Folder and Line Ending; macOS retains the Screenshot item, shortcut, handler, and surrounding separators.

Update the regression coverage to account for native separator visibility, assert the exact Windows/Linux section, and preserve the macOS section.

Type of change

  • Bug fix (non-breaking, fixes an issue)
  • New feature (non-breaking, adds functionality)
  • Breaking change (causes existing functionality to change)
  • Documentation update

Test plan

  • Regression tests updated for Windows, Linux, and macOS menu templates.
  • Verified the updated regression suite fails before the fix: Windows/Linux fail, macOS passes.
  • After the fix, 4 related suites / 20 tests pass: edit-menu-separator, edit-menu-native-clipboard-roles-5582, application-menu-state, and reading-mode.
  • pnpm run typecheck
  • pnpm run lint (0 errors; 166 existing warnings)
  • git diff --check
  • Manually tested on Windows/Linux.

Notes for reviewers

Validation ran on macOS, with platform-specific menu configuration mocked in the unit tests. The visibility check models Chromium's native separator handling; it does not claim a Windows GUI run. A Windows environment was unavailable, so there is no Windows screenshot or recording.

The related suites were run with a temporary Vite server.fs.allow override because this worktree reuses dependencies through symlinks to another checkout. No repository test configuration was changed.

Native behavior reference: Chromium SimpleMenuModel::IsVisibleAt, where separator visibility uses the native item's visibility rather than Delegate::IsCommandIdVisible.


By submitting this pull request, I confirm that my contribution is made under the terms of the MIT license.

@github-actions

Copy link
Copy Markdown
Contributor

Build artifacts for PR #5885:

Run: https://github.com/marktext/marktext/actions/runs/40196857636

Artifact Size Link
marktext-macos-arm64 300.9 MB Download
marktext-windows-x64 299.7 MB Download
marktext-windows-arm64 291.5 MB Download
marktext-macos-x64 314.2 MB Download
marktext-linux-arm64 523.4 MB Download
marktext-linux-x64 669.5 MB Download

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.

[Bug] Extra separator still appears in the Edit menu in v0.23.0 (Possible Regression)

1 participant