Skip to content

fix(smoke): Skærmkort smoke probe (#1065) - #1097

Draft
dborup wants to merge 4 commits into
masterfrom
fix/1065-skaermkort-smoke-and-tap
Draft

dborup wants to merge 4 commits into
masterfrom
fix/1065-skaermkort-smoke-and-tap

Conversation

@dborup

@dborup dborup commented Dec 2, 2026 •

Copy link
Copy Markdown
Owner

Relates to #1065

Follow-up from the #1081 review, finding F2 only: the Skærmkort smoke probe. The credit tap target (F5) is split out, see the last section.

Plan and choices

cmd/smoke had skaermkort-wms as a permanent SKIP because the URL is built in the browser.

  • skaermkortURL in cmd/smoke/skaermkort.go builds the same GetMap URL Leaflet builds: wms.datafordeler.dk/Dkskaermkort/topo_skaermkort/1.0.0/wms, layers dtk_skaermkort, _graa and _daempet, WMS 1.3.0, EPSG:3857, 512 px, with apikey first and the tile box last.
  • The probe asks for one tile over Copenhagen (map zoom 14, tile grid zoom 13) and expects a 200 and a 512 px PNG.
  • The key is read from map.tiles.providers.datafordeler.apiKey, the browser key. The server key map.datafordeler.apiKey is never used in its place.
  • With no client key the probe is SKIP, not FAIL.
  • The key is only in the sent URL. The printed URL is built with a placeholder, and the output redactor stays as the second line of defence.
  • Drift guard: test-fixtures/skaermkort-wms-url-1065.json holds what real Leaflet and the real provider registry produce. test-issue-1065-skaermkort-url-e2e.js asserts the browser against it, and TestSkaermkort1065_BuilderMatchesTheBrowserFixture asserts the Go builder against it. UPDATE_FIXTURE=1 regenerates the fixture from the browser.
  • The box edges are compared with a 0.1 mm tolerance (Leaflet's latitude/longitude round trip leaves float noise); everything before the box is byte for byte. The fixture key contains a space, !, /, + and parentheses, so the encodeURIComponent and QueryEscape difference is covered.
  • The probe requires only the key, not enabled: true.

Tests

Item Test
Builder equals the browser TestSkaermkort1065_BuilderMatchesTheBrowserFixture and the E2E fixture step
Probe request, key once, never printed TestSkaermkort1065_ProbeSendsTheBrowserRequestAndNeverPrintsTheKey, TestSkaermkort1065_ResultURLHoldsNoKey
SKIP without the client key TestSkaermkort1065_NoClientKeySkips
Refused key TestSkaermkort1065_RefusedKeyFails

The old TestSkaermkortIsSkippedWithoutABuilder is removed: it asserted a "no Go builder" reason that no longer exists. scripts/e2e-shards.json gets the new suite on shard 3. Dummy keys only. public/ is unchanged by this PR.

Credit tap target (F5): left as a follow-up

A first version of this PR also made the attribution links a 24 px tap target. It is removed again (the credit is exactly as on master) because a real 24 px hit area in a wrapped credit needs a taller credit, which moves the phone legend and layer list that the #792, #839 and #982 suites assume. Options found:

  1. Keep a roomier credit (a 24 px slot per line, links' hit area as a ::after box) and update the Map: colour-by-elevation overlay, rendered server-side from DHM (v0.2.9) #792 and Map popup follow-ups: stuck cluster add, stale-add guard test, spiderfied popups, closing on a dense phone map #982 suites to the new credit height. Honest fix, but it widens the scope.
  2. Drop the line slots and keep the bar height. Links on adjacent lines then overlap and the later one steals taps, so 24 px only holds for single-line credits.
  3. Make the credit one line on phones (shorter text or smaller font). This changes the credit text, which has licence implications.

Padding or negative margins on the link alone do not work: they stick out of the clipped compact inset credit (#752) and the next line of a wrapped credit wins the hit test.

🤖 Generated with Claude Code

Relates to #1065 (#1081 review F2 and F5).

F2: cmd/smoke builds the Skærmkort WMS GetMap URL the browser builds
(skaermkortURL) from map.tiles.providers.datafordeler.apiKey and probes
one tile over Copenhagen (200, 512 px PNG); SKIP without that key. A
shared fixture, asserted against real Leaflet in an E2E and against the
Go builder, pins the two together. The key is never in the printed URL.

F5: attribution links get a >= 24x24 px hit area (padding offset by an
equal negative margin, so the bar is not taller).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@dborup

dborup commented Dec 2, 2026

Copy link
Copy Markdown
Owner Author

Rapport — CS-MacBook PR#1097 #1065 — head a76c697

Status: Both items are implemented and green locally. CI has not run: GitHub created no run for the PR event.

Evidence labels: [T] test run, [A] analysis, [K] known and not verified.

F2 — Skærmkort smoke probe

Requirement Test Mutant Evidence
Go builder gives the browser's GetMap URL TestSkaermkort1065_BuilderMatchesTheBrowserFixture; E2E step compares real Leaflet with the same fixture Dropping transparent=FALSE fails the test. Using QueryEscape for encodeURIComponent also fails; the fixture key contains a space and ! [T]
One tile over Copenhagen, 200 and 512 px PNG, key once, no token TestSkaermkort1065_ProbeSendsTheBrowserRequestAndNeverPrintsTheKey, TestSkaermkort1065_TileIsOverDenmark Using the server key makes 4 tests fail [T]
SKIP, not FAIL, without a client key TestSkaermkort1065_NoClientKeySkips: server key only, blank, no tiles block, odd shape, no config Using the server key fails it [T]
Key never logged TestSkaermkort1065_ResultURLHoldsNoKey, plus the output scan in the probe test Printing the real key in the result URL fails ResultURLHoldsNoKey [T]
Refused key fails with a hint naming the config key TestSkaermkort1065_RefusedKeyFails none [T]

Notes:

  • The box edges are compared with a 0.1 mm tolerance. Leaflet's latitude/longitude round trip leaves float noise in the last digits. The rest of the URL is compared byte for byte. [A]
  • The probe requires only the key, not enabled: true. [A]
  • I removed TestSkaermkortIsSkippedWithoutABuilder, which asserted the old "no builder" SKIP reason. [A]

F5 — credit tap target

Requirement Test Mutant Evidence
Skærmkort credit links at least 24x24 at 375x560 and 360x640 test-issue-1065-skaermkort-url-tap-e2e.js, which also checks the link's centre hits the link Red before the CSS change (44.9x12). Padding of 1 px and no minimum: 3 failures [T]
Ortho credit, same root cause New steps in test-issue-728-ortho-base-e2e.js at both sizes Same mutant: 2 failures [T]
Desktop bar not taller Bar height compared with the bar without the padding Same mutant [T]

I did not check the compact inset credit (mc-credit-compact, overflow-y: auto). Its hit area may be partly clipped. [K]

Runs

  • [T] Passed: cd cmd/smoke && go test ./..., cd cmd/server && go test ./..., sh test-all.sh (408 files, 0 failed), node scripts/run-e2e-shard.js --validate.
  • [T] Passed locally against a Go server on the CI fixture DB (copy, migrated): test-issue-1065-skaermkort-e2e.js (10/10), test-issue-728-ortho-base-e2e.js (25/25), and the new suite (4/4).
  • [A] Invariants: cmd/server is untouched, so it stays read-only. No new map[string]interface{}. No hardcoded colours. scripts/check-xss-sinks.sh --diff found no public/**/*.{js,html} changes to scan. .github is unchanged, so the fork guards are unchanged.

CI per job

None. gh pr checks and gh run list show no run on the branch after about 15 minutes. An earlier commit on master ("re-run the pipeline; no run was created for the PR event") hit the same problem. I did not push an empty commit.

Residue

  • CI needs a trigger by the owner or a re-run commit.
  • The apiKey key match in the smoke config is case-insensitive (Go JSON), unlike the server's exact-case keys. This is minor.

@dborup

dborup commented Dec 2, 2026

Copy link
Copy Markdown
Owner Author

Review — CS-Minimax PR#1097 — head a76c697

Dom: REQUEST CHANGES

Evidence labels: [T] test I ran, [A] analysis, [K] known and not verified. Dummy keys only. Reviewed on the merged tree (git merge-tree of this head onto origin/master b7db1738), built from git archive, against a local Go server on a CI-prepared fixture DB (freshen, seed SQL, corescope-migrate, seeds 2073 and 199). The head SHA was the same before and after the review.

Findings

# Severity Finding Evidence
1 Blocking The new tap-target CSS breaks the existing #752 inset attribution E2E (test-issue-752-inset-attribution-e2e.js): 4 of 8 steps fail on this head and pass 8/8 on master. This is the red CI job "Playwright E2E Tests (1/3)". The failing steps are the Esri credit on node detail, node detail at 390x844, area-nodes and the Analytics subpath minimap. They report credit covered at 4 points. [T] merged tree: 4 passed, 4 failed. Same suite with master's public/ and the same server binary: 8 passed, 0 failed. CI job log shows the same 4 steps.
2 Blocking Cause of #1: the rule applies to the compact inset credit (.mc-credit-compact, overflow-y: auto). The Esri link's padded box is 804,444 to 829,469 against a credit box of 449 to 477, so about 5 px of the hit area sits outside the clipped credit. The #752 probe counts that region as covered. The PR report named this case as unchecked ([K]), and it is a real regression. [T] measured rects with esri-imagery on node detail.
3 Blocking The "at least 24x24" target is only true for the nominal box, not for what a finger can hit. The padded box extends into the next line of a wrapped credit, and that line's text wins the hit test. Measured with a touch context and elementFromPoint down the link's centre column, with the link scrolled into view: on the map page at 375x560 and at 360x640 the 26.7 px box is hit for only about 19 px (the lower ~7 px hit the attribution control); the box is 52.9 px wide with 48 of 52 hit. In the compact inset the box is 24.7x25 and the hit area is about 14 px high and 19 px wide. Master is 11 px high. This is better than before but below the 24 px acceptance criterion at the exact sizes the issue names. The PR's tests only check the nominal rect and that the link's centre hits the link, so they stay green. [T] probe-phone2 run at both sizes. The hit-test numbers are mine, not the PR author's.
4 Nit TestSkaermkort1065... and the E2E do not need a fix, but the ortho E2E (test-issue-728) does not catch a missing negative margin (bar taller). Only the new 1065 suite has the desktop-bar assertion. [T] mutant 7 below.
5 Nit The smoke config reads apiKey case-insensitively (Go JSON), the server reads it exact-case. Already named in the PR report; I agree it is minor. [A]
6 Info Shard 2 failed on perf: decode + draw at a plain 4x CPU throttle ... postnummer: 266.0 ms > 250 ms. This file is not touched by the PR and the margin is 6%, so I treat it as a CPU-throttle flake after a 41 min job on a delayed runner. I did not reproduce it. [A] CI log. [K] not rerun.

Answers to the review points

  • Go builder and probe (F2): good. The builder matches the shared fixture byte for byte up to the box and within 0.1 mm on the box. The probe is SKIP, not FAIL, without a client key, and reads only map.tiles.providers.datafordeler.apiKey, never map.datafordeler.apiKey. The printed URL is built without the key. I also checked the second line of defence: a transport error includes the full URL. With keys containing a space, !, parentheses, /, +, & and ', the output showed apikey=REDACTED every time and no tail of the key. [T]
  • Tap target (F5): not accepted, see Foreign Traffic analytics + Scopes tab redesign #1 to fix(map): sync Important Links with Byte Size filter #3. The Skærmkort and ortho links share one rule, which is the right root cause, but the rule needs a form that holds in the clipped compact credit and in a wrapped credit.
  • Acceptance criteria: F2 criteria each have a test that is red before and green after (see mutants). F5's size criterion has a test that is green while the real hit area is under 24 px, so it is not a sufficient guard yet.
  • Desktop bar not taller: holds. [T]
  • No behaviour change beyond the purpose: the CSS rule applies to every Leaflet attribution link site-wide, which is how fix(frontend): replace legacy scope confirmation glyphs #2 appears. cmd/server is untouched, so it stays read-only. No new map[string]interface{} in the diff. No hardcoded colours (sizes are --mc-credit-tap-* variables). scripts/check-xss-sinks.sh --diff origin/master is clean (no public JS or HTML changed). .github is unchanged, so the fork guards and closing-keyword checks are unchanged. Commit author is dborup <kontakt@meshview.dk>. [T/A]

Tests run

  • [T] cd cmd/smoke && go test ./...: ok.
  • [T] cd cmd/server && go test ./... on the merged tree: ok (160 s).
  • [T] node scripts/run-e2e-shard.js --validate: 319 suites across three non-empty shards.
  • [T] sh test-all.sh: 406 passed, 2 failed of 408. Both failures (test-issue-628-vendor-gitattributes.js, test-issue-715-og-denmark.js) need a .git directory, which a git archive tree does not have. They fail the same way on master's archive, so they are not a regression signal.
  • [T] E2E on the merged tree: test-issue-1065-skaermkort-url-tap-e2e.js 4/4, test-issue-1065-skaermkort-e2e.js 10/10, test-issue-728-ortho-base-e2e.js 25/25. test-issue-752-inset-attribution-e2e.js 4/8 (finding Foreign Traffic analytics + Scopes tab redesign #1).
  • [T] Red before: the new suite on master's CSS fails 3 of 4 (Leaflet is 44.9x12.0 at both phone sizes, and the desktop bar).

Mutants (mine, run separately and restored after each)

# Mutant Result
1 Builder CRS EPSG:3857 to EPSG:4326 killed: BuilderMatchesTheBrowserFixture, ProbeSendsTheBrowserRequest
2 Box y edges swapped killed: BuilderMatchesTheBrowserFixture, TileIsOverDenmark
3 Layer dtk_skaermkort to dtk_skaermkort_graa killed: ProbeSendsTheBrowserRequest
4 Printed URL holds the real key killed: ResultURLHoldsNoKey
5 Client key never read from the config killed: ProbeSendsTheBrowserRequest, RefusedKeyFails
6 Drop the clientKey from the skip loop (probe sends an empty key) killed: 8+ tests
7 CSS: remove the negative margin (bar grows) killed by the 1065 suite (bar 27.97 px vs 15.97 px); not killed by the ortho suite (25/25 green)

Not verified

  • GitHub Actions timing: CI did run on this head (run 46939653816); Go jobs, Docker validate and E2E shard 3 are green; shard 1 is red for Foreign Traffic analytics + Scopes tab redesign #1 and shard 2 for the perf flake in fix(neighbor-graph): dedup geo-far reject log spam causing CPU spikes #6. I did not re-run shard 2 and cannot rule out other delay effects from the Actions outage.
  • Real Skærmkort tiles against Datafordeleren (no real key, no network): the live 200 and 512 px PNG check is only covered by the stub server in the Go test.
  • A real iPhone/Safari run. I used a Chromium touch context at 375x560 and 360x640, loaded cold (#/map and the node detail page) with the Esri credit, and measured hits by elementFromPoint, not a physical finger.
  • Staging, prod, the server API key: not used.

Suggested direction (not a requirement)

Give the credit links real room in the layout instead of a negative-margin overlap, for example line-height or padding on the credit control itself so the lines do not overlap the link's hit area, or make .mc-credit-compact not clip it. Then assert the hit area with elementFromPoint over the whole box, at both phone sizes, in both the full and the compact credit.

🤖 Generated with Claude Code

dborup and others added 3 commits December 2, 2026 21:21
…nd wrapped credit (#1065)

The padded inline-block of the first round stuck out of the clipped
compact inset credit (#752 E2E red, 4 of 8) and its box reached into the
next line of a wrapped credit, where that line won the hit test.

The link stays inline; its hit area is a ::after box above the credit
text. On touch/narrow screens each credit line gets a 26 px slot so boxes
of different lines never overlap; the compact credit clips the box with
itself and is at least one tap target tall.

Tests measure what a finger hits (elementFromPoint from the link centre,
up/down and left/right), at 375x560 and 360x640, in the full and the
compact credit; the #728 ortho tap step does the same.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The 26 px credit line slots made the wrapped credit about 78 px tall at
640x360 and squeezed the open layer list (#839 E2E red in CI). The slots
now need (min-height: 500px); the sizes the issue names are unaffected.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…rmkort smoke probe (#1065)

A 24 px hit area in a wrapped credit needs a taller credit, which moves
the phone legend and layer list (#792, #839, #982 suites assume today's
credit height). The credit CSS and its E2E changes are removed, so the
credit is exactly as on master; public/ is unchanged by this branch.
The URL-parity E2E for the smoke probe stays (renamed, no tap steps).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@dborup dborup changed the title fix(map): Skærmkort smoke probe and a usable credit tap target (#1065) fix(smoke): Skærmkort smoke probe (#1065) Dec 2, 2026
@dborup

dborup commented Dec 2, 2026

Copy link
Copy Markdown
Owner Author

Fix round — CS-MacBook PR#1097

Review feedback addressed (commit 031b4309)

  1. Findings Foreign Traffic analytics + Scopes tab redesign #1–fix(map): sync Important Links with Byte Size filter #3 (tap target breaks Map attribution on inset maps + Live credit test gaps (follow-up to #735) #752, hit area under 24 px): per the coordinator decision the credit tap target is split out. The credit CSS and its E2E changes are removed in a new normal commit (no force-push); public/ is unchanged by this branch, so the credit is exactly as on master. Map attribution on inset maps + Live credit test gaps (follow-up to #735) #752 passes again (8/8 E2E, 27/27 unit).
  2. Why it is a follow-up: a real 24 px hit area in a wrapped credit needs a taller credit, which moves the phone legend and layer list (Map: colour-by-elevation overlay, rendered server-side from DHM (v0.2.9) #792, v0.2.9-rc19 exploratory test pass (staging) #839, Map popup follow-ups: stuck cluster add, stale-add guard test, spiderfied popups, closing on a dense phone map #982 suites assume today's credit height). A second attempt (a 24 px slot per line with a ::after hit box) fixed Map attribution on inset maps + Live credit test gaps (follow-up to #735) #752 but turned v0.2.9-rc19 exploratory test pass (staging) #839, Map: colour-by-elevation overlay, rendered server-side from DHM (v0.2.9) #792 and Map popup follow-ups: stuck cluster add, stale-add guard test, spiderfied popups, closing on a dense phone map #982 red in CI. The three options found are recorded in the PR body.
  3. Finding fix(server): count only active observers in stats (#1888) #4 (ortho suite does not catch a missing negative margin): moot, the negative margin and the desktop-bar assertion are gone with the tap target.
  4. Finding feat(nodes): export visible nodes as MeshCore companion contacts JSON #5 (smoke config reads apiKey case-insensitively): unchanged, accepted as minor in the review.
  5. Finding fix(neighbor-graph): dedup geo-far reject log spam causing CPU spikes #6 (shard 2 perf flake): not reproduced; shard 2 is green on this head.
  6. Kept: the Skærmkort smoke probe (F2) with its Go tests and the shared URL fixture. The browser parity E2E is renamed test-issue-1065-skaermkort-url-e2e.js (tap steps removed) and scripts/e2e-shards.json is updated (--validate ok, 319 suites).
  7. PR title and body are updated to "Skærmkort smoke probe".

CI on this head: all jobs green (Go jobs, Playwright 1/3, 2/3 and 3/3, Docker validate, shard verification). Locally, #752 passes; #792, #839 and #982 fail here with the same baseline failures as on master (fixture not fully seeded) and pass in CI.

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.

1 participant