wireguard: fix wizard Download button unusable behind wait overlay - #149
Merged
Conversation
added 2 commits
July 31, 2026 09:18
wizardShowStep3()/guestPartyShowDone() rendered a real Download button under the setControlsEnabled(false) wait overlay saveChanges() leaves up until its own 5-second-later auto-reload -- confirmed live that the overlay blocked every click for the whole window, and the reload then destroyed the modal before a user ever got a working click in. saveChanges() now takes an optional completion callback; the wizards pass their step3/done/ended handlers as that callback instead of calling them unconditionally right after saveChanges() returns, and those handlers clear the overlay themselves once the real backend commit has landed. This also closes a second race where a fast Download click could overlap saveChanges()'s own still-in-flight run_commands.sh call under the same server-side lock, occasionally producing a 0-byte download.
The overlay fix alone wasn't enough: saveChanges()'s own 5-second auto-reload timer keeps ticking in the background regardless of the callback, so a user who takes more than ~5s to click a wizard's Download button (confirmed live with Guest Party Mode, whose add-a-second-guest flow routinely takes longer) still gets the modal wiped out from under them mid-interaction. saveChanges() now takes a deferReload flag; the three wizard call sites set it and take over the reload themselves, firing it only when their own Done button is actually clicked. guestPartyEnd()'s completion callback was also missing the setControlsEnabled(true) call the other two already had, for the same overlay-blocking reason.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
setControlsEnabled(false)'s wait overlay, which stays up untilsaveChanges()'s own 5-second-later auto-reload — the overlay blocked every click for the whole window, and the reload then wiped the wizard modal out. Confirmed live with a real browser: the button was never actually clickable.saveChanges()now takes an optional completion callback (every other caller passes nothing, unaffected); the wizards' step3/done/ended handlers are passed as that callback instead of being called unconditionally right aftersaveChanges()returns, and those handlers clear the overlay themselves once the real backend commit has landed.run_commands.shcall overlapsaveChanges()'s still in-flight one, both serialized behind the same server-side lock, occasionally producing a 0-byte config download.saveChanges()'s 5-second auto-reload timer keeps running regardless of the callback, so a user who takes longer than ~5s to finish interacting with the wizard (confirmed live with Guest Party Mode's add-a-second-guest flow) still gets the modal wiped out mid-interaction.saveChanges()now takes adeferReloadflag; the three wizard call sites set it and fire the reload themselves only when their own Done button is clicked, not on a fixed timer. Also fixedguestPartyEnd()'s completion callback, which was missing the samesetControlsEnabled(true)call the other two handlers already had.Test plan
node --checkon the modified filetests/wireguard/*.test.jsjsdom suite: 83/83 green