mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-11-16 06:19:21 +00:00
fix(studio): put the timeline's portaled surfaces on the tier the other portals use (#3414)
* fix(studio): put the timeline's portaled surfaces on the tier the other portals use The FX popover, the grouping dialog it swaps for, and the automation selection menu are all portaled to `document.body`, so they land in the root stacking context — where they sat at `z-50` while the app's own chrome occupies 60, 90, 91, 92, 94, 100 and 110, and every other portal that has to clear that chrome (`Tooltip`, `AssetContextMenu`, `InlineTextToolbar`, `RenderQueue`) already uses `z-[200]`. These three were the odd ones out. Scoped honestly: the clipping in the report is fixed by the height cap in the previous commit, which is what actually cut the popover off at the timeline chrome. This commit is tier consistency — it removes the standing risk of a portaled timeline surface losing to any of those seven higher tiers, rather than a demonstrated repro. Confirm against a real window before claiming more. * fix(studio): move the remaining body-portaled context menus to the same tier The all-sites audit in review was right and the previous commit did half the set. Using `createPortal(…, document.body)` as the predicate rather than the timeline directory, four more surfaces sit in the root stacking context at `z-50` below the seven chrome tiers (60, 90, 91, 92, 94, 100, 110): - `player/components/ClipContextMenu.tsx:51` - `player/components/TrackGapContextMenu.tsx:78` - `player/components/KeyframeDiamondContextMenu.tsx:99` - `components/editor/CanvasContextMenu.tsx:215` The fourth is the easy one to miss — it is the only one outside `player/components/`, so a timeline-scoped sweep finds exactly the other three. It belongs to the same set by its own account: its className is byte-identical to `ClipContextMenu`'s and its header comment says it mirrors that file's look, positioning, and dismiss behaviour, portaled to `document.body`. Two body portals deliberately left alone. `sidebar/BlocksTab.tsx:125` portals `PromptPreviewModal`, which carries its own `z-[100]`/`z-[110]` modal tier — a `z-` class on the portal wrapper would be dead weight. `RenderQueue.tsx:235` is already `z-[200]`. `FileTree.tsx:336` and `FileTreeNodes.tsx:103` are `fixed z-50` but are NOT portaled — they render inside the sidebar's own stacking context, so the root-context argument does not reach them and raising them would be an unrelated change. Crossing the `z-[100]`/`z-[110]` modal backdrops is unreachable for the same reason it was for the first three: all four dismiss on an outside pointerdown, so the press that opens a modal closes the menu first. `CanvasContextMenu.test.tsx:95` asserted on `.fixed.z-50` to prove the menu did NOT render; left as-is it would have passed vacuously against any tier. Updated to the new class so it still fails if the menu renders. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> * fix(studio): correct the interval in the popover in-bounds test comment `bottom: 32` with `maxHeight: 160` in a 200px viewport puts the box at y = 8..168, not y = 8..40 — the bottom edge sits at `innerHeight - bottom`, and the comment read it as the height instead. The assertions below already computed the right geometry; only the stated interval was wrong, on a regression test whose comment is the next reader's model of what it pins. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5
parent
277fe0fa22
commit
8612cfd40f
@@ -92,7 +92,7 @@ describe("CanvasContextMenu — handler gating", () => {
|
||||
|
||||
// No menu opened at all — no buttons, no dead-end items, no DOM mutation.
|
||||
expect(menuButtons()).toHaveLength(0);
|
||||
expect(document.body.querySelector(".fixed.z-50")).toBeNull();
|
||||
expect(document.body.querySelector(".fixed.z-\\[200\\]")).toBeNull();
|
||||
expect(el.style.zIndex).toBe("3");
|
||||
});
|
||||
|
||||
|
||||
@@ -212,7 +212,7 @@ export const CanvasContextMenu = memo(function CanvasContextMenu({
|
||||
return createPortal(
|
||||
<div
|
||||
ref={menuRef}
|
||||
className="fixed z-50 bg-neutral-900 border border-neutral-700 rounded-md shadow-lg py-1 min-w-[180px]"
|
||||
className="fixed z-[200] bg-neutral-900 border border-neutral-700 rounded-md shadow-lg py-1 min-w-[180px]"
|
||||
style={{ left: adjustedX, top: adjustedY }}
|
||||
onPointerDown={stopBubble}
|
||||
onMouseDown={stopBubble}
|
||||
|
||||
@@ -160,7 +160,7 @@ describe("TimelineFxPopover", () => {
|
||||
const dialog = withViewportHeight(200, () =>
|
||||
dialogOf(mount({ anchorRect: rect(100, 120) }).host),
|
||||
);
|
||||
// bottom:32 + maxHeight:160 puts the box at y = 8..40 — a margin on each side.
|
||||
// bottom:32 + maxHeight:160 puts the box at y = 8..168 — a margin on each side.
|
||||
expect(dialog.style.bottom).toBe("32px");
|
||||
const bottom = Number.parseFloat(dialog.style.bottom);
|
||||
const height = Number.parseFloat(dialog.style.maxHeight);
|
||||
|
||||
@@ -125,7 +125,7 @@ export function TimelineFxPopover({
|
||||
ref={rootRef}
|
||||
role="dialog"
|
||||
aria-label="Effects"
|
||||
className="z-50 flex flex-col overflow-hidden rounded-md border border-white/10 bg-[#1b1b1f] p-2 shadow-xl"
|
||||
className="z-[200] flex flex-col overflow-hidden rounded-md border border-white/10 bg-[#1b1b1f] p-2 shadow-xl"
|
||||
style={clampedStyle(anchorRect)}
|
||||
onKeyDown={onKeyDown}
|
||||
onPointerDown={(event) => event.stopPropagation()}
|
||||
|
||||
@@ -41,7 +41,7 @@ export const AutomationSelectionMenu = memo(function AutomationSelectionMenu({
|
||||
return createPortal(
|
||||
<div
|
||||
ref={menuRef}
|
||||
className="hf-automation-menu fixed z-50 min-w-[140px] rounded border border-panel-border-input bg-panel-bg-2 py-1 shadow-lg"
|
||||
className="hf-automation-menu fixed z-[200] min-w-[140px] rounded border border-panel-border-input bg-panel-bg-2 py-1 shadow-lg"
|
||||
style={{ left: adjustedX, top: adjustedY }}
|
||||
>
|
||||
{AUTOMATION_SHAPES.map((shape) => (
|
||||
|
||||
@@ -48,7 +48,7 @@ export const ClipContextMenu = memo(function ClipContextMenu({
|
||||
ref={menuRef}
|
||||
role="menu"
|
||||
aria-label="Clip actions"
|
||||
className="fixed z-50 bg-neutral-900 border border-neutral-700 rounded-md shadow-lg py-1 min-w-[180px]"
|
||||
className="fixed z-[200] bg-neutral-900 border border-neutral-700 rounded-md shadow-lg py-1 min-w-[180px]"
|
||||
style={{ left: adjustedX, top: adjustedY }}
|
||||
>
|
||||
{splitLabel && (
|
||||
|
||||
@@ -96,7 +96,7 @@ export function KeyframeDiamondContextMenu({
|
||||
ref={menuRef}
|
||||
role="menu"
|
||||
aria-label="Keyframe actions"
|
||||
className="fixed z-50 bg-neutral-900 border border-neutral-700 rounded-md shadow-lg py-1 min-w-[180px] overflow-y-auto"
|
||||
className="fixed z-[200] bg-neutral-900 border border-neutral-700 rounded-md shadow-lg py-1 min-w-[180px] overflow-y-auto"
|
||||
style={{ left: adjustedX, top: adjustedY, maxHeight: `calc(100vh - ${adjustedY + 8}px)` }}
|
||||
>
|
||||
{onMoveToPlayhead && (
|
||||
|
||||
@@ -79,7 +79,7 @@ export function TimelineFxButton(props: TimelineFxButtonProps) {
|
||||
<div
|
||||
role="dialog"
|
||||
aria-label="Group these clips to add effects"
|
||||
className="z-50 w-56 rounded-md border border-white/10 bg-[#1b1b1f] p-2.5 text-[11px] text-white/75 shadow-xl"
|
||||
className="z-[200] w-56 rounded-md border border-white/10 bg-[#1b1b1f] p-2.5 text-[11px] text-white/75 shadow-xl"
|
||||
style={{ position: "fixed", left: anchorRect.left, top: anchorRect.bottom + 4 }}
|
||||
onPointerDown={(event) => event.stopPropagation()}
|
||||
>
|
||||
|
||||
@@ -75,7 +75,7 @@ export const TrackGapContextMenu = memo(function TrackGapContextMenu({
|
||||
return createPortal(
|
||||
<div
|
||||
ref={menuRef}
|
||||
className="fixed z-50 bg-neutral-900 border border-neutral-700 rounded-md shadow-lg py-1 min-w-[180px]"
|
||||
className="fixed z-[200] bg-neutral-900 border border-neutral-700 rounded-md shadow-lg py-1 min-w-[180px]"
|
||||
style={{ left: adjustedX, top: adjustedY }}
|
||||
onPointerLeave={() => onHoverAction(null)}
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user