Skip to content

Keep Android Auto FAQ links inside the offline bundle - #374

Open
biodranik wants to merge 1 commit into
masterfrom
fix/embedded-faq-local-links
Open

biodranik wants to merge 1 commit into
masterfrom
fix/embedded-faq-local-links

Conversation

@biodranik

@biodranik biodranik commented Nov 15, 2026 •

Copy link
Copy Markdown
Member

The app-bundled FAQ contains relative Android Auto URLs that resolve to missing local files when opened from an app asset. Resolve the four URL variants to the existing bundled answer at build time, preserving published paths and fragments.

Name the trusted HTML replacement once. Its single safe marker preserves attribute quotes on both Zola 0.23.4 and 0.23.6; the body filter also remains safe. Remove the duplicated call-site flags and redundant document-request bookkeeping.

Check every generated link destination, allowing bundled fragments and supported absolute URLs. Derive the complete language inventory from question titles independently of the links under test, and scope checks to the requirements answer so additional Android Auto links elsewhere do not duplicate cases. Update browser-suite docs/CI labels and correct “Organic Maps” in the German requirements answer.

Validation:

  • Zola 0.23.4 and 0.23.6 build successfully and produce equivalent embedded HTML.
  • All six Python 3.12 template tests, nine donation/embedded browser tests, 25 tooling tests and 185 round-trip checks pass; all 3,169 corpus files round-trip.
  • The offline local-file test exercises all 26 bundled languages, unique targets and visible scrolling.
  • Mutation checks reject ../x/, ./x/, x/ and /faq/x/, and detect a missing German bundled link instead of skipping that language.
  • Rendered changes are limited to the intended hrefs and German typo. Markdown syntax, diff checks and normal commit hooks pass.
  • The branch is squashed to one signed-off commit against master.

Independent of #373. The two final branches combine without conflicts; the combined site builds and all 11 template tests, 27 tooling tests, 185 round-trip checks and 15 browser regressions pass. Additional whole-answer and shared-heading jumps, including localized OpenStreetMap-note targets, are handled in #373.

CI, Cloudflare preview and DCO pass on 041098b4. All review threads are resolved.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 15, 2026 •

Copy link
Copy Markdown

Deploying organicmaps with  Cloudflare Pages  Cloudflare Pages

Latest commit: 041098b
Status: ✅  Deploy successful!
Preview URL: https://d925b128.organicmaps.pages.dev
Branch Preview URL: https://fix-embedded-faq-local-links.organicmaps.pages.dev

View logs

@biodranik
biodranik requested a review from vng November 15, 2026 21:40

@vng vng left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review of 5c96fce

The fix is correct and nothing blocks the merge. I built the site with Zola 0.23.4 and compared the output with master: the only change to public/faq/embedded-faq/index.html is 26 hrefs (one per bundled language, English included) rewritten to #app-how-to-use-android-auto. The new browser test passes on this branch and fails on master's output. CI is green and there were no review threads to resolve.

Fix here (details inline)

  1. Template: the four inner | safe filters are redundant; only the trailing one is needed.
  2. Test: assert the whole invariant (every link is #…, https://… or mailto:) instead of only ../.
  3. Test: the documents / trackDocument tracking is subsumed by the page.url() assertion.
  4. Docs: CLAUDE.md, .github/copilot-instructions.md and the check.yml step name still call test:browser donation-only.

Alternative considered: @/ links plus generic permalink-to-fragment mapping

I prototyped switching the 34 source files to @/faq/app/how-to-use-android-auto/index.LANG.md (the documented convention) and replacing each bundled page's permalink with its fragment in the template.

  • Pros: no hard-coded slugs, the website loses the 301 hop through the alias, and any future cross-link between bundled answers is covered.
  • Cons: it only resolved 11 of the 26 languages. Rendered hrefs are percent-encoded while permalink is not, so non-ASCII slugs do not match. It also needs about 5,000 extra get_page lookups and special handling for …/#osm-note suffixes.

The hard-coded approach in this PR is the better trade-off for now.

Pre-existing, optional separate PRs

  • Other links still leave the bundle: each language has two absolute links to the bundled advanced-map-editing answer (one with #osm-note) that open the website instead of jumping to #editing-advanced-map-editing. They work online, unlike the relative ones fixed here. id="osm-note" also appears 26 times in the bundle, so that fragment cannot work in-bundle as it stands.
  • Typo: content/faq/app/which-ios-and-android-versions-are-supported/index.de.md:20 says "Oragnic Maps".

Generated by Claude Code

Comment thread templates/faq/embedded-faq.html Resolved
Comment thread tools/embedded_faq_browser.test.cjs Resolved
Comment thread tools/embedded_faq_browser.test.cjs Resolved
Comment thread package.json Resolved
Resolve relative Android Auto URLs to the bundled answer at build time.
Name the trusted replacement once and preserve its attribute quotes across
supported Tera releases.

Check every generated link destination and derive language coverage from the
question titles independently of the links. Exercise local-file jumps with
Chromium offline, update browser-suite documentation and CI labels, and
correct the German product name.

Signed-off-by: Alexander Borsuk <me@alex.bio>
@biodranik
biodranik force-pushed the fix/embedded-faq-local-links branch from 5c96fce to 041098b Compare November 16, 2026 00:09

This branch was successfully deployed

1 active deployment
production — 041098b4 Deployed Nov 16, 2026 by biodranik via Check Zola build #1277
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