From 188e2bd684b1e3be64e5d1332b0db6b19ffb9ea2 Mon Sep 17 00:00:00 2001 From: morluto <76467478+morluto@users.noreply.github.com> Date: Thu, 26 Nov 2026 12:04:00 -0500 Subject: [PATCH] fix(website): honor validators and restore the implicit design system (#14768) * fix(website): honor validators and restore the implicit design system - Route every worker answer that skips Markdown negotiation through the HTML fallback, so validators and ranges removed for the probe still apply. - Replace undefined classes with existing components and remove 27 CSS classes no page uses. - Express article text color as a token so component colors win in both themes, and use logical properties for text-flow layout in RTL pages. - Give an untranslated English fallback notice English direction. - Start the page navigation closed without JavaScript, dismiss it with Escape or an outside click, and keep later copy clicks, failed key imports and first animation frames from corrupting demo state. - Sync the theme bootstrap into the Notes fixture through a declared region. * fix(website): skip Markdown negotiation for requests with a body Markdown probing takes ownership of the caller request body. Methods other than GET and HEAD have no Markdown representation, so they reach the asset service once with the original body and validators. Co-authored-by: morluto * fix(website): describe the homepage menu's closed start The disclosure has no open attribute, so without JavaScript it starts closed and the summary reveals the fragment links. The guide now matches that, including overlay dismissal. Co-authored-by: morluto * style(website): wrap the worker precondition assertion oxfmt's 80-column width is what Static checks enforce. The If-Match comparison in the non-retrieval test exceeded it. Co-authored-by: morluto --------- Co-authored-by: Cursor Agent Co-authored-by: morluto --- scripts/test-website.py | 30 +- scripts/website.py | 10 +- scripts/website_i18n.py | 6 +- website/README.md | 5 +- website/locales/messages.pot | 30 +- website/public/assets/aegis-otp.js | 14 +- website/public/assets/dino-demo.js | 6 +- website/public/assets/home.js | 13 + website/public/assets/main.js | 6 +- website/public/assets/styles.css | 329 +++--------------- .../reverse-engineering-models/index.html | 2 +- .../blog/touhou-reconstruction/index.html | 2 +- website/public/examples/dino-lab/index.html | 2 +- website/public/examples/notes-web/index.html | 19 + website/public/index.html | 4 +- website/public/showcase/aegis/index.html | 2 +- website/worker.mjs | 21 +- website/worker.test.mjs | 65 ++++ 18 files changed, 236 insertions(+), 330 deletions(-) diff --git a/scripts/test-website.py b/scripts/test-website.py index 23f1668371..55342c80dc 100644 --- a/scripts/test-website.py +++ b/scripts/test-website.py @@ -21,7 +21,7 @@ from urllib.request import build_opener, ProxyHandler, urlopen import xml.etree.ElementTree as ET import polib -from website_i18n import Document, build_translations, checked_catalog, extract_catalogs, languages, prose_units, reading_pages, read_runtime +from website_i18n import FALLBACK_NOTICE, Document, build_translations, checked_catalog, extract_catalogs, languages, prose_units, reading_pages, read_runtime ROOT = Path(__file__).resolve().parent.parent @@ -391,6 +391,13 @@ class WebsiteSearchChecks(unittest.TestCase): class WebsiteMaintenanceChecks(unittest.TestCase): """Exercise contributor edits and the static preview through real consumers.""" + def test_home_navigation_starts_closed(self): + document = Document((ROOT / "website/public/index.html").read_text(encoding="utf-8")) + menus = [node for node in document.nodes if "home-page-nav" in node.attrs.get("class", "").split()] + self.assertEqual([node.tag for node in menus], ["details"]) + self.assertNotIn("open", menus[0].attrs) + self.assertIn("data-home-nav", menus[0].attrs) + def test_electron_guide_renderer_matches_download(self): public = ROOT / "website/public" source = (public / "guides/javascript/index.html").read_text(encoding="utf-8") @@ -883,6 +890,27 @@ class WebsiteTranslationChecks(unittest.TestCase): self.assertIn('hreflang="zh-CN"', (site / "faq/index.html").read_text()) self.assertIn("https://rea.tools/zh-CN/faq/", (site / "sitemap.xml").read_text()) + def test_fallback_notice_direction_follows_its_own_language(self): + with self.translated_project() as root: + page = root / "website/public/faq/index.html" + page.write_text(page.read_text().replace("How do I install REA?", "How do I install REA today?")) + extract_catalogs(root) + path = root / "website/locales/ar/messages.po" + catalog = polib.pofile(path) + notice = catalog.find(FALLBACK_NOTICE, msgctxt="runtime") + translated_notice = notice.msgstr + self.assertNotEqual(translated_notice, "") + site = root / "website/_site" + for msgstr, attributes in ( + ("", 'lang="en" dir="ltr"'), + (translated_notice, 'lang="ar" dir="rtl"'), + ): + notice.msgstr = msgstr + catalog.save(path) + build_translations(root, site) + result = (site / "ar/faq/index.html").read_text() + self.assertIn(f'