- Shipped
- August 7, 2026 at 5:07 AM UTC
- Author
- kamo
- Commit
- 429055b
Right-clicking a folder low in the sidebar opened its menu below the fold. The flip-at-the-edge logic was there but never ran: the component returns null until it has mounted, so on the first pass the portal does not exist and there is nothing for the layout effect to measure. Keyed only on the stayed exactly where the pointer left it. `mounted` is now part of what the measurement depends on. Measurement uses offsetWidth/offsetHeight rather than getBoundingClientRect, which would have reported framer-motion's entry transform and under-measured the menu by 4%. The menu is hidden until it has been placed, so the unplaced frame is never painted. The geometry moved to app/lib/ui/menuPosition.ts and grew the cases it was its own height so a short window scrolls the menu instead of losing the end of it. An exhaustive sweep down the sidebar asserts it stays on screen; that sweep is what caught the past-the-margin case. The message row menu had the same class of bug, clamped against a hard-coded 320px height that no longer matched what it rendered. It now measures itself through the same helper, and its callers pass the raw pointer position.