fix(ui): support defaultValue in showFontPicker app environment
Fixes #2896.
Summary
This PR makes puter.ui.showFontPicker handle default font options consistently in the Puter app environment.
Changes:
- Normalize string shorthand,
defaultFont,defaultValue, and legacydefaultbefore sending options to the app environment - Support
defaultValue,defaultFont, anddefaultinUIWindowFontPicker - Fix scrolling to the active default font by avoiding shadowing the global
window - Add
defaultValuetoFontPickerOptions
Testing
git diff --checknode --check src/puter-js/src/modules/UI.jsnode --check src/gui/src/UI/UIWindowFontPicker.jsnpm start
Manually tested in the Puter app environment:
await puter.ui.showFontPicker("Georgia");
await puter.ui.showFontPicker({ defaultFont: "Georgia" });
await puter.ui.showFontPicker({ defaultValue: "Georgia" });
All three calls open the font picker with Georgia preselected.
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.
@SusTechStitch could you sign the CLA will test this shortly after
hey @Salazareo, the contributor hasnt responded in a while and CLA is still unsigned would it be ok if i take this over and submit a fresh PR with the same fix? dont want it to go stale
hey @Salazareo, the contributor hasnt responded in a while and CLA is still unsigned would it be ok if i take this over and submit a fresh PR with the same fix? dont want it to go stale
hi @xsourabhsharma yeah that sounds good, will close this PR for the time being