Add hero title, social previews, offline i18n, and silence Node 20 deprecation - #6
Merged
Merged
Conversation
…tions opt-in
* index.html: new hero title "Offline MAC Address Lookup", description,
canonical, robots, color-scheme, Open Graph + Twitter card tags pointing at
a new 1200x630 share image so X/Twitter, Facebook, iMessage, WhatsApp,
WeChat, Signal, Telegram, LinkedIn, Messenger render rich previews
when the URL is pasted.
* web/icons/og-image.{svg,png}: lightweight, self-contained share image
(no external dependency, generated PNG from local SVG).
* manifest.webmanifest: updated name/description, added lang/dir/categories
so the PWA install card and search engines see the new branding.
* web/i18n.js: static, offline, dependency-free i18n. Auto-detects from
navigator.languages/region (incl. zh-CN/SG -> Simplified, zh-HK/TW + yue
-> Traditional, fil/tl -> Filipino), exposes a manual selector in the
header, and persists via localStorage with a URL-hash fallback when
storage is unavailable. Updates <html lang> and <html dir> (RTL for
Arabic). Covers en, es, fr, de, it, pt, zh-Hans, zh-Hant, ja, ko, hi,
fil, ar. IEEE vendor data stays untranslated.
* app.js: status and empty-state messages now route through i18n.t() with
inline English fallbacks so existing behavior is preserved when i18n
has not loaded yet (and the fresh-load test continues to pass).
* styles.css: language-selector chrome, RTL-friendly mirror.
* sw.js: precaches i18n.js; bumped shell cache version so existing clients
pick it up on next activation.
* workflows: set FORCE_JAVASCRIPT_ACTIONS_TO_NODE24=true on ci.yml,
pages.yml, and update-oui.yml so the official actions stop emitting the
Node 20 deprecation warning. setup-node bumped to Node 22 for the test
job. No action major versions changed.
* tests/web/i18n_smoke.mjs: new smoke test (locale normalization, key
coverage across every locale, RTL dir switch, interpolation) wired into
the CI workflow.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Root cause: Node 21+ exposes `navigator` as a getter-only accessor on
globalThis (web-platform compat). Plain `globalThis.navigator = ...` throws
`TypeError: Cannot set property navigator of #<Object> which has only a
getter`. The CI bump in the previous commit moved setup-node from 20 to 22,
which triggered this.
Both smoke harnesses now stub globals via Object.defineProperty(..., {
value, writable: true, configurable: true }) so the replacement works
whether the property was unset (Node 20) or pre-defined as a built-in
getter (Node 22+/24+). Applied uniformly to navigator, document, window,
location, history, indexedDB, localStorage, URL, URLSearchParams,
CustomEvent.
Verified locally on both Node v20.20.1 and Node v22.11.0:
- tests/web/fresh_load.mjs passes
- tests/web/i18n_smoke.mjs passes
- python tests 16/16 pass
- node --check on app.js / sw.js / i18n.js clean
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
theme-color.web/icons/og-image.png, sourced fromog-image.svg), so X/Twitter, Facebook, Apple Messages, Android Messages, WhatsApp, WeChat, Telegram, Signal, Messenger, LinkedIn all render a rich preview when the URL is pasted.web/i18n.jsships static translations for en, es, fr, de, it, pt, zh-Hans (Mandarin Simplified), zh-Hant (Traditional / Cantonese-friendly), ja, ko, hi, fil (Filipino/Tagalog), ar. Auto-detects fromnavigator.languageswith region-aware Chinese (zh-CN/zh-SG→ Simplified;zh-HK/zh-TW/yue-*→ Traditional). Manual selector in the header. Persistence is best-effort: trieslocalStorage, falls back to a?lang=/ URL hash so the choice survives a reload even in private mode. Updates<html lang>and<html dir>(rtlfor Arabic). Only the UI chrome is localized — IEEE vendor data stays as published.env: FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true.setup-nodebumped to Node 22 for the test runner. No action major versions changed.Files changed
web/index.html— title, meta, OG/Twitter tags, i18n hooks, language selector.web/manifest.webmanifest— newname/description, addedlang/dir/categories.web/icons/og-image.svg+og-image.png— 1200×630 share image, no external deps.web/i18n.js— static translations + auto-detect + selector.web/app.js— dynamic status/empty-state messages route throughi18n.t()with English fallbacks so behavior is preserved when i18n hasn't loaded yet.web/styles.css— language selector chrome, RTL-aware.web/sw.js— precachesi18n.js, bumpedmaclookup-shell-v4so existing clients adopt it on next activation..github/workflows/{ci,pages,update-oui}.yml—FORCE_JAVASCRIPT_ACTIONS_TO_NODE24=true.tests/web/i18n_smoke.mjs— new smoke test (locale normalization acrossen-GB/fr-CA/zh-CN/zh-HK/yue-HK/fil-PH/etc., key coverage for every locale, RTL switch, positional{0}interpolation). Wired into CI.Testing
python3 -m unittest discover -s tests -v— 16 tests, all pass.node --check web/{app.js,sw.js,i18n.js}— clean.node tests/web/fresh_load.mjs— fresh-context PWA smoke test still ends at"Loaded N entries (latest) · in-memory only".node tests/web/i18n_smoke.mjs— new test passes.Caveats
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24is a GitHub-side opt-in flag for the upcoming runtime. Once Node 24 becomes the default, the env block can be deleted in a follow-up.🤖 Generated with Claude Code