puter icon indicating copy to clipboard operation
puter copied to clipboard

fix(ui): support defaultValue in showFontPicker app environment

Open SusTechStitch opened this issue 6 months ago • 1 comments

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 legacy default before sending options to the app environment
  • Support defaultValue, defaultFont, and default in UIWindowFontPicker
  • Fix scrolling to the active default font by avoiding shadowing the global window
  • Add defaultValue to FontPickerOptions

Testing

  • git diff --check
  • node --check src/puter-js/src/modules/UI.js
  • node --check src/gui/src/UI/UIWindowFontPicker.js
  • npm 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.

SusTechStitch avatar May 15 '26 16:05 SusTechStitch

CLA assistant check
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.

CLAassistant avatar May 15 '26 16:05 CLAassistant

@SusTechStitch could you sign the CLA will test this shortly after

Salazareo avatar Jun 18 '26 16:06 Salazareo

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

xsourabhsharma avatar Jun 30 '26 02:06 xsourabhsharma

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

Salazareo avatar Jul 07 '26 18:07 Salazareo