Skip to content

Follow the selected variant for header GitHub and classic-installer links#22

Merged
bharvey88 merged 2 commits into
mainfrom
feat/per-variant-installer
Jul 20, 2026
Merged

Follow the selected variant for header GitHub and classic-installer links#22
bharvey88 merged 2 commits into
mainfrom
feat/per-variant-installer

Conversation

@bharvey88

@bharvey88 bharvey88 commented Jul 20, 2026

Copy link
Copy Markdown
Collaborator

Follow-up to PR #21. Makes the remaining device links follow the selected firmware variant, so nothing points at the wrong repo or a stale installer under 16.0.1.

  • Header "GitHub" link is now variant-aware via the existing repos map: selecting the M-1's "WLED 16.0.1 (Rev6 only)" variant points it at WLED-M1; the 14.5.1 variants stay on WLED-MM-M1.
  • "Classic installer" links (header + USB-fallback) follow the variant through a new optional installers map (channel to variant to URL, or null to mean "no classic installer for this variant, hide the link"). WLED-M1 has no classic installer page, so the M-1's 16.0.1 variant sets it to null and the link simply isn't shown for that variant; the 14.5.1 variants keep their working WLED-MM-M1 classic link. This avoids pointing users at a 404 or a 14.5.1-only page.

Implementation: the header link row moved into a re-rendered slot so it updates on variant/channel change; a classicInstallerFor resolver mirrors repoFor (falls back to the device-level githubPagesInstaller). A network-free validator guard (check_installers_shape) rejects a malformed map or a URL/null attached to a nonexistent variant.

Scope note: on the M-1 the header "Classic installer" link disappears when 16.0.1 is selected and returns on the 14.5.1 variants, which reflects that 16.0.1 has no standalone classic installer.

Tests: Playwright 23/23 (new test proves the header GitHub link flips to WLED-M1 and the Classic installer link disappears on the 16.0.1 variant); validator unit tests 27/27; validate_registry.py green against the live registry.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Classic installer links now update automatically based on the selected firmware variant.
    • Variants can hide the classic installer when unavailable.
    • GitHub links reflect variant-specific repository settings where provided.
  • Bug Fixes

    • Installer links now consistently use the correct selection-specific destination.
  • Tests

    • Added coverage for installer configuration validation and variant-dependent link behavior.

Add check_installers_shape, a network-free validator for the new optional
installers field in devices.json (channel -> variant -> https URL or null).
A null value means the variant has no classic installer and the link should
be hidden; any other value must be an https URL, and every variant key must
exist in the device's firmware map. Wired into main() alongside the existing
repos/config shape checks. Includes unit tests covering the absent map, null
hide, URL override, non-dict inputs, non-https values, and unknown variants.

🤖 Generated with [Claude Code](https://claude.com/claude-code)
…inks

The header "GitHub" link and the "Classic installer" links (header +
USB-fallback) were static, always pointing at device.repo and
device.githubPagesInstaller regardless of the selected variant.

Add a classicInstallerFor(device, channel, variant) resolver alongside
the existing repoFor, and a new installers map in devices.json (mirroring
the shape of the existing repos map) so a variant's classic installer can
be overridden or hidden entirely with a null value.

Replace the static header link row with a re-rendered #links-slot driven
by a new renderLinks() function, called on initial render and on every
variant/channel change, matching the existing pattern used by
renderInstall/renderConfig/renderReleaseNotes. The Classic installer link
is omitted from both the header and the USB-fallback list whenever the
resolved value is null, which is the case for M-1's WLED 16.0.1 (Rev6
only) variant.

🤖 Generated with [Claude Code](https://claude.com/claude-code)
@coderabbitai

coderabbitai Bot commented Jul 20, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: e1a4dc8d-3efb-4442-8152-beec131b36c0

📥 Commits

Reviewing files that changed from the base of the PR and between cde8bb7 and 3f767af.

📒 Files selected for processing (5)
  • devices.json
  • js/views/device.js
  • scripts/test_validate_registry.py
  • scripts/validate_registry.py
  • tests/installer.spec.js

Walkthrough

The registry now supports optional per-variant classic installer overrides. Device-page links update with firmware selection, hiding unavailable installers and honoring repository overrides. Validation and browser tests cover the new behavior.

Changes

Variant installer support

Layer / File(s) Summary
Registry installer contract
devices.json, scripts/validate_registry.py, scripts/test_validate_registry.py
Adds a nullable per-variant installer entry, validates installer mappings and HTTPS URLs against firmware variants, and tests the validation rules.
Selection-aware device links
js/views/device.js, tests/installer.spec.js
Resolves classic installer links for the selected variant, updates header and fallback UI, and verifies hidden installers and repository overrides.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Browser
  participant device.js
  participant DeviceInstallerMap
  Browser->>device.js: select channel and variant
  device.js->>DeviceInstallerMap: resolve installer URL for selection
  DeviceInstallerMap-->>device.js: return URL or null
  device.js->>Browser: render GitHub and conditional classic installer links
Loading

Poem

I’m a rabbit with links in my den,
Changing with each variant again.
A null link hides away,
While the right paths display—
Hop, validated, and ready to send!

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/per-variant-installer

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@bharvey88
bharvey88 merged commit 4d530a3 into main Jul 20, 2026
2 of 3 checks passed
@bharvey88
bharvey88 deleted the feat/per-variant-installer branch July 20, 2026 16:34
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