mirror of
https://github.com/NanmiCoder/cc-haha
synced 2026-07-16 13:03:31 +08:00
The add-to-chat popover was keyed off the mouse-up location, so broad selections could cover the selected text and stale popovers could remain visible. Shared placement and dismissal logic now anchors the action to the selected range, prefers the space above the selection like Codex App, and clears stale selections on outside clicks. Constraint: Desktop chat and workspace previews share the same selection affordance and must keep their existing add-reference behavior. Rejected: Keep cursor-based placement | it can hide selected text and makes multi-line selections unpredictable. Confidence: high Scope-risk: moderate Directive: Keep future selection actions range-anchored and outside-click dismissible across chat and workspace surfaces. Tested: bun run check:desktop Tested: Browser verification on http://127.0.0.1:5174 showed the popover above selection, no overlap, and outside click clearing it. Not-tested: Native packaged Tauri window. Related: https://github.com/NanmiCoder/cc-haha/issues/484