Skip to content

Commit 698a4af

Browse files
committed
fix(web): anchor standalone updater prompt
Generated-By: looper 0.11.8 (runner=fixer, agent=codex)
1 parent 9ec02e6 commit 698a4af

2 files changed

Lines changed: 46 additions & 6 deletions

File tree

apps/web/src/styles/workspace/mention-home.css

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -398,18 +398,18 @@
398398
left: 0;
399399
}
400400

401-
/* Floating account row (top-right cluster): the rocket rides right after the
402-
avatar chip, hugging the viewport's right edge, so the side-flyout base
403-
rule would push the panel off-screen (and `bottom: 0` would grow it past
404-
the top). Open DOWNWARD instead, right-aligned to the host. */
405-
.entry-nav-rail__account--floating .entry-updater-menu .updater-popup {
401+
/* Standalone updater slot (top-right cluster): the rocket rides right after
402+
the account capsule, hugging the viewport's right edge, so the side-flyout
403+
base rule would push the panel off-screen (and `bottom: 0` would grow it
404+
past the top). Open DOWNWARD instead, right-aligned to the host. */
405+
.entry-top-right-cluster > .entry-nav-rail__account-updater .entry-updater-menu .updater-popup {
406406
top: calc(100% + 10px);
407407
bottom: auto;
408408
right: 0;
409409
left: auto;
410410
}
411411

412-
[dir='rtl'] .entry-nav-rail__account--floating .entry-updater-menu .updater-popup {
412+
[dir='rtl'] .entry-top-right-cluster > .entry-nav-rail__account-updater .entry-updater-menu .updater-popup {
413413
right: auto;
414414
left: 0;
415415
}

e2e/ui/updater-popup-stacking.test.ts

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { expect, test } from '@/playwright/suite';
22
import { applyStandardMocks } from '@/playwright/mock-factory';
3+
import { mockAmrPersonalWorkspace } from '@/playwright/amr';
34
import { ensureRailOpen } from '@/playwright/rail';
45
import { T } from '@/timeouts';
56

@@ -77,6 +78,45 @@ test.beforeEach(async ({ page }) => {
7778
});
7879
});
7980

81+
test('[P1] signed-in update prompt opens below the standalone rocket within the viewport', async ({
82+
page,
83+
}) => {
84+
await mockAmrPersonalWorkspace(page);
85+
await page.setViewportSize({ width: 700, height: 600 });
86+
await page.goto('/', { waitUntil: 'domcontentloaded' });
87+
await page.getByText('Loading OpenDesign…').waitFor({ state: 'hidden', timeout: T.long });
88+
await expect(page.getByTestId('entry-nav-account')).toBeVisible();
89+
90+
const updaterButton = page.getByTestId('entry-nav-updater');
91+
await updaterButton.click();
92+
const popup = page.getByTestId('updater-popup');
93+
await expect(popup).toBeVisible();
94+
95+
const geometry = await page.evaluate(() => {
96+
const rocket = document.querySelector('[data-testid="entry-nav-updater"]');
97+
const prompt = document.querySelector('[data-testid="updater-popup"]');
98+
if (rocket == null || prompt == null) return null;
99+
const rocketRect = rocket.getBoundingClientRect();
100+
const promptRect = prompt.getBoundingClientRect();
101+
return {
102+
rocketBottom: rocketRect.bottom,
103+
promptTop: promptRect.top,
104+
promptLeft: promptRect.left,
105+
promptRight: promptRect.right,
106+
viewportWidth: window.innerWidth,
107+
};
108+
});
109+
110+
expect(geometry, 'standalone updater rocket and prompt must both be measurable').not.toBeNull();
111+
expect(geometry!.promptTop, 'prompt must open below the standalone rocket').toBeGreaterThan(
112+
geometry!.rocketBottom,
113+
);
114+
expect(geometry!.promptLeft, 'prompt must stay inside the viewport left edge').toBeGreaterThanOrEqual(0);
115+
expect(geometry!.promptRight, 'prompt must stay inside the viewport right edge').toBeLessThanOrEqual(
116+
geometry!.viewportWidth,
117+
);
118+
});
119+
80120
test('[P1] update ready prompt paints above the composer and its agent picker', async ({ page }) => {
81121
test.fail(
82122
true,

0 commit comments

Comments
 (0)