Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Native Editor - Input view design + icon work #4729

Merged
merged 15 commits into from Jan 30, 2024

Conversation

tonisevener
Copy link
Collaborator

Phabricator:
https://phabricator.wikimedia.org/T344508

Notes

This wraps up the task with finalizing the new input view design as requested in this comment. I also did another pass at icons in the toolbars, find and replace, and navigation bar to improve dynamic type support.

Test Steps

  1. Open an article editor on Staging. Do light regression testing on buttons.
  2. Tap the new text format icon to show the new input view. Do light regression testing on buttons.
  3. Tap the reading themes navigation button. Do light regression testing on controls.
  4. Confirm theming works on buttons and new input view (note there may be further tweaks on colors once this goes through design review).
  5. Change dynamic type. Confirm toolbar buttons, navigation bar buttons and new input view buttons expand or shrink as needed.

- plus minor font rename
- subheadline more closely matches design config default icon sizing of 16px
- Uses UIButton.Configuration for styling buttons
- Allows SFSymbols to scale up as needed
- Using WKEditorHeaderSelectButton and WKEditorHeaderSelectScrollView for header selection
- Using WKEditorMultiButton for other formatting options
- Tweak input view title font size and make close button palette style.
 - add top spacing
- Allow theme button text to grow with dynamic type
image = UIImage(systemName: "plus.circle.fill", withConfiguration: configuration)
}

image = image?.withRenderingMode(.alwaysTemplate)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Was the idea to use the renderingMode method argument here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@mazevedofs Good catch! Originally I thought I might need to be able to pass different rendering modes to support both palette and monochrome icons, but it turns out .alwaysTemplate worked for both. I forgot to remove the parameter after that. I'll add that cleanup to my next PR.


let buttonConfig = createButtonConfig(image: image)
button.configuration = buttonConfig
button.configurationUpdateHandler = buttonConfigurationUpdateHandler(button:)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Cool! I didn't know about this!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@mazevedofs yep, it's the newer style of button configuration for UIKit. I can't remember if this was required for this particular button, but I needed it to add padding to the buttons in WKEditorMultiButton without triggering project warnings. We'll need to use a similar approach in WKSmallMenuButton to remove those warnings.

Copy link
Collaborator

@mazevedofs mazevedofs left a comment

Choose a reason for hiding this comment

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

Looking great! (the comment I left is a minor detail so I'm merging it)

@mazevedofs mazevedofs merged commit c9d3461 into main Jan 30, 2024
4 checks passed
@mazevedofs mazevedofs deleted the native-editor-input-views branch January 30, 2024 18:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants