fix: prevent paragraph menu clipping when sidebar is hidden by Jocs · Pull Request #5711 · marktext/marktext · GitHub
Skip to content

fix: prevent paragraph menu clipping when sidebar is hidden - #5711

Merged
Jocs merged 1 commit into
developfrom
fix/5710-paragraph-menu-clipping
Oct 11, 2026
Merged

Jocs merged 1 commit into
developfrom
fix/5710-paragraph-menu-clipping

Conversation

@Jocs

@Jocs Jocs commented Oct 11, 2026

Copy link
Copy Markdown
Member

Closes #5710

Summary

Hiding the sidebar places the paragraph button near the left edge of the window. Opening its centered menu in an 800px-wide Electron window positioned the menu at x = -56px, cutting off its left side.

Add Floating UI shift middleware after offset and flip so shared floating menus stay within the window with 8px of padding. Add an Electron regression test that hides the sidebar, checks both horizontal menu boundaries, and converts the paragraph to a heading through the menu.

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

  • New tests added
  • Manually tested on: automated Electron tests run on macOS

Validation:

  • Reproduced before the fix: regression test failed with menu x = -56px.
  • After the fix: paragraph-menu regression and layout-toggle E2E specs passed (5 tests).
  • BaseFloat hide-race unit tests passed (2 tests).
  • pnpm run build:unpack, pnpm run lint, and pnpm run typecheck passed.
  • Muya lint and type checks passed. Lint reports existing warnings only.

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

@Jocs
Jocs merged commit 761afaf into develop Oct 11, 2026
18 checks passed
@Jocs
Jocs deleted the fix/5710-paragraph-menu-clipping branch October 11, 2026 15:19
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] Toolbar panel cut off when sidebar is hidden

1 participant