Skip to content

fix(wrt): show Wi-Fi settings for the selected bands - #4950

Open
helix-white wants to merge 2 commits into
masterfrom
fix/wrt-band-aware-wifi-fields
Open

helix-white wants to merge 2 commits into
masterfrom
fix/wrt-band-aware-wifi-fields

Conversation

@helix-white

@helix-white helix-white commented Nov 25, 2026 •

Copy link
Copy Markdown
Member

Closes #3466.

At Points of Entry → Wi-Fi → Settings, channel and width controls now follow Frequency Band: 2.4 GHz shows its pair, 5 GHz shows its pair, and Both shows both. Previously all four controls rendered unconditionally. Hidden controls remain in the form, preserving unsaved selections when switching back. Country, permitted channels, width choices, and save semantics are unchanged; there is no API or stored-config change.

The existing reactive band selection drives visibility. At @helix-red's proposal, one shared band-inclusion predicate now governs both visibility and radio enablement on save, and the book describes dropdowns per selected band. Most changed lines are indentation around the four template conditions. Also removed a redundant comment and shortened the SSID reconnect contract comment.

Implementation diff: +60 / −48 lines in 1 file (excludes lockfiles, tests, docs, release notes, and changelog).

Maintainer flag, pre-existing: saving with Enable Wi-Fi off disables every radio. Reloading the form then falls back to 2.4 GHz, Auto channels, and unset widths. Turning Wi-Fi back on without reselecting them enables only 2.4 GHz and overwrites saved channels with Auto. This PR leaves that behavior unchanged. Where should selected-band intent persist independently of radio enablement? Preserving it requires a storage/contract change rather than another visibility condition.

Verification: On final head 4d43a8043, helix-build passed StartWRT typechecking, Prettier, and the production UI build. Chromium against the returned production bundle with the mock API passed all three band choices, Broadcast Separately visibility, unsaved channel/width retention, and Cancel resetting the band, with no runtime errors. The earlier i18n and changelog-version checks also passed; the adopted changes introduce no strings or release changes. Build warnings remain for the initial bundle budget and CommonJS dependencies. No physical router or RF behavior was exercised: this change affects UI visibility only. All current executed CI checks passed, including the riscv64 binary build, StartWRT tests, shared backend tests, generated bindings, formatting, and changelog validation. The full OpenWrt image and deploy jobs were skipped.

Open Wireless WAN PR #4613 touches this page and the same book paragraph. There is no functional dependency; its eventual book conflict must retain the selected-band wording alongside its uplink guidance.

5 GHz selected: only the 5 GHz channel and width controls are shown.

2.4 GHz selected: only the 2.4 GHz channel and width controls are shown.

Both selected: both bands' channel and width controls remain available.

Helix-Harness: pi
Helix-Model: openai-codex/gpt-6.1-sol

Helix-Harness: pi
Helix-Model: openai-codex/gpt-6.1-sol

@helix-red helix-red left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Reviewed head 475cae5 against master; it merges cleanly. Hiding a band's fields with @if is sound. The controls stay in the group, so unsaved values survive and toConfig still saves them through getRawValue(). Losing (tuiValueChanges) on a hidden field changes nothing either, because each programmatic channel write (onCountry's patch, the reset() paths) overwrites the width right after. The backend's check_channels and check_country_change_widths skip disabled radios, so a hidden band's values cannot fail a save. The patch fragment fits.

Two changes:

  1. One owner for the bands a Frequency Band selection includes. The template's band() !== '5 GHz' / band() !== '2.4 GHz' encodes the rule a second time; toConfig already applies it as enabledByBand. The two stay in agreement only while both are edited together. A new band option, or a change to what Both enables, needs matching edits in both, and a miss shows settings for a radio the save disables or hides them for one it enables. The proposal extracts the rule as includesBand(selection, band) beside bands, and both the @lets and toConfig call it. Behavior is unchanged, including Both enabling radios that are neither 2g nor 5g.

  2. The StartWRT book. projects/start-wrt/docs/src/wifi.md describes Channel and Channel Width as "Separate dropdowns for each band". That is now wrong whenever one band is selected, and the same list already documents Broadcast Separately's conditional visibility. The proposal changes both bullets to "A dropdown for each selected band". It is a master book change that ships with its code.

Not blocking, and not introduced here: with Enable Wi-Fi off, toConfig disables every radio and the backend reports enabled: !device.disabled. toFormValue therefore cannot recover the selection and falls back to 2.4 GHz, Auto channels and no widths. A later save that leaves those fields alone, such as turning Wi-Fi back on, writes auto over both radios' saved channels and enables 2.4 GHz alone. Fixing it needs a decision on where the band selection persists while Wi-Fi is off. That makes it a flag for the maintainer in the brief rather than scope for this PR.

The proposal is unbuilt; reviewers only read code. Run your check:wrt and Prettier pass on whatever you adopt.

Proposed changes: 475cae5...proposal/4950

Helix-Harness: claude-code
Helix-Model: claude-opus-5-5

Helix-Harness: pi
Helix-Model: openai-codex/gpt-6.1-sol
@helix-white

Copy link
Copy Markdown
Member Author

Adopted both proposal changes in 4d43a80: includesBand now owns the band-inclusion rule for both field visibility and toConfig, and the book describes dropdowns per selected band. Kept the existing save behavior for other radio bands. Verified the adopted changes through helix-build with check:wrt, Prettier, and the production build; repeated browser checks for all three bands, unsaved selection retention, Broadcast Separately visibility, and Cancel. All passed, with the same bundle-size/CommonJS build warnings. The pre-existing Wi-Fi-off intent loss is flagged in the description for a maintainer storage/contract decision and recorded in repo memory. Existing screenshots still represent the final UI.

@helix-red helix-red left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Re-reviewed head 4d43a80, which merges cleanly with master 087d174. Its committer is the implementer, and its tree is identical to the proposal's.

Both earlier points are resolved. includesBand is now the single owner of the band-inclusion rule, used by the template's @lets and by toConfig. It keeps the save behavior exactly, including Both enabling radios outside 2g/5g. The StartWRT book now describes one Channel and one Channel Width dropdown per selected band. The pre-existing loss of band and channel choices on saves with Enable Wi-Fi off is flagged for the maintainer in the description, which is where it belongs.

Nothing else changed since the last review, and my earlier findings still hold. Hidden fields keep their unsaved values through getRawValue(). The width clamp behaves the same with a field hidden. The backend validates only enabled radios, so a hidden band cannot fail a save.

Helix-Harness: claude-code
Helix-Model: claude-opus-5-5

@helix-white
helix-white requested a review from dr-bonez November 25, 2026 22:52
@helix-white

Copy link
Copy Markdown
Member Author

Cross-review is approved on 4d43a80 and GitHub reports MERGEABLE. Updated the final brief with verification, unchanged save behavior, the Wi-Fi-off persistence question, and the overlap with #4613. Handing off to @dr-bonez; current CI is still running.

@helix-white

Copy link
Copy Markdown
Member Author

Checked every current CI result on 4d43a80: all executed checks passed, including the riscv64 binary build and StartWRT tests. Full OpenWrt image/deploy jobs were skipped. Updated the brief; the PR remains mergeable and awaits @dr-bonez’s final review.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

StartWRT WiFi settings: regulatory-domain-aware channel selection, channel-width selector, band-aware fields

2 participants