Skip to content

feat(web): Navigator download page with per-platform installer links - #28

Merged
JamesKane merged 1 commit into
mainfrom
feat/navigator-download
Aug 2, 2026
Merged

feat(web): Navigator download page with per-platform installer links#28
JamesKane merged 1 commit into
mainfrom
feat/navigator-download

Conversation

@JamesKane

Copy link
Copy Markdown
Owner

Adds /download — Windows / macOS / Linux installers for the Navigator edge app — plus /download/{windows,macos,linux}, permanent redirects that always land on the current build.

Why it isn't just three static links

The obvious approach (…/releases/latest/download/<asset>) fails twice over for this repo:

  1. GitHub's "latest" excludes pre-releases, and every Navigator installer release is an alpha pre-release. Today /releases/latest resolves to assets-chm13v2.0 — the Ancestry/IBD + STR reference-data release — not the app.
  2. Tauri stamps the app version into every filename (navigator_0.1.0_x64-setup.exe), so there is no stable asset name to hard-code.

So du-external::github lists releases newest-first and takes the first one that actually carries installer assets — drafts skipped, pre-releases kept — then classifies each asset by platform / arch / format and marks a primary build per platform (x64 .exe, universal .dmg, x86_64 AppImage). Updater artifacts (.sig, .app.tar.gz) and data assets are not downloads and are filtered out.

Behaviour

  • Caching: resolution is cached process-wide, 30 min on success and 5 min after a failure — roughly 2 GitHub calls/hour against an unauthenticated limit of 60.
  • Degradation: if GitHub is unreachable the page shows a warning and falls back to the releases listing; the redirects fall back the same way. Never a 500.
  • Platform detection: the visitor's OS is guessed from the User-Agent and their card is shown first and highlighted. Phones get no false "your system" match. Every platform stays visible either way.
  • Secondary builds: arm64 AppImage and both .debs are listed under the primary button, with sizes; SHA256SUMS is linked for verification.

Also links the page from the Tools nav, the home "participate" section and the FAQ answer that already mentions the Navigator, and adds /download to the sitemap. That FAQ answer claimed the Navigator is "built on the JVM (Java/Scala)" — corrected to Rust, since it sits directly above the new download button.

Config: DU_NAVIGATOR_REPO overrides the source repo (default JamesKane/decodingus-navigator); GITHUB_TOKEN, if set, raises the API rate limit. Neither is required.

Verification

Run against the live repo (cargo run -p du-web, real GitHub API):

/download          → v0.1.0-alpha.15, all 6 installers + SHA256SUMS, Alpha badge
/download/windows  → 307 → …/v0.1.0-alpha.15/navigator_0.1.0_x64-setup.exe → 200 attachment
/download/macos    → 307 → …/DUNavigator_0.1.0_universal.dmg
/download/linux    → 307 → …/navigator_0.1.0_x86_64.AppImage
/download/bogus    → 307 → …/releases   (unknown slug → listing, not a 404)

macOS UA highlighted the macOS card; Windows UA reordered Windows first.

Tests: cargo test -p du-external (26 pass — 7 new, covering the pick-the-installer-release rule against a fixture of the real response shape, asset classification, draft/updater filtering, and the empty case) and cargo test -p du-web --bins (71 pass — 6 new for the view model, template, UA detection and size formatting, plus the en/es/fr locale-parity test over the 18 new keys).

No migration, no schema or API change.

🤖 Generated with Claude Code

Adds `/download` — Windows / macOS / Linux installers for the Navigator edge
app — plus `/download/{windows,macos,linux}`, permanent redirects that always
land on the current build.

The links can't be hard-coded. Tauri stamps the app version into every
filename (`navigator_0.1.0_x64-setup.exe`), and GitHub's `/releases/latest`
excludes pre-releases — which is all the Navigator publishes, so "latest"
currently resolves to the `assets-chm13v2.0` reference-data release, not the
app. So `du-external::github` lists releases newest-first and takes the first
one that actually carries installer assets (drafts skipped, pre-releases kept),
classifies each asset by platform/arch/format, and picks a primary build per
platform: x64 .exe, universal .dmg, x86_64 AppImage.

du-web caches the resolution process-wide (30 min on success, 5 min after a
failure) so the page costs ~2 GitHub calls an hour against an unauthenticated
limit of 60. If GitHub is unreachable the page degrades to the releases
listing rather than erroring. The visitor's own platform is detected from the
User-Agent and offered first; secondary builds (arm64, .deb) and the
SHA256SUMS link stay on the page.

Also links the page from the Tools nav, the home "participate" section and the
FAQ answer that mentions the Navigator, adds it to the sitemap, and corrects
that FAQ answer's claim that the Navigator is built on the JVM (it is Rust).

`DU_NAVIGATOR_REPO` overrides the source repo; `GITHUB_TOKEN`, if set, raises
the API rate limit.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@JamesKane
JamesKane merged commit c700200 into main Aug 2, 2026
1 check 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