MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / scrollState

Function scrollState

graph-ui/tools/smoke-w8.mjs:370–395  ·  view source on GitHub ↗
(page)

Source from the content-addressed store, hash-verified

368 * dieses Zyklus entstehen im Ruhezustand, wie die dortigen auch.
369 */
370const scrollState = (page) =>
371 page.evaluate(() => {
372 const regions = [];
373 for (const node of document.body.querySelectorAll('*')) {
374 if (node.closest('.monaco-editor') !== null) {
375 continue;
376 }
377 const style = globalThis.getComputedStyle(node);
378 const scrollsY = (style.overflowY === 'auto' || style.overflowY === 'scroll')
379 && node.scrollHeight > node.clientHeight + 1;
380 const scrollsX = (style.overflowX === 'auto' || style.overflowX === 'scroll')
381 && node.scrollWidth > node.clientWidth + 1;
382 if (!scrollsY && !scrollsX) {
383 continue;
384 }
385 regions.push({
386 name: node.getAttribute('data-testid')
387 ?? (node.getAttribute('class') ?? '').split(/\s+/).filter(Boolean)[0]
388 ?? node.tagName.toLowerCase(),
389 top: Math.round(node.scrollTop),
390 left: Math.round(node.scrollLeft),
391 hidden: Math.round(node.scrollHeight - node.clientHeight),
392 });
393 }
394 return { regions, atRest: regions.every((region) => region.top <= 1 && region.left <= 1) };
395 });
396
397/** Ein Beweisbild im Ruhezustand. Wortgleich mit smoke-w9. */
398async function shootAtRest(page, file, name) {

Callers 1

shootAtRestFunction · 0.70

Calls 1

pushMethod · 0.45

Tested by

no test coverage detected