fix(web-probe): flag mdtodo hwpod and pane gap regressions
This commit is contained in:
@@ -3448,6 +3448,29 @@ async function sampleOnePage(targetPage, { reason, groupSeq, pageRole, targetPag
|
||||
text: trim(element.textContent || "", 260),
|
||||
})).filter((item) => item.text);
|
||||
const workbenchLinks = Array.from(document.querySelectorAll('[data-testid="mdtodo-workbench-link-summary"] li, a[href*="/workbench/sessions/"]')).filter(visible);
|
||||
const measurePaneGap = (name, paneSelector, contentSelector) => {
|
||||
const pane = document.querySelector(paneSelector);
|
||||
if (!visible(pane)) return { name, visible: false };
|
||||
const rect = pane.getBoundingClientRect();
|
||||
const contentNodes = Array.from(pane.querySelectorAll(contentSelector)).filter(visible);
|
||||
const contentBottom = Math.max(rect.top, ...contentNodes.map((element) => element.getBoundingClientRect().bottom));
|
||||
const bottomGapPx = Math.max(0, Math.round(rect.bottom - contentBottom));
|
||||
const heightPx = Math.max(0, Math.round(rect.height));
|
||||
return {
|
||||
name,
|
||||
visible: true,
|
||||
widthPx: Math.max(0, Math.round(rect.width)),
|
||||
heightPx,
|
||||
bottomGapPx,
|
||||
bottomGapRatio: heightPx > 0 ? Number((bottomGapPx / heightPx).toFixed(3)) : 0,
|
||||
contentNodeCount: contentNodes.length,
|
||||
};
|
||||
};
|
||||
const paneGaps = [
|
||||
measurePaneGap("task-tree", '[data-testid="mdtodo-task-tree"]', '[data-task-ref], [role="treeitem"], [role="listitem"], li, button, input, select, .task-row-shell, .task-tools'),
|
||||
measurePaneGap("task-detail", '[data-testid="mdtodo-task-detail"]', '[data-testid="mdtodo-body-rendered"] > *, [data-testid="mdtodo-report-section"], [data-testid="mdtodo-workbench-launch"], [data-testid="mdtodo-delete-task"], [data-testid="mdtodo-task-detail-error"], .mdtodo-detail-header, .task-status-stack > *, .task-document-footer'),
|
||||
measurePaneGap("report-sidebar", '[data-testid="mdtodo-report-sidebar"]', '[data-testid="mdtodo-report-preview"] > *, [data-testid="mdtodo-report-error"], [data-testid="mdtodo-report-fullscreen"], [data-testid="mdtodo-report-close"], .report-sidebar-header, .report-preview .markdown-body > *'),
|
||||
];
|
||||
return {
|
||||
pageKind: mdtodoVisible || path.startsWith("/projects/mdtodo") ? "project-management-mdtodo" : rootVisible || path === "/projects" || path.startsWith("/projects/") ? "project-management-root" : "project-management-unknown",
|
||||
configuredPath,
|
||||
@@ -3480,6 +3503,7 @@ async function sampleOnePage(targetPage, { reason, groupSeq, pageRole, targetPag
|
||||
launchButtonText: trim(launch?.textContent || "", 120),
|
||||
blockerCount: blockers.length,
|
||||
blockers,
|
||||
paneGaps,
|
||||
workbenchLinkCount: workbenchLinks.length,
|
||||
valuesRedacted: true,
|
||||
};
|
||||
@@ -3706,6 +3730,16 @@ function digestProjectManagement(value) {
|
||||
role: item?.role ?? null,
|
||||
...textDigest(item?.text || "", 160),
|
||||
})) : [],
|
||||
paneGaps: Array.isArray(value.paneGaps) ? value.paneGaps.slice(0, 8).map((item) => ({
|
||||
name: item?.name ?? null,
|
||||
visible: item?.visible === true,
|
||||
widthPx: Number.isFinite(Number(item?.widthPx)) ? Number(item.widthPx) : null,
|
||||
heightPx: Number.isFinite(Number(item?.heightPx)) ? Number(item.heightPx) : null,
|
||||
bottomGapPx: Number.isFinite(Number(item?.bottomGapPx)) ? Number(item.bottomGapPx) : null,
|
||||
bottomGapRatio: Number.isFinite(Number(item?.bottomGapRatio)) ? Number(item.bottomGapRatio) : null,
|
||||
contentNodeCount: Number.isFinite(Number(item?.contentNodeCount)) ? Number(item.contentNodeCount) : null,
|
||||
valuesRedacted: true,
|
||||
})) : [],
|
||||
workbenchLinkCount: Number.isFinite(Number(value.workbenchLinkCount)) ? Number(value.workbenchLinkCount) : 0,
|
||||
valuesRedacted: true
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user