mirror of
https://github.com/Kpa-clawbot/meshcore-analyzer.git
synced 2026-05-13 19:53:08 +00:00
364c5766fc
## Adds new logo and home hero Replaces the navbar mushroom emoji + "CoreScope" text spans with the new CoreScope SVG mark, and adds a hero SVG (with the MESH ANALYZER tagline) above the home page H1. ### What changed - `public/img/corescope-logo.svg` — navbar mark, no tagline (locked "aggressive low-amp chirp" variant: facing-arcs + low-amp chirp connector between the two nodes). - `public/img/corescope-hero.svg` — home hero version, includes the MESH ANALYZER tagline. - `public/index.html` — replaces `<span class="brand-icon">🍄</span><span class="brand-text">CoreScope</span>` with `<img class="brand-logo" src="img/corescope-logo.svg?__BUST__" …>`. `.nav-brand` link still routes to `#/`. `.live-dot` retained. - `public/style.css` — adds `.brand-logo { height: 36px }` (32px on tablet ≤900px). Existing 52px nav height unchanged. - `public/home.js` / `public/home.css` — adds `<img class="home-hero-logo">` above the hero `<h1>`, sized `max-width: min(720px, 90vw)` and centered. ### TDD Red→green is visible in the branch: - `3159b82` — `test(logo): add failing E2E …` (red commit). Adds `test-logo-rebrand-e2e.js` and wires it into the `e2e-test` job in `deploy.yml` with `CHROMIUM_REQUIRE=1`. On this commit `index.html` still has the emoji + text spans, `home.js` has no hero img, and the SVG asset files do not exist — the test asserts on each so CI fails on assertion. - `19434e1` — `feat(logo): wire new CoreScope SVG logo …` (green commit). Implements the fix. ### E2E asserts 1. `.nav-brand img` exists with `src` ending `corescope-logo.svg` 2. legacy `.brand-icon` / `.brand-text` are gone 3. `.live-dot` is present, visible, and to the right of the logo (no overlap) 4. `.home-hero img.home-hero-logo` exists with `src` ending `corescope-hero.svg`, positioned BEFORE the `<h1>` 5. both `/img/corescope-{logo,hero}.svg` return 200 with svg content-type ### Customizer compatibility - `customize.js` still does `querySelector('.brand-text')` / `.brand-icon` for live branding updates. Both now return `null`; existing `if (el)` guards make those branches silent no-ops. **No JS errors, but the customizer's `branding.siteName` and `branding.logoUrl` fields no longer rewrite the navbar brand** — the brand is now a fixed SVG asset. - **Theme accent does NOT recolor the SVG.** SVGs loaded via `<img src>` are isolated documents and cannot inherit document CSS variables; the SVG falls back to its embedded brand colors. This is appropriate for a brand mark; if recoloring per theme is desired later, swap to inline SVG (separate PR). ### Browser validation Local Chromium not available in this env; the E2E test soft-skips locally and hard-fails in CI (`CHROMIUM_REQUIRE=1`). Server-side checks done locally: - `curl http://localhost:13581/` → confirmed `<img class="brand-logo" src="img/corescope-logo.svg?<bust>" …>` rendered, no `.brand-icon`/`.brand-text` spans. - `curl -I /img/corescope-logo.svg` and `/img/corescope-hero.svg` → both 200. ### Performance No hot-path changes. Two new static SVG assets (~7.6KB each), served directly by the Go static handler. Cache-busted via `?__BUST__` (auto-replaced server-side). --------- Co-authored-by: OpenClaw Bot <bot@openclaw.local> Co-authored-by: Kpa-clawbot <bot@kpa-clawbot.local>
29 lines
1.4 KiB
Bash
29 lines
1.4 KiB
Bash
#!/bin/sh
|
|
# Instrument frontend JS for coverage tracking
|
|
rm -rf public-instrumented
|
|
npx nyc instrument public/ public-instrumented/ --compact=false
|
|
# Copy non-JS files (CSS, HTML, images) as-is
|
|
cp public/*.css public-instrumented/ 2>/dev/null
|
|
cp public/*.html public-instrumented/ 2>/dev/null
|
|
cp public/*.svg public-instrumented/ 2>/dev/null
|
|
cp public/*.png public-instrumented/ 2>/dev/null
|
|
# Copy nested asset directories (e.g. public/img/*.svg used by the new
|
|
# CoreScope logo + hero). nyc instrument skips non-JS subdirs entirely,
|
|
# so without this the SPA fallback would serve index.html for
|
|
# `/img/corescope-logo.svg`, breaking the navbar logo + the
|
|
# logo-rebrand E2E (the content-type assertion catches this cleanly).
|
|
if [ -d public/img ]; then
|
|
mkdir -p public-instrumented/img
|
|
cp -r public/img/. public-instrumented/img/
|
|
fi
|
|
# Copy vendored libraries unmodified — `nyc instrument` skips subdirectories
|
|
# without a package.json, so vendor/qrcode.js, vendor/jsqr.min.js, etc. are
|
|
# never emitted into public-instrumented/. Without them the SPA fallback
|
|
# returns index.html for `<script src="vendor/qrcode.js">`, producing
|
|
# "Unexpected token '<'" pageerrors and a missing `qrcode` global —
|
|
# which makes the QR Generate path hit the "[QR library not loaded]"
|
|
# fallback in channel-qr.js (issue #1087 bug 1 manifests in CI only).
|
|
mkdir -p public-instrumented/vendor
|
|
cp public/vendor/* public-instrumented/vendor/ 2>/dev/null
|
|
echo "Frontend instrumented successfully"
|