Repository navigation
fix(mobile): give the editor toolbar 44px tap targets and dock the "more" menu as an action sheet - #1298
Open
JonasGao wants to merge 1 commit into
Open
fix(mobile): give the editor toolbar 44px tap targets and dock the "more" menu as an action sheet#1298JonasGao wants to merge 1 commit into
JonasGao wants to merge 1 commit into
Conversation
…ore" menu as an action sheet The editor toolbar was built for the pointer: 23px hit targets and vditor's 25px toolbar buttons, far below the 44x44pt minimum tap target of the iOS Human Interface Guidelines and hard to hit with a thumb. - toolbar items and the send button use 44x44 tap targets (desktop keeps the compact sizes) - with the larger targets the rows no longer fit a phone, so vditor's toolbar and the app's toolbar row scroll horizontally - vditor positions the "more" menu inside its toolbar item, where a scrolling toolbar would clip it, so the menu is moved to <body> when it opens and styled as a viewport-docked action sheet; nested submenus (Headings, Export) expand inline as an accordion and every row gets the same 44px target - the editor's minimum height in dialogs drops from 50vh to 34vh below md, leaving room for the toolbar and the keyboard setupMobileMoreMenu() attaches once vditor has built its toolbar, closes the moved menu the way vditor's own hidePanel() does, and returns a disposer that runs when the editor is destroyed. It is a no-op at >= 768px and when the expected toolbar structure is not found. Co-Authored-By: Claude Code <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The editor toolbar was built for the pointer: 23px hit targets and vditor's 25px toolbar buttons, far below the 44×44pt minimum tap target of the iOS Human Interface Guidelines.
setupMobileMoreMenu()ineditorUtils.tsxattaches once vditor has built its toolbar, closes the moved menu the way vditor's ownhidePanel()does, and returns a disposer that runs when the editor is destroyed. It is a no-op at 768px and up, and when vditor's toolbar structure is not found.The editor's minimum height in dialogs drops from
50vhto34vhon phones, leaving room for the toolbar and the keyboard.Pairs with #1296: once vditor binds
clickon iPhone as well, the sheet's:activefeedback also works there.Evidence
Chromium at 390×844, Android user agent,
mainvs this branch:Measured: vditor items 25×26 to 44×44, app toolbar buttons 23×23 to 44×44, send button 60×32 to 76×44. The vditor toolbar now scrolls (
scrollWidth400 overclientWidth370) instead of overflowing."More" menu:
After, the menu is
position: fixedin<body>, 374×314 at 8px from the sides, fully inside the viewport and topmost at its centre.Inside the bottom sheet from #1297 (iOS user agent, both branches applied):
Merge Danger
Door: two-way
Blast Radius: Mobile editor
IconButtonis shared with the AI chat inputs. There the container keeps its size and only the icon grows to 22px on phones.setupMobileMoreMenu()and the.blinko-more-sheetCSS read vditor 3.11.2's DOM:.vditor-toolbar__item:last-child > .vditor-hint, toggled through inlinedisplay. If that structure changes, the function no-ops and the menu stays inside the scrolling toolbar, which clips it.🤖 Generated with Claude Code