Skip to content

Portal the "tell it how" popover so no card can clip it - #384

Merged
pizzato merged 1 commit into
mainfrom
claude/regen-popover-portal
Sep 7, 2026
Merged

pizzato merged 1 commit into
mainfrom
claude/regen-popover-portal

Conversation

@pizzato

@pizzato pizzato commented Sep 7, 2026

Copy link
Copy Markdown
Owner

Problem

The Re-generate scene / Shoot again tell it how popover in the film editor was cut off at the scene card's right edge (the card is overflow: hidden). The previous fix (9c2dd7f) only slid the panel back inside the window, not inside the clipping card, so left-aligned carets near the card's edge still lost the panel.

Fix

RegenGuide now renders the panel through createPortal onto <body> with position: fixed, placed from the caret's getBoundingClientRect():

  • hangs from the caret's left/right edge per align, clamped inside the window
  • flips above the caret when there is no room below
  • re-places on resize and on any scroll (window capture listener)
  • outside-click closing also treats the portaled panel as "inside"
  • z-index: 1200 so it stays above the 1000/1100 modals it is no longer stacked inside

Verification

Scratch harness (not committed): button inside a 520px overflow:hidden scrolling card next to a grey column, in the app browser pane.

  • right-aligned: panel fully visible, right edge on the caret
  • left-aligned (the film editor's case): panel overhangs the card by ~200px and is fully visible / hit-testable
  • caret near the bottom: panel flips above, inside the window
  • outside click + Escape close; click inside stays open; textarea autofocuses
  • npm run build passes

Not verified live: scroll re-placement. The pane's tab reports visibilityState: hidden, so the browser dispatches no scroll events or animation frames there (requestAnimationFrame never ran); triggering the same placement routine via a synthetic resize moved the panel by exactly the scrolled amount. Worth a quick scroll of the scene list with a popover open when reviewing.

No docs change: the manual describes what the caret does, not where the panel lands.

🤖 Generated with Claude Code

The Re-generate / Shoot again instruction popover was absolutely positioned
inside the scene card, and the film editor's scene card is overflow:hidden,
so a left-aligned popover near the card's right edge was cut off. The
earlier fix only nudged it back inside the window, not inside the card.

RegenGuide now renders the panel through a portal onto <body>, fixed-
positioned from the caret's on-screen rect: it hangs from the caret's left
or right edge per `align`, is clamped inside the window, flips above the
caret when there is no room below, and re-places itself on scroll/resize.
Outside-click detection checks the portaled panel too. z-index 1200 keeps
it above the 1000/1100 modals it is no longer stacked inside.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@pizzato
pizzato merged commit 4538f34 into main Sep 7, 2026
3 checks passed
@pizzato
pizzato deleted the claude/regen-popover-portal branch September 7, 2026 06:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant