fix(frontend): center gate dialogs on the app area, not the browser viewport
Embedded in the Omics Portal the SPA sits to the right of the portal sidebar,
but dialogs used `fixed left-1/2` — centered on the whole browser window, so
gates rendered visibly off-center (overlapping the sidebar).
- AppShell publishes the app area's horizontal geometry (--app-area-left/width)
as CSS vars on <html> via ResizeObserver + window resize.
- DialogContent centers on those vars (falls back to the viewport when the app
is standalone, where the two coincide).
- ArtifactGateWidget: narrower — cap at 52rem instead of 70vw.
- tools/replay: resume now returns {id, alreadyActive} JSON — the post-f979ada
frontend reads result.alreadyActive and a bare 204 broke replay resume.
Verified on the replay harness: with a simulated 300px portal sidebar the gate
centers on the app area (center 790 = 300 + 980/2); standalone unchanged.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -35,7 +35,9 @@ class ControlledResizeObserver {
|
||||
|
||||
function setContainerWidth(element: HTMLElement, width: number) {
|
||||
Object.defineProperty(element, "clientWidth", { configurable: true, value: width });
|
||||
act(() => ControlledResizeObserver.instances.at(-1)?.trigger());
|
||||
// AppShell registers more than one observer (activity split + app-area CSS vars):
|
||||
// trigger them all so the layout sync isn't skipped.
|
||||
act(() => ControlledResizeObserver.instances.forEach((o) => o.trigger()));
|
||||
}
|
||||
|
||||
function deferred() {
|
||||
|
||||
Reference in New Issue
Block a user