Skip to main content
Run any Skill in Manus
with one click

floating-popup-position

Stars0
Forks0
UpdatedJuly 11, 2026 at 08:33

选区浮层(划词工具条 / AI 解释卡 / 评论气泡)的定位算法:在指定矩形范围(通常是 viewport)内,popup 围绕选区按 右→下→左→上 择位,保持安全边距与呼吸间距、永不被裁切;四边都放不下时退化为「遮挡选区面积最小」的位置。零依赖纯函数,~170 行,不引入 @floating-ui。当用户提到 划词工具条放哪 / 选区气泡定位 / popup 超出屏幕被裁切 / tooltip 贴边 clamp / anchored popup 翻转 / 浮层遮住选中内容 时使用。

Installation

Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.

File Explorer
2 files
SKILL.md
readonly