Skip to content

feat(iOS): add fontSize and fontFamily to customStyle - #754

Open
kacperzolkiewski wants to merge 3 commits into
@kaceprzolkiewski/feat-custom-style-webfrom
@kacperzolkiewski/feat-custom-style-web-font
Open

feat(iOS): add fontSize and fontFamily to customStyle#754
kacperzolkiewski wants to merge 3 commits into
@kaceprzolkiewski/feat-custom-style-webfrom
@kacperzolkiewski/feat-custom-style-web-font

Conversation

@kacperzolkiewski

@kacperzolkiewski kacperzolkiewski commented Aug 10, 2026

Copy link
Copy Markdown
Collaborator

Summary

Add fontSize and fontFamily to customStyle

Test Plan

Run example app and experiment with applying fontSize and fontFamily colors through the toolbar across different text styles.

Screenshots / Videos

Screen.Recording.2026-08-10.at.11.38.35.mov

Compatibility

OS Implemented
iOS
Android
Web

Checklist

  • E2E tests are passing
  • Required E2E tests have been added (if applicable)

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds iOS support for applying fontSize and fontFamily via the existing customStyle mechanism, wiring the new style properties through the JS API, native style application, and HTML import/export, plus updating the example app and Maestro flows to exercise the feature.

Changes:

  • Extend customStyle (events + setStyle) to include fontSize and fontFamily.
  • Apply and round-trip custom font styling on iOS (native styling + HTML parser/serializer updates).
  • Update example toolbar UI and add Maestro visual flows for custom font verification.

Reviewed changes

Copilot reviewed 15 out of 20 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
src/web/useOnChangeState.ts Adds default fontSize/fontFamily fields to web customStyle state payload.
src/types.ts Extends public TS event and instance types to include fontSize/fontFamily.
src/spec/EnrichedTextInputNativeComponent.ts Updates codegen spec event payloads to carry fontSize/fontFamily.
src/native/EnrichedTextInput.tsx Extends setStyle command payload to send fontSize/fontFamily to native.
ios/styles/CustomStyle.mm Applies font size/family overrides (including typing attrs) while preserving traits.
ios/htmlParser/HtmlParser.mm Serializes/deserializes font-size/font-family within custom-style spans.
ios/EnrichedTextInputView.mm Emits new fields in state/context-menu events and accepts them in setStyle.
ios/customStyleData/CustomStyleData.mm Stores/merges/compares/hashes/copies fontSize/fontFamily in custom style data.
ios/customStyleData/CustomStyleData.h Adds fontSize/fontFamily properties to custom style data model.
apps/example/src/constants/editorConfig.ts Extends default example editor style state with font fields.
apps/example/src/components/Toolbar.tsx Adds font size/family toolbar buttons and picker wiring.
apps/example/src/components/FontSizePickerRow.tsx New example picker row for selecting/clearing font size.
apps/example/src/components/FontFamilyPickerRow.tsx New example picker row for selecting/clearing font family.
.maestro/enrichedText/flows/custom_style_fonts_visual.yaml Adds visual regression flow for HTML-driven custom font styles.
.maestro/enrichedInput/flows/custom_style_fonts_visual.yaml Adds visual regression flow for interactive font size/family styling.
Suppressed comments (1)

ios/customStyleData/CustomStyleData.mm:30

  • An empty fontFamily string is treated as a non-empty custom style (since it’s non-nil), which causes unnecessary styling work and makes it easy for callers to accidentally “set” an empty family. Normalize empty strings to nil when merging.
  id ffVal = dict[@"fontFamily"];
  if (ffVal != nil) {
    self.fontFamily =
        [ffVal isKindOfClass:[NSString class]] ? (NSString *)ffVal : nil;
  }

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread ios/htmlParser/HtmlParser.mm
Comment thread ios/htmlParser/HtmlParser.mm Outdated
Comment thread ios/htmlParser/HtmlParser.mm
Comment thread ios/customStyleData/CustomStyleData.mm
Comment thread src/types.ts
@kacperzolkiewski
kacperzolkiewski marked this pull request as ready for review August 10, 2026 10:42
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