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

Function scrollState

graph-ui/tools/smoke-w10b.mjs:476–504  ·  view source on GitHub ↗
(page)

Source from the content-addressed store, hash-verified

474
475/** Wo jeder scrollbare Bereich steht. Wortgleich aus smoke-w9 (Beweisbilder). */
476const scrollState = (page) =>
477 page.evaluate(() => {
478 const regions = [];
479 for (const node of document.body.querySelectorAll('*')) {
480 if (node.closest('.monaco-editor') !== null) {
481 continue;
482 }
483 const style = globalThis.getComputedStyle(node);
484 const scrollsY = (style.overflowY === 'auto' || style.overflowY === 'scroll')
485 && node.scrollHeight > node.clientHeight + 1;
486 const scrollsX = (style.overflowX === 'auto' || style.overflowX === 'scroll')
487 && node.scrollWidth > node.clientWidth + 1;
488 if (!scrollsY && !scrollsX) {
489 continue;
490 }
491 regions.push({
492 name: node.getAttribute('data-testid')
493 ?? (node.getAttribute('class') ?? '').split(/\s+/).filter(Boolean)[0]
494 ?? node.tagName.toLowerCase(),
495 top: Math.round(node.scrollTop),
496 left: Math.round(node.scrollLeft),
497 hidden: Math.round(node.scrollHeight - node.clientHeight),
498 });
499 }
500 return {
501 regions,
502 atRest: regions.every((region) => region.top <= 1 && region.left <= 1),
503 };
504 });
505
506// ------------------------------------------------------------- Klickstrecke -
507

Callers 1

shootAtRestFunction · 0.70

Calls 1

pushMethod · 0.45

Tested by

no test coverage detected