Skip to content

feat(info): /guider page with click-to-play video guides - #1012

Merged
dborup merged 4 commits into
masterfrom
feat/info-guider
Nov 29, 2026
Merged

dborup merged 4 commits into
masterfrom
feat/info-guider

Conversation

@dborup

@dborup dborup commented Nov 28, 2026

Copy link
Copy Markdown
Owner

What

A new information page, /guider, collects the MeshView video guides (owner decision 2026-11-28: YouTube for hosting, /guider as the overview).

  • Cards: three guides for now: Danish maps and layers, terrain profile, oblique photo. Each card has:
    • a local thumbnail (640×360, taken from the video);
    • the length;
    • one line about the guide;
    • "Open in MeshView" and a link to the matching docs/user-guide/ page.
  • Click-to-play: assets/guider.js swaps the thumbnail for a youtube-nocookie.com player only when the visitor taps play. Nothing is fetched from YouTube before that.
  • No video id yet: a card without a valid YouTube id shows "Video på vej" and cannot be played. When a video is uploaded, its 11-character id goes into data-youtube (see the README).
  • Navigation: every info page gets a "Guider" link in the nav, and /guider is also in its footer. On a phone the nav keeps all five links on one row at 375 px, and wraps to two rows at 320 px.
  • Built with: createElement, the page's own CSS variables, and touch targets of at least 44 px.

Stacked on #1011 (the info pages in the repo). Merge that first.

Tests

  • test-guider.cjs (new, Playwright, local server):
    • no external request on /guider;
    • with ids: no request before play, and after a tap the youtube-nocookie.com/embed/<id>?autoplay=1 iframe replaces the button;
    • malformed and empty ids stay disabled;
    • every page has exactly one Guider nav link;
    • link targets are at least 44 px.
  • Mutants: six, all killed: accept any id, load the player without a click, youtube.com instead of nocookie, no "Video på vej" badge, a page without the nav link, no autoplay.
  • test-mobile.cjs now includes /guider. It passes for 5 pages × 5 widths (320–1280 px): no overflow, local fonts, no external requests, nav visible.
  • test-copy-commands.js and test-xss.cjs are unchanged and pass.

Not done

  • No deploy. The live pages change only when the files are copied to the server, with the owner's approval.
  • YouTube ids: the videos are not uploaded yet.

🤖 Generated with Claude Code

dborup and others added 3 commits November 28, 2026 08:33
A new info page lists the video guides (Danish maps and layers, terrain
profile, oblique photo) with local thumbnails, the length and a link to the
matching user-guide page. A card plays only after a tap: assets/guider.js
swaps the thumbnail for a youtube-nocookie.com player, so nothing is
fetched from YouTube before that. A card without a valid video id shows
"Video på vej" and cannot be played. Every info page links to /guider in
the nav; the phone nav keeps five links on one row at 375 px.

Tests: test-guider.cjs (no external request before play, the nocookie
player after a tap, disabled cards, one nav link per page; 6 mutants
killed) and /guider in test-mobile.cjs (320-1280 px).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The guides are now on the MeshView YouTube channel. Each card carries its
video id, so it plays on a tap; the test checks the published ids and keeps
the disabled-card cases on a rewritten copy of the page.

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

dborup commented Nov 28, 2026 •

Copy link
Copy Markdown
Owner Author

Review — CS-MacBook PR#1012 — head cb99a34

Dom: APPROVE med nits

Evidence labels: [T] test or command I ran, [A] analysis / reading, [K] known limitation or not verified. Head was cb99a342 before and after (git ls-remote). I only read and tested; nothing was pushed or changed.

Findings

