diff --git a/scripts/src/dev-cloud-workbench-smoke-lib.mjs b/scripts/src/dev-cloud-workbench-smoke-lib.mjs index b8ddf1b4..7159f2a9 100644 --- a/scripts/src/dev-cloud-workbench-smoke-lib.mjs +++ b/scripts/src/dev-cloud-workbench-smoke-lib.mjs @@ -2136,6 +2136,7 @@ function hasSidebarCollapseContract({ html, app, styles }) { /event\.key === "End"/u.test(app) && /ArrowLeft/u.test(app) && /ArrowRight/u.test(app) && + /setAttribute\("aria-hidden", resizeDisabled \? "true" : "false"\)/u.test(setCollapsedBody) && /setAttribute\("aria-label", collapsed \? "展开左侧资源树" : "收起左侧资源树"\)/u.test(setCollapsedBody) && /textContent = collapsed \? "展开资源树" : "收起资源树"/u.test(setCollapsedBody) && /title = collapsed \? "展开左侧资源树,恢复导航和硬件资源" : "收起左侧资源树,给工作区更多宽度"/u.test(setCollapsedBody) && @@ -5227,6 +5228,7 @@ async function explorerResizeMetrics(page) { }, handleTabIndex: handle?.tabIndex ?? null, handleAriaDisabled: handle?.getAttribute("aria-disabled") ?? "", + handleAriaHidden: handle?.getAttribute("aria-hidden") ?? "", handleAriaValueNow: Number(handle?.getAttribute("aria-valuenow")), handleAriaValueText: handle?.getAttribute("aria-valuetext") ?? "", storage, @@ -5260,6 +5262,7 @@ async function inspectExplorerResizeMobile(page, { viewport }) { handleWidth: box?.width ?? 0, handleTabIndex: handle?.tabIndex ?? null, handleAriaDisabled: handle?.getAttribute("aria-disabled") ?? "", + handleAriaHidden: handle?.getAttribute("aria-hidden") ?? "", noHorizontalOverflow: document.documentElement.scrollWidth <= document.documentElement.clientWidth + 2 && document.body.scrollWidth <= document.body.clientWidth + 2 && @@ -5274,6 +5277,7 @@ async function inspectExplorerResizeMobile(page, { viewport }) { observation.handleDisplay === "none" && observation.handleTabIndex === -1 && observation.handleAriaDisabled === "true" && + observation.handleAriaHidden === "true" && observation.noHorizontalOverflow, ...observation }; diff --git a/web/hwlab-cloud-web/app.mjs b/web/hwlab-cloud-web/app.mjs index 09d471a0..8d8a8e67 100644 --- a/web/hwlab-cloud-web/app.mjs +++ b/web/hwlab-cloud-web/app.mjs @@ -368,6 +368,7 @@ function setExplorerCollapsed(collapsed) { const resizeDisabled = collapsed || window.matchMedia("(max-width: 860px)").matches; el.explorerResize.tabIndex = resizeDisabled ? -1 : 0; el.explorerResize.setAttribute("aria-disabled", resizeDisabled ? "true" : "false"); + el.explorerResize.setAttribute("aria-hidden", resizeDisabled ? "true" : "false"); } function syncMobileExplorer() {