diff --git a/documentation/readme-images/cap5-plugin-studio.png b/documentation/readme-images/cap5-plugin-studio.png index 01b9f55aa..de5514e0f 100644 Binary files a/documentation/readme-images/cap5-plugin-studio.png and b/documentation/readme-images/cap5-plugin-studio.png differ diff --git a/internal/readme-shots.mjs b/internal/readme-shots.mjs index 1af3e9869..968f50c56 100644 --- a/internal/readme-shots.mjs +++ b/internal/readme-shots.mjs @@ -280,15 +280,24 @@ await shot('cap5-plugin-studio', '/doxa-maps/plugin-studio/plugin-studio/index.h before: async (page) => { // The rail lives inside the element's shadow root, so a light-DOM selector finds nothing — // click through an evaluated deep walk instead (the same seen-Set walk the readiness guard uses). + // The rail is an Explorer tree (f63d75e): its plugin rows are .st-row[role=treeitem], and a + // .st-sec row is a section heading, not a plugin. The older .vtl-tab rail is kept as a + // fallback. Without a tree row, the walk would reach the NESTED gallery's own .vtl-tab buttons + // instead, and click a tab inside the plugin rather than a plugin in the rail. await page.evaluate(() => { - const seen = new Set(); let first = null - ;(function w(n) { - if (!n || seen.has(n) || first) return - seen.add(n) - if (n.tagName === 'BUTTON' && /vtl-tab\b/.test((n.className || '').toString())) { first = n; return } - if (n.shadowRoot) w(n.shadowRoot) - for (const c of (n.children || [])) w(c) - })(document.body) + const find = (test) => { + const seen = new Set(); let hit = null + ;(function w(n) { + if (!n || seen.has(n) || hit) return + seen.add(n) + if (n.nodeType === 1 && test(n)) { hit = n; return } + if (n.shadowRoot) w(n.shadowRoot) + for (const c of (n.children || [])) w(c) + })(document.body) + return hit + } + const first = find((n) => n.matches('.st-row[role="treeitem"]:not(.st-sec)')) + || find((n) => n.tagName === 'BUTTON' && /vtl-tab\b/.test((n.className || '').toString())) if (first) first.click() }) await page.waitForTimeout(3000) // let the selected element mount before the main wait