Portal the "tell it how" popover so no card can clip it - #384
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
RegenGuidenow renders the panel throughcreatePortalonto<body>withposition: fixed, placed from the caret'sgetBoundingClientRect():align, clamped inside the windowresizeand on anyscroll(window capture listener)z-index: 1200so it stays above the 1000/1100 modals it is no longer stacked insideVerification
Scratch harness (not committed): button inside a 520px
overflow:hiddenscrolling card next to a grey column, in the app browser pane.npm run buildpassesNot verified live: scroll re-placement. The pane's tab reports
visibilityState: hidden, so the browser dispatches no scroll events or animation frames there (requestAnimationFramenever ran); triggering the same placement routine via a syntheticresizemoved 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