Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 8 additions & 9 deletions examples/personal-workspace-browser/goal-workspace-m2.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -151,16 +151,15 @@ export const goalWorkspaceM2Scenario = {
await page.screenshot({path:resolve(outputDir,'overview-populated-mobile.png'),animations:'disabled'});
await page.setViewportSize({width:1440,height:1000});
const expandStart = performance.now();
// A late dependency read can reprioritize the owner groups. Keep each
// keyboard target bound to its owner rather than its current position.
const ownerIds = await now.locator('.goal-owner-group').evaluateAll(groups => groups.map(group => group.dataset.ownerId));
for (const ownerId of ownerIds) {
const summary = now.locator(`.goal-owner-group[data-owner-id="${ownerId}"] .goal-work-more > summary`);
await summary.focus();await page.keyboard.press('Enter');
}
// Each toggle renders asynchronously; the budget below covers all of them.
// Open each still-closed disclosure by keyboard. Owner groups can re-render
// while this runs, so a positional list could re-toggle an open group shut
// and skip another; the budget below covers every toggle.
const closedWork = now.locator('.goal-work-more:not([open]) > summary');
const visibleWork = () => now.locator('.goal-owner-group [data-todo-id]:visible').count();
for (const deadline = Date.now() + 5000; await visibleWork() !== 200 && Date.now() < deadline;) await page.waitForTimeout(50);
for (const deadline = Date.now() + 5000; await visibleWork() !== 200 && Date.now() < deadline;) {
if (await closedWork.count()) {await closedWork.first().focus();await page.keyboard.press('Enter');}
else await page.waitForTimeout(50);
}
assert.equal(await visibleWork(),200,"All work remains reachable in the original owner order");
const expandMs = performance.now() - expandStart;
assert.ok(expandMs < 2000, `Full 200-item expansion exceeded 2s budget: ${expandMs}ms`);
Expand Down
Loading