This commit is contained in:
Andras Schmelczer 2026-05-14 08:09:19 +01:00
parent a8165249a4
commit a4103b0896
64 changed files with 5376 additions and 3832 deletions

View file

@ -6,6 +6,7 @@ import {
clearVignette,
hideAdScene,
hideCaption,
scrollPaneTo,
setCursorScale,
showAdScene,
showCaption,
@ -228,6 +229,21 @@ async function runActivity(ctx: ScriptCtx, step: Activity): Promise<void> {
case 'hideAdScene':
await hideAdScene(ctx.page);
return;
case 'scrollPane':
await scrollPaneTo(ctx.page, step.selector, step.top);
return;
case 'openFilterGroup':
// Click is idempotent: if the group is already expanded, the click
// would collapse it — which we don't want. Detect via aria-expanded
// (Radix Accordion sets it on the trigger) and skip the click when
// the group is already open.
await ctx.page.evaluate((selector) => {
const trigger = document.querySelector<HTMLElement>(selector);
if (!trigger) return;
if (trigger.getAttribute('aria-expanded') === 'true') return;
trigger.click();
}, step.selector);
return;
}
}