amyboardweb: gate sync modal behind explicit Pull button#913
Merged
Conversation
Stop auto-syncing on a fresh page load in control mode. The syncing modal now opens in a "ready to pull" state with a big green "Pull from AMYboard" button, MIDI dropdowns enabled, and the three existing exit buttons. The zB+zD flow only runs after the user clicks the button, and uses whatever MIDI ports are currently selected in the modal's dropdowns. Continuation paths (post-reset reload, post-zB-upload reload, post-zB reload Windows-Chrome trick) still auto-run pageload_control_sync so in-progress flows from a previous click finish without a second click. start_pull_from_amyboard reuses sync_modal_retry to copy the modal's port selections back to the main dropdowns and rerun the existing pull flow, so the retry path on error converges with the initial click path. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Make _show_syncing_modal the single entry point for the sync/pull modal, and have it always open in the green-button ready state. The function now returns a promise that resolves when the user clicks Pull from AMYboard (and rejects on dismiss), so every caller — pageload sync, sync_amy_state, and the save-flow zB reboot wait — awaits explicit user confirmation before issuing sysex traffic. start_pull_from_amyboard applies the modal's MIDI port selections back to the main dropdowns, runs setup_midi_devices, transitions the modal to busy/spinner state, and resolves the pending promise. Continuation reload paths (post-reset, post-zB upload, post-zB Windows trick) keep auto-running, but use the new _show_syncing_modal_busy helper so the green button never re-prompts mid-flow. sync_modal_retry sets a one-shot _skip_pull_gate flag before re-invoking the work path so retries go straight to busy state — the user already chose ports and hit Try again, no need to bounce them back to the green button. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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
_show_syncing_modal()returns a promise that resolves when the user clicks the green "Pull from AMYboard" button (after MIDI port selections have been applied to the main dropdowns), and rejects if dismissedpageload_control_sync(initial pull),sync_amy_state(Sync Sketch button + save flow's zA+zD), and the save flow's zB-reboot wait at line 3951start_pull_from_amyboardapplies modal MIDI selections to main, runssetup_midi_devices, transitions to busy/spinner, then resolves the pending promise so the awaiting caller continues_show_syncing_modal_busy()so an in-progress flow from a previous click finishes without a second clicksync_modal_retrysets a one-shot_skip_pull_gateflag before re-invoking the work path so retries go straight to busy — the user already picked ports and clicked Try againTest plan
🤖 Generated with Claude Code