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

Function nativeTitles

graph-ui/tools/lib/readability.mjs:879–906  ·  view source on GitHub ↗
(page)

Source from the content-addressed store, hash-verified

877 * wie `explainsMore` in src/ui/tooltip/tooltip-model.ts.
878 */
879export async function nativeTitles(page) {
880 return page.evaluate(() => {
881 const tidy = (value) => value.replace(/\s+/g, ' ').trim().toLowerCase();
882 const out = [];
883 for (const node of document.querySelectorAll('[title]')) {
884 if (node.closest('.monaco-editor') !== null) {
885 continue;
886 }
887 const said = tidy(node.getAttribute('title') ?? '');
888 if (said.length === 0) {
889 continue;
890 }
891 const shown = tidy(node.textContent ?? '');
892 if (shown.includes(said)) {
893 continue;
894 }
895 out.push({
896 path: node.tagName.toLowerCase()
897 + (node.getAttribute('data-testid') === null
898 ? ''
899 : `[${node.getAttribute('data-testid')}]`),
900 title: said.slice(0, 90),
901 text: shown.slice(0, 60),
902 });
903 }
904 return out;
905 });
906}

Callers 1

countTitlesFunction · 0.90

Calls 2

tidyFunction · 0.70
pushMethod · 0.45

Tested by

no test coverage detected