Skip to content

amyboardweb: gate sync modal behind explicit Pull button#913

Merged
bwhitman merged 2 commits into
mainfrom
sync-modal-pull-button
Apr 26, 2026
Merged

amyboardweb: gate sync modal behind explicit Pull button#913
bwhitman merged 2 commits into
mainfrom
sync-modal-pull-button

Conversation

@bwhitman
Copy link
Copy Markdown
Collaborator

@bwhitman bwhitman commented Apr 26, 2026

Summary

  • The sync/pull modal is now the single entry point for any zB/zA/zD/zT/zP traffic in control mode, and it ALWAYS opens in green-button ready state — no auto-spinner, no auto-sync
  • _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 dismissed
  • Every caller awaits the promise before sending sysex: pageload_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 3951
  • Three exit buttons (Switch to Simulate, Reset AMYboard, Upgrade Firmware) remain; modal width unchanged
  • start_pull_from_amyboard applies modal MIDI selections to main, runs setup_midi_devices, transitions to busy/spinner, then resolves the pending promise so the awaiting caller continues
  • Continuation reload paths (post-reset, post-zB-upload, post-zB Windows-Chrome trick) still auto-complete via _show_syncing_modal_busy() so an in-progress flow from a previous click finishes without a second click
  • sync_modal_retry sets a one-shot _skip_pull_gate flag before re-invoking the work path so retries go straight to busy — the user already picked ports and clicked Try again

Test plan

  • Fresh load editor in control mode → modal shows green Pull button, no sysex traffic until clicked
  • Click Pull → board reboots into bootloader and zD pull completes, sketch loads in editor
  • Change MIDI In/Out dropdowns before clicking Pull → pull uses the new ports
  • Click "Write sketch and knobs to AMYboard" → first modal (zA+zD) shows green button; click it; second modal (zB reboot) shows green button; click it; upload completes
  • Trigger an error (wrong ports) → "Try again" → goes straight to busy state, no extra green-button click required
  • Reset AMYboard → resetting modal auto-completes after the page reload
  • Windows Chrome path: zB → reload → modal auto-resumes the pull in busy state

🤖 Generated with Claude Code

bwhitman and others added 2 commits April 26, 2026 13:40
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>
@bwhitman bwhitman merged commit 3b8efb1 into main Apr 26, 2026
1 check passed
@bwhitman bwhitman deleted the sync-modal-pull-button branch April 26, 2026 17:51
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