Repository navigation
fix(menus): keep every menu under the bar, cap its height and show a more-below hint (0.47.0) - #18
Merged
Merged
Conversation
MenuBar.open used openAt, the right-click routine, which flipped a menu that did not fit above its point and clamped it to 4 px from the window top, so a long menu in a short window covered the bar. Submenus clamped to the window top as well. Bar menus now open with openUnder: the top is the button's bottom edge plus 4, never moved up, and max-height is menuCap(y), the smaller of 75% of the window and the room to its bottom, set while hidden and before measuring. openBeside takes the root menu's floor and the same cap, and never places a submenu above the floor. Run: tsc --noEmit.
A bar menu or submenu that is cut off by the cap fades its last rows into the menu's own background and shows a small pill with a down chevron at its bottom while rows remain below. It is in place when the menu opens, fades out in 160 ms at the last row and back in over 490 ms, and switches with no fade under reduced motion. The panel becomes a card holding a scrolling .menu-list and the .menu-more pill; the mask sits on the list so the card's border and shadow stay as they were. Run: tsc --noEmit.
…t (0.47.0) ContextMenu clamped a menu's top to 8 px from the window top with only the stylesheet's cap, so a long right-click menu opened low in a short window was pushed up over the menu bar. Every ContextMenu opening now takes the bar's bottom edge plus 4 as its floor (8 px when the bar is hidden for the macOS menu bar), sets max-height to menuCap(floor) before measuring, and shows the same more-below hint. It still opens at the pointer as before; submenus take the same floor and cap. PopupMenu.openAt gets the same floor, cap and hint. Run: tsc --noEmit.
Menus from the bar stay under it, right-click and other menus opened at a point never go above the bar's bottom edge, every menu takes a cap of three quarters of the window, and a cut-off menu shows a more-below hint. The Shell wiki page says so. Every version site moved from 0.46.2 to 0.47.0 by hand.
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.
fix(menus): keep every menu under the bar, cap its height and show a more-below hint (0.47.0)
Summary
MenuBar.openusedopenAt, the right-click routine, which flipped a menu that did not fit and clamped it to 4 px from the window top. Fix: a newopenUndersets the top to the button's bottom edge plus 4 andmax-heighttomenuCap(y)(the smaller of 75% of the window and the room below), while the panel is hidden and before measuring.openBeside) take the root menu's floor and the same cap, so they never sit above the bar..menu-listand the.menu-morepill, so border and shadow are unchanged.ContextMenuinui/context-menu.ts, also used by the tag cloud, rating button and saved searches) andPopupMenu.openAtkeep their pointer-corner placement but take the bar's bottom edge plus 4 as their floor (8 px when the bar is hidden for the macOS menu bar), the same cap and the same hint. Cause: they clamped only to 8 px from the window top.frontend/HASHOUT_LOG.md; the Shell wiki page describes the new behaviour.Commits
Version
v0.47.0 (release commit is last), a minor bump from 0.46.2. Bumped:
src-tauri/tauri.conf.json,src-tauri/Cargo.toml, the app's own entry insrc-tauri/Cargo.lock,native/formref-core/Cargo.tomland its own entry innative/formref-core/Cargo.lock,frontend/package.json, the two own-version fields offrontend/package-lock.json,backend/app/core/config.pyVERSION,clipper/manifest.json, the sidebar foot and the About line infrontend/index.html, and the README badge.CHANGELOG.mdhas a v0.47.0 section. No demo bundles are tracked in this repo.Checks
npm run buildinfrontend(runstsc --noEmitthenvite build): clean; only the existing chunk-size warning.frontend/distserved without the engine), all eight bar menus at 1280x800 and 1000x480: every menu's top was 42 px against a bar bottom of 37.5 px, and no frame while opening showed it higher. At 1280x800 Images and Organize hit the cap (600 px = 75% of 800) with the hint on; the others fit (140 to 568 px) with the hint off. At 1000x480 File, Edit, View, Images and Organize were capped at 360 px (75% of 480) with the hint on; Insert, Window and Help fit with the hint off. Every menu's bottom was inside the window, and every hint was off after scrolling to the last row.Not run: the right-click menu was not measured, because without the engine no board loads and a right-click on the canvas opened no menu in the probe; no "before" build of origin/main was measured. The existing window test (
frontend/tests/window/test_window.py) was not run, as it needs the Python engine and the Rust core binary. Not run either: the four-size matrix beyond the two sizes above, the hint fade timings, End and Home and other keyboard checks, submenu placement, and the desktop shell on any OS. DOM law: verified under throttling for the bar menus only (lowest top seen in any frame while opening equals the final top; hint state correct on open); not verified for right-click menus.Merging
Merge with a merge commit so each commit and its signature stays. Do not squash.