# Severity Finding Evidence
1 Medium (content) Two "Læs om …" links point to pages that do not cover the topic. docs/user-guide/map.md has no section on base layers, terrain profile or Fresnel, and nodes.md has nothing on oblique photos. Both files exist, so the links are not broken, but "Læs om terrænprofil" and "Læs om nodesiden" lead to text that does not match. Either add the sections or reword the labels (for example "Læs om kortet"). [A] grep of both files and of docs/ in the merged tree
2 Medium (test gap) The id-validation test is weak. Mutants that drop ^, drop $, or change {11} to {1,} all survive, because the only malformed id in the test (abc"onerror) contains no 11-character run. Real exposure is low, since ids are author-edited static HTML, but the "validated before it reaches a URL" requirement has no test that would catch a loosened regex. Add cases such as a valid id plus a suffix (dQw4w9WgXcQ/../x, dQw4w9WgXcQ?x), a prefix, and a 10-character id. [T] mutants 1–3 below
3 Low The PR text says the nav keeps all five links on one row at 375 px. Measured: /velkommen, /observer and /guider are one row, but /hardware and /radio wrap to two rows at 375 px. With four links, those two pages were one row on the base. At 320 px all five pages are two rows, as stated. Nothing overflows or clips and every link is ≥44 px, so it is a cosmetic regression plus an incorrect claim. [T] my layout script at 320/375/390 on head and base
4 Low test-mobile.cjs does not check the nav row count. Mutant 8 (site.css gap 14→40 px) survives. referrerpolicy on the iframe is also untested (mutant 7 survives). [T] mutants 7, 8
5 Low The PR body is stale against the head. It says cards without an id show "Video på vej" and that no ids exist yet ("Not done: YouTube ids"). The head has three real ids and a YouTube channel link. The body should match what ships. [A] PR body vs guider.html
6 Nit The lead text says each guide lasts "et til to minutter", but the cards show 0:56, 1:09 and 1:48. [A] guider.html
7 Nit modestbranding is deprecated by YouTube and has no effect. [K]
8 Info The branch is stacked on #1011, which is not merged. gh pr checks reports no CI on this branch, so there is no per-job CI to read. A merge to master carries all of #1011 as well. The merged tree is f509d99c. [T] gh pr checks, git merge-tree

Answers to the checklist

Privacy

  • Cold start at 375×560 on /velkommen, tap the nav "Guider", then /guider: 0 requests left the local origin until play. I used Playwright with all external requests intercepted and logged. [T]
  • After a real touch tap the only external request is https://www.youtube-nocookie.com/embed/<id>?autoplay=1&rel=0&…. No youtube.com, ytimg or googlevideo. [T]
  • Thumbnails are local: three 640×360 JPEGs (file). Fonts are local. Replacing a thumbnail with a ytimg URL is caught by the test (mutant 13). [T]
  • I did not read production response headers. Those depend on the host, and I have no production access. [K]

Safety

  • guider.js has no innerHTML, insertAdjacentHTML, outerHTML, document.write or eval. It builds the iframe with createElement and setAttribute. [T] grep
  • The id is tested against ^[A-Za-z0-9_-]{11}$ before it reaches the URL. The regex is correct as written, but see finding 2 for the test gap. [A]
  • scripts/check-xss-sinks.sh --diff origin/master is clean, but it only scans public/**. This PR touches sites/ only, so the result is vacuous ("no public changes to scan"). I did the manual grep above instead. [T]

UX

  • Cards without a valid id are disabled, show the "Video på vej" badge and have an aria-label ending "video på vej". The test covers this, and removing the badge or disabled is killed. [T]
  • Real taps at 375×560 and 360×640 with touch: the tap lands on the visible button or play icon (elementFromPoint checked), and the iframe replaces it at 325×183. Focus moves to the iframe. Each card played when tapped on its own. No page overflow after play. [T]
  • Keyboard: Tab order is nav → back link → card buttons → card links. The play buttons have aria-label "Afspil video: " and a visible :focus-visible outline. [T]/[A]
  • 44 px: the nav links and .guide-links a are ≥44 px at 320/375/390. Mutant 12 (30 px) is killed. [T]
  • Overflow at 320/375/390 on all five pages: none caused by this PR. /observer is 5 px wider than the viewport at 320 px, and the base (docs(info): keep the MeshView information pages in the repo #1011) has the same width, so it is pre-existing. [T]
  • The site.css nav change does not break the other four pages (see finding 3 for the row count).

Tests

  • test-guider.cjs passes. test-mobile.cjs passes for 5 pages × 5 widths. test-xss.cjs and test-copy-commands.js pass. All run on the merged tree. [T]
  • Go: cmd/server go test ./... passes (165 s) and cmd/ingestor passes (148 s). The PR changes no Go, so these show no regression only. [T]
  • node test-frontend-helpers.js: 738 passed, 0 failed. [T]
  • sh test-all.sh: 380 passed, 2 failed (test-issue-628-vendor-gitattributes.js and test-issue-715-og-denmark.js). Both fail with fatal: not a git repository because my scratch tree came from git archive and has no .git. I did not rerun them in a real checkout. [T]/[K]

Content

  • The three ids resolve on YouTube (oEmbed) to "Danske kort og lag i MeshView", "Terrænprofil mellem to noder i MeshView" and "Skråfoto i MeshView – se din node fra luften". They match the card order and titles. The channel link @Meshview-dk returns 200. [T]
  • The guide texts read correctly. See findings 1 and 6 for the links and the duration wording.
  • I could not check that the videos have Danish subtitles (cc_load_policy=1&hl=da only shows them if they exist). [K]

Always

  • No cmd/ or public/ changes. cmd/server stays read-only and there are no new map[string]interface{} (0 in the diff). [T]
  • No hardcoded colors outside :root. The page defines its own :root tokens, as the other info pages do. [A]
  • The PR touches no workflow files, so the fork-guard counts are unchanged. [A]
  • All 7 commits (stack) are authored and committed as dborup <kontakt@meshview.dk>. No closing keywords in commits or PR body. [T]
  • Dark-only site, so no light-theme check.

Mutants (own, against test-guider.cjs)

# Mutation Result
1 Drop ^ from the id regex SURVIVED
2 Drop $ from the id regex SURVIVED
3 {11} → {1,} SURVIVED
4 Class → .{11} killed
5 youtube-nocookie.com → youtube.com killed
6 Remove autoplay=1 killed
7 Rename referrerpolicy SURVIVED
8 site.css nav gap 14 → 40 px SURVIVED (not tested by either suite)
9 Load the player on setup (no click) killed
10 Do not set disabled killed
11 Remove the "Video på vej" text killed
12 Remove the play aria-label killed
13 Remove the iframe title killed
14 Drop the Guider nav link from radio.html killed
15 .guide-links a min-height 44 → 30 px killed
16 /embed/ → /watch?v= killed
17 Thumbnail from i.ytimg.com killed

13 of 17 killed. "Red before, green after" holds for privacy, nocookie, autoplay, disabled state and nav links. It does not hold for the id-format check beyond the one malformed sample (finding 2).

Not verified

  • Real iPhone/Safari and the Safari bottom bar. I used Chromium touch emulation at 375×560, 360×640 and 375×740. [K]
  • That the YouTube player actually plays. In my runs the player request was stubbed, because I did not want to load YouTube. [K]
  • Danish subtitles on the videos. [K]
  • Production headers or deployment of the pages. [K]
  • The Playwright E2E suites against a local Go server with e2e-fixture.db. This PR changes nothing under cmd/ or public/, so I judged them unaffected and did not run them. [K]
  • test-all.sh in a real git checkout (see Tests).

Decisions I made without asking: judged findings 1 and 2 as non-blocking because the links resolve and ids are author-controlled static markup, but both are worth fixing in this PR.

@dborup
dborup changed the base branch from codex/meshview-info-pages to master November 28, 2026 09:40
@dborup dborup closed this Nov 28, 2026
@dborup dborup reopened this Nov 28, 2026
dborup added a commit that referenced this pull request Nov 28, 2026
#1021)

seedTxWithObs inserted the transmission and each observation as separate
autocommit statements. If the tx_last_seen_backfill_v1 goroutine that
OpenStore schedules ran between them, it stamped last_seen from a partial
set of observations (100 instead of 300), and the test's own backfill
call then skipped the row because it only selects last_seen = 0.

newTestStore and WaitForAsyncMigrations already drain that goroutine
before seeding, so current master is not exposed. The failures on
#1012 came from a merge commit (5072050, base 4af4177)
whose test code predates those waits. Seeding in one transaction closes
the window regardless: a backfill running at any point sees the row with
none or all of its observations. seedTxNoObs now reuses the same helper.

Relates to #1012

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
@dborup
dborup merged commit e7b41e5 into master Nov 29, 2026
19 checks passed
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