Skip to content

feat: add defaultValue support for showFontPicker in puter app environment#3403

Open
smz202000 wants to merge 1 commit into
HeyPuter:mainfrom
smz202000:fix/fontpicker-defaultvalue-support
Open

feat: add defaultValue support for showFontPicker in puter app environment#3403
smz202000 wants to merge 1 commit into
HeyPuter:mainfrom
smz202000:fix/fontpicker-defaultvalue-support

Conversation

@smz202000

Copy link
Copy Markdown

Description

This PR adds support for the defaultValue option in puter.ui.showFontPicker(), for consistency with showColorPicker() which already supports defaultValue.

When calling showFontPicker from a Puter app, passing defaultValue as an option would not pre-select the specified font because:

  1. The IPC handler did not map defaultValue to default before passing to the desktop UI
  2. The desktop UI window (UIWindowFontPicker) only checked options.default
  3. The web fallback only checked defaultFont and default

Changes

  • UI.js (web fallback): Added opts.defaultValue to the font resolution chain
  • IPC.js (app environment): Map defaultValue to default before calling UIWindowFontPicker
  • UIWindowFontPicker.js (desktop UI): Check defaultValue alongside default when highlighting the active font
  • ui.d.ts (types): Added defaultValue to FontPickerOptions interface

Related Issue

Closes #2896

…nment

Add support for the 'defaultValue' option in puter.ui.showFontPicker(),
for consistency with showColorPicker() which already supports it.

Changes:
- UI.js (web fallback): Include defaultValue in the font resolution chain
- IPC.js (app environment): Map defaultValue to default before calling UIWindowFontPicker
- UIWindowFontPicker.js: Check defaultValue alongside default when highlighting the active font
- ui.d.ts: Add defaultValue to FontPickerOptions type definition
@CLAassistant

CLAassistant commented Jul 17, 2026

Copy link
Copy Markdown

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.

@Salazareo

Copy link
Copy Markdown
Member

@smz202000 could you sign the CLA

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.

Add support for defaultValue option for puter.ui.showFontPicker in puter app environment

3 participants