mirror of
https://github.com/Kpa-clawbot/meshcore-analyzer.git
synced 2026-06-04 09:51:19 +00:00
b5a1642024
## Summary
Custom navbar logos via `branding.logoUrl` were rendered squished. The
CSS rule `.brand-logo { width: 125px }` was pinned to the default
inline-SVG wordmark's viewBox aspect (~3.08:1), and when customize-v2
swapped the inline `<svg>` for an `<img>`, that `<img>` inherited the
same fixed 125px width — stretching every non-3.08:1 image into a pill.
## Root cause
- `public/style.css:520` — `.brand-logo { width: 125px }` applied
regardless of element type.
- `public/customize-v2.js:75-77` — `_setBrandLogoUrl` additionally
hardcoded `width="125" height="36"` attributes on the created `<img>`,
overriding any CSS aspect rescue.
- Mobile media query (`style.css:1729`) had the same issue with `width:
112px`.
## Fix
Split the CSS rule by element type:
- `svg.brand-logo` — keeps 125×36 pin for the default wordmark (no
regression).
- `img.brand-logo` — `width: auto`, `max-width: 200px`, `object-fit:
contain` so the operator image's natural aspect is preserved with a sane
cap so very-wide logos can't blow nav layout.
- Mobile `@media` mirrors the split (svg 112×32 pinned, img auto width
with 180px cap).
- Drop the hardcoded `width=125`/`height=36` attrs from the `<img>`
created in `customize-v2 _setBrandLogoUrl`.
## TDD
Red commit `a20b7d7`: 4 assertions, all fail on master.
Green commit `533f464`: same 4 assertions, all pass.
```
✓ img.brand-logo CSS rule exists and uses width:auto (not pinned)
✓ svg.brand-logo CSS rule still pins width:125px (no default regression)
✓ mobile media-query splits the .brand-logo rule into svg/img variants
✓ customize-v2 _setBrandLogoUrl does NOT hardcode width/height attrs on the IMG
```
## Verification plan post-merge
Hot-deploy to staging and CDP-verify:
1. Default SVG wordmark still renders at 125×36 (no default regression).
2. Square 100×100 data-URI logo renders as ~36×36 (was 125×36 pill).
3. Tall 100×300 data-URI logo renders as ~12×36 (was 125×36 pill).
Closes #1450
---------
Co-authored-by: openclaw-bot <bot@openclaw.local>
49 lines
1.7 KiB
Bash
Executable File
49 lines
1.7 KiB
Bash
Executable File
#!/bin/sh
|
|
# Run all tests with coverage
|
|
set -e
|
|
|
|
echo "═══════════════════════════════════════"
|
|
echo " CoreScope — Test Suite"
|
|
echo "═══════════════════════════════════════"
|
|
echo ""
|
|
|
|
# Unit tests (deterministic, fast)
|
|
echo "── Unit Tests ──"
|
|
node test-packet-filter.js
|
|
node test-packet-filter-ux.js
|
|
node test-aging.js
|
|
node test-frontend-helpers.js
|
|
node test-url-state.js
|
|
node test-perf-go-runtime.js
|
|
node test-channel-psk-ux.js
|
|
node test-channel-sidebar-layout.js
|
|
node test-channel-fluid-layout.js
|
|
node test-channel-modal-ux.js
|
|
node test-channel-decrypt-insecure-context.js
|
|
node test-channel-qr.js
|
|
node test-channel-qr-wiring.js
|
|
node test-channel-issue-1087.js
|
|
node test-issue-1409-no-encrypted-flood.js
|
|
node test-analytics-channels-integration.js
|
|
node test-observers-headings.js
|
|
node test-marker-outline-weight.js
|
|
node test-traces.js
|
|
|
|
# #1418 — route-view v2 (Tufte) coverage
|
|
node test-issue-1418-raw-hex-extraction.js
|
|
node test-issue-1418-edge-weights.js
|
|
node test-issue-1418-cb-preset-ramp.js
|
|
node test-issue-1418-spider-fan.js
|
|
node test-issue-1418-deeplink-hops-channels.js
|
|
node test-issue-1418-polish-review.js
|
|
node test-issue-1420-tile-providers.js
|
|
node test-issue-1438-marker-css-vars.js
|
|
node test-issue-1438-customizer-mcrole.js
|
|
node test-issue-1446-cb-preset-cascade.js
|
|
node test-issue-1450-logo-aspect.js
|
|
|
|
echo ""
|
|
echo "═══════════════════════════════════════"
|
|
echo " All tests passed"
|
|
echo "═══════════════════════════════════════"
|