fix(ui): phone-width overflows in the audit's flagged rows, with an e2e check (#1757)
deploy / gate (push) Successful in 4m54s
Quality / check (push) Successful in 6m36s
deploy / archied-image (push) Successful in 3m23s
deploy / agent-image (push) Successful in 11s
deploy / dist-zip (push) Skipped

Grants rows and toggle groups wrap with a smaller phone label; the token
form wraps and its input flexes; the sources name column caps at full
width and its action buttons wrap; the rule-editor condition row wraps
with a full-width phone select; the payload tree indents less and breaks
long JSON leaves; the topbar instance badge truncates; org agent rows
keep Assign inline and move Rename/Suspend/Retire into a MoreMenu. New
e2e check phone-overflow.cjs visits these views at 390x844 with seeded
data and asserts no horizontal scroll.
This commit is contained in:
sam committed 2026-11-06 23:23:16 +11:00
1 parent 94f79177a2
commit 461d3dc1f7
8 files changed
+91 -31

No files matched your search

+61
View File
@@ -0,0 +1,61 @@
// Phone-width sweep of the views the November audit flagged (#1757): at
// 390x844 each must fit without horizontal scroll or clipped controls. The
// topbar (with its instance badge) is on every page; /account holds the
// token form, /org/agents the agent rows and the grants card, /events the
// sources table, the event-type rule editor and the mapping editor dialog.
const assert = require('node:assert/strict');
module.exports = async ({ page, go, shot, fail, settled }) => {
await page.setViewportSize({ width: 390, height: 844 });
const assertNoOverflow = async (label) => {
const { scrollWidth, innerWidth } = await page.evaluate(() => ({
scrollWidth: document.documentElement.scrollWidth,
innerWidth: window.innerWidth,
}));
if (scrollWidth > innerWidth) {
fail(`${label} overflows 390px: scrollWidth=${scrollWidth} > innerWidth=${innerWidth}`);
}
};
const visit = async (path, label, waitFor) => {
await go(path);
if (waitFor) await settled(waitFor);
await assertNoOverflow(label);
await shot(label);
};
await visit('/account', 'account-tokens', 'text=API tokens');
await visit('/org/agents', 'org-agents', 'text=Credential grants');
await go('/events');
await settled('[role=tab]');
await assertNoOverflow('events');
await shot('events');
// The seeded event type's rule editor (RuleEditor's condition row) opens
// from the Edit button on its row.
const editType = page.locator('button[aria-label^="Edit "]').first();
if (await editType.count()) {
await editType.click();
await page.getByRole('dialog').first().waitFor();
await settled();
await assertNoOverflow('event-type rule editor');
await shot('rule-editor');
await page.keyboard.press('Escape');
await settled();
}
// The mappings tab's editor dialog carries the payload tree.
await page.getByRole('tab', { name: 'Map' }).click();
await settled('text=New mapping');
await assertNoOverflow('mappings list');
const editMapping = page.locator('button', { hasText: 'Edit' }).first();
if (await editMapping.count()) {
await editMapping.click();
await page.getByRole('dialog').first().waitFor();
await settled();
await assertNoOverflow('mapping editor dialog');
await shot('mapping-editor');
}
};