Follow the selected variant for header GitHub and classic-installer links#22
Conversation
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)
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (5)
WalkthroughThe 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. ChangesVariant installer support
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
Poem
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
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.
reposmap: 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.installersmap (channel to variant to URL, ornullto 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 tonulland 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
classicInstallerForresolver mirrorsrepoFor(falls back to the device-levelgithubPagesInstaller). 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.pygreen against the live registry.🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Bug Fixes
Tests