This is an automated email from the ASF dual-hosted git repository. imbajin pushed a commit to branch feat/oink-core-platform in repository https://gitbox.apache.org/repos/asf/hugegraph-doc.git
commit b07be625596a88e8a3007163ff4b7ce3dc2d2379 Author: dark <[email protected]> AuthorDate: Fri Sep 4 21:04:48 2026 +0800 fix(ui): stabilize persistence and axe gates - persist sidebar state after OINK completes its disclosure update - wait for asynchronous Lunr results before ranking assertions - remove animation transients from color-contrast scans --- assets/js/hugegraph-shell.js | 4 ++-- tests/e2e/accessibility.spec.js | 5 +++++ tests/e2e/search-ranking.spec.js | 15 ++++++++++++--- 3 files changed, 19 insertions(+), 5 deletions(-) diff --git a/assets/js/hugegraph-shell.js b/assets/js/hugegraph-shell.js index 6bf630c34..df56062da 100644 --- a/assets/js/hugegraph-shell.js +++ b/assets/js/hugegraph-shell.js @@ -83,7 +83,7 @@ documentObject, ); button.addEventListener('click', function () { - global.queueMicrotask(function () { + global.setTimeout(function () { if (!storage) return; var expanded = buttons .filter(function (candidate) { @@ -102,7 +102,7 @@ } catch (_) { /* Active-path expansion remains the storage-free fallback. */ } - }); + }, 0); }); }); diff --git a/tests/e2e/accessibility.spec.js b/tests/e2e/accessibility.spec.js index 6921924f3..56427440c 100644 --- a/tests/e2e/accessibility.spec.js +++ b/tests/e2e/accessibility.spec.js @@ -3,7 +3,12 @@ const AxeBuilder = require("@axe-core/playwright").default; for (const route of ["/docs/", "/cn/docs/", "/community/", "/cn/community/"]) { test(`axe WCAG 2.2 AA guard ${route}`, async ({ page }) => { + await page.emulateMedia({ reducedMotion: "reduce" }); await page.goto(route); + await page.addStyleTag({ + content: "*,*::before,*::after{animation:none!important;transition:none!important}" + }); + await page.evaluate(() => document.fonts.ready); const results = await new AxeBuilder({ page }) .withTags(["wcag2a", "wcag2aa", "wcag21aa", "wcag22aa"]) .analyze(); diff --git a/tests/e2e/search-ranking.spec.js b/tests/e2e/search-ranking.spec.js index 75a0d4dd8..ceb5cad56 100644 --- a/tests/e2e/search-ranking.spec.js +++ b/tests/e2e/search-ranking.spec.js @@ -75,10 +75,19 @@ for (const [locale, localeCases] of Object.entries(cases)) { .first() .locator('[role="option"]'); await expect(pageResults.first(), `no Lunr results for ${query}`).toBeVisible(); + await expect + .poll(() => + pageResults.evaluateAll((rows) => + rows + .slice(0, 3) + .map((row) => row.querySelector(".td-shell-search__item-title")?.textContent.trim()) + ) + ) + .toContain(expectedTitle); const titles = await pageResults.evaluateAll((rows) => - rows - .slice(0, 3) - .map((row) => row.querySelector(".td-shell-search__item-title")?.textContent.trim()) + rows.slice(0, 3).map((row) => + row.querySelector(".td-shell-search__item-title")?.textContent.trim() + ) ); expect( titles.includes(expectedTitle),
