Skip to content

Replace blocking prompt() with themed MBDialog helper#5844

Merged
walterbender merged 1 commit intosugarlabs:masterfrom
zealot-zew:Save-interfaces-UI
Mar 8, 2026
Merged

Replace blocking prompt() with themed MBDialog helper#5844
walterbender merged 1 commit intosugarlabs:masterfrom
zealot-zew:Save-interfaces-UI

Conversation

@zealot-zew
Copy link
Contributor

@zealot-zew zealot-zew commented Feb 20, 2026

This PR replaces the native, blocking window.prompt() in the file saving interface flow with a custom dialog component. The new MBDialog matches the application's widget styling and supports theme-aware CSS variables.

  • Save project as HTML
  • Save project as MIDI
  • Save mouse artwork as SVG
  • Save mouse artwork as PNG
  • Save music as WAV (implemented in SynthUtils)
  • Save sheet music as ABC
  • Save sheet music as Lilypond (existing UI)
  • Save sheet music as MusicXML
  • Save block artwork as SVG
  • Save block artwork as PNG

Changes

The "MBDialog" Helper: I have created a new utility specifically designed to handle messages and text prompts.It can be used or the below mentioned alerts, prompt() calls.

Consistent Styling: The new dialogs now automatically match your current theme (Light or Dark mode) and use the same window styling as the rest of the app's widgets.

Architecture and workflow:

image

Images:
image

image

Future Roadmap

This new utility is the new standard for the app. In upcoming PRs, I will be swapping out old alerts in the following areas:

This PR replaces the native, blocking window.prompt() in the file saving flow with a custom, asynchronous dialog component. The new MBDialog matches the application's widget styling and supports theme-aware CSS variables.
@github-actions
Copy link
Contributor

✅ All Jest tests passed! This PR is ready to merge.

@zealot-zew
Copy link
Contributor Author

@walterbender can you please review and let me know if i should continue.

@walterbender
Copy link
Member

This looks good. In testing, I noticed we have a few regressions -- notably in save ABC and save WAV

@walterbender walterbender merged commit fa1a50b into sugarlabs:master Mar 8, 2026
7 checks passed
parthdagia05 pushed a commit to parthdagia05/musicblocks that referenced this pull request Mar 15, 2026
This PR replaces the native, blocking window.prompt() in the file saving flow with a custom, asynchronous dialog component. The new MBDialog matches the application's widget styling and supports theme-aware CSS variables.
parthdagia05 pushed a commit to parthdagia05/musicblocks that referenced this pull request Mar 15, 2026
This PR replaces the native, blocking window.prompt() in the file saving flow with a custom, asynchronous dialog component. The new MBDialog matches the application's widget styling and supports theme-aware CSS variables.
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.

2 participants