Commit 098dda2
Fix DM reactions popup drifting off-screen on scroll (#14020)
## Summary
- Fixes a UI positioning bug where the DM reactions popup could drift
upward/off-screen after opening.
- Updates Harmony popup scroll tracking to clamp computed top position
to viewport bounds when auto-flip/clamping is enabled.
## Root Cause
- `Popup` initially clamps its position when opened, but the scroll
listener later recomputed `top` without clamping.
- In scrollable chat containers this allowed the popup to keep moving
upward and leave the viewport.
## Changes
- `packages/harmony/src/components/popup/Popup.tsx`
- In `watchScroll`, compute `nextTop` and clamp to `[0,
window.innerHeight - popupHeight]` unless `disableAutoFlip` is enabled.
- Add `disableAutoFlip` to callback deps.
## Validation
- Manual code-path validation of popup positioning logic.
- Attempted targeted lint command, but local workspace tools were
unavailable (`eslint: not found`) in this environment.
<div><a
href="https://cursor.com/agents/bc-14b2b5b7-8106-5042-8458-54606ab24c62"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://cursor.com/assets/images/open-in-web-dark.png"><source
media="(prefers-color-scheme: light)"
srcset="https://cursor.com/assets/images/open-in-web-light.png"><img
alt="Open in Web" width="114" height="28"
src="https://cursor.com/assets/images/open-in-web-dark.png"></picture></a> <a
href="https://cursor.com/automations/c63aa103-66df-4558-b31d-675358e5c6a1"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://cursor.com/assets/images/view-automation-dark.png"><source
media="(prefers-color-scheme: light)"
srcset="https://cursor.com/assets/images/view-automation-light.png"><img
alt="View Automation" width="141" height="28"
src="https://cursor.com/assets/images/view-automation-dark.png"></picture></a> </div>
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: Ray Jacobson <raymondjacobson@users.noreply.github.com>1 parent ad63e39 commit 098dda2
1 file changed
Lines changed: 9 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
325 | 325 | | |
326 | 326 | | |
327 | 327 | | |
328 | | - | |
| 328 | + | |
329 | 329 | | |
330 | | - | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
331 | 337 | | |
332 | 338 | | |
333 | | - | |
| 339 | + | |
334 | 340 | | |
335 | 341 | | |
336 | 342 | | |
| |||
0 commit comments