Skip to content

Add hero title, social previews, offline i18n, and silence Node 20 deprecation - #6

Merged
StewAlexander-com merged 2 commits into
mainfrom
feat/seo-i18n-pwa-polish
May 27, 2026
Merged

StewAlexander-com merged 2 commits into
mainfrom
feat/seo-i18n-pwa-polish

Conversation

@StewAlexander-com

Copy link
Copy Markdown
Owner

Summary

  • Hero title + SEO: page is now titled "Offline MAC Address Lookup" with a proper meta description, canonical URL, robots, color-scheme, and theme-color.
  • Link previews: full Open Graph + Twitter card metadata pointing at a new lightweight 1200×630 share image (web/icons/og-image.png, sourced from og-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.
  • Offline i18n (no runtime translation service): new web/i18n.js ships 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 from navigator.languages with region-aware Chinese (zh-CN/zh-SG → Simplified; zh-HK/zh-TW/yue-* → Traditional). Manual selector in the header. Persistence is best-effort: tries localStorage, falls back to a ?lang= / URL hash so the choice survives a reload even in private mode. Updates <html lang> and <html dir> (rtl for Arabic). Only the UI chrome is localized — IEEE vendor data stays as published.
  • Node 20 deprecation warning: every workflow opts in via env: FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true. setup-node bumped 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 — new name/description, added lang/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 through i18n.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 — precaches i18n.js, bumped maclookup-shell-v4 so existing clients adopt it on next activation.
  • .github/workflows/{ci,pages,update-oui}.ymlFORCE_JAVASCRIPT_ACTIONS_TO_NODE24=true.
  • tests/web/i18n_smoke.mjs — new smoke test (locale normalization across en-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.
  • HTML/JSON manifest sanity-parsed.

Caveats

  • The share image is a real 1200×630 PNG (with the SVG source committed alongside). Some platforms (notably WeChat, WhatsApp, Apple Messages) only accept rasterised previews — the PNG covers that. SVG is kept as the editable source so future edits don't need ImageMagick.
  • Language strings cover UI chrome only. IEEE vendor names and addresses are passed through untouched (as the project guidance requires).
  • FORCE_JAVASCRIPT_ACTIONS_TO_NODE24 is 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

Karim13014 and others added 2 commits May 23, 2026 07:41
…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>
@StewAlexander-com
StewAlexander-com merged commit 5766a14 into main May 27, 2026
1 check passed
@StewAlexander-com
StewAlexander-com deleted the feat/seo-i18n-pwa-polish branch May 27, 2026 20:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants