From e2fedc92a789db4c1fe5d6575108cc43265a10a4 Mon Sep 17 00:00:00 2001 From: Christophe Besson Date: Wed, 16 Sep 2026 16:42:00 +0200 Subject: menu: give the panel the room that is actually below it `max-height: calc(100vh - 16px)` says how tall the menu may be and nothing about where its bottom lands, so one opened partway down the window ran past it and its last rows scrolled out of reach. Measure from where the panel was placed, and re-measure when a submenu opens. Co-Authored-By: Claude Opus 5 --- docs/playlists.md | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'docs') diff --git a/docs/playlists.md b/docs/playlists.md index c450815..badbc99 100644 --- a/docs/playlists.md +++ b/docs/playlists.md @@ -819,8 +819,23 @@ The codebase has no context menu and no dropdown outside the account menu in instant it was wheeled or its scrollbar dragged, and no track below the fold could be reached. Measured by `menu_scroll_probe.py`; `playlist_ui_probe.py` cannot see it, because `.click()` scrolls nothing. -- flips its anchor when it would open past the viewport edge, which on a phone - is most of the time. +- **measures where it can go, and is given exactly that much room.** It opens at + the pointer when the list fits below it, flips above when it does not and there + is more room there, and in either case its `max-height` is the distance from + where it was just placed to the bottom of the window. The stylesheet's + `max-height: calc(100vh - 16px)` is only a floor: it says how *tall* the panel + may be and nothing about where its *bottom* lands, so a panel opened 300 px + down the window ran 300 px past the bottom of it. It scrolled — and its last + rows scrolled into a part of itself that is off the screen, which no further + scrolling brings back. That was the "the last track cannot be reached" report, + and it is the second of two defects with that one symptom; the first, above, + hid it. Both are measured by `menu_scroll_probe.py`. +- **re-measures when a submenu opens.** The height changes inside `MenuItems`' + own state, and `loadItems` arrives later still, so `MenuItems` reports upward + rather than `Menu` watching for it: a `ResizeObserver` on the panel would be an + observer on the very box the callback resizes, and the browser breaks that loop + by raising an error. Without the report a two-row menu opened low keeps the + 192 px it was measured for and threads sixty tracks through that porthole. - submenus **expand in place**, downward, at every width. This is the correction: the proposal wanted a flyout with a sheet on a coarse pointer, and the account menu's language list (`app.js`) already shows the simpler answer. -- cgit v1.2.3