Improvements
Done
Editor: Direction-aware positioning for text selection context menu based on mouse release
What could be better?
- The floating context menu currently always spawns above the top of the selected text, regardless of selection length or dragging direction.
- When selecting multi-line text from top to bottom, the user's cursor finishes at the bottom, yet the toolbar spawns hundreds of pixels away at the very top. This forces unnecessary mouse travel (violating Fitts's Law) and disrupts visual focus.
How so?
Make context menu placement dynamically direction-aware relative to where the selection action terminates:
- For top-to-bottom selections: Anchor the menu directly below the end of the selection (near the mouse release position).
- For bottom-to-top selections or single-line selections: Maintain positioning above the selection.
- Include standard viewport boundary checks so that if a bottom-anchored menu would overflow the screen edge, it gracefully flips back upward.
0 Comments
Sign in to comment
No comments yet. Be the first to share your thoughts.
