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

Financial Connections: adjusted typography and spacing for Institution Picker #2543

Merged
merged 7 commits into from
May 10, 2023

Conversation

kgaidis-stripe
Copy link
Contributor

@kgaidis-stripe kgaidis-stripe commented May 5, 2023

Summary

^ see title, and I am leaving various comments in this PR to explain specific parts

Design and font references:

https://www.figma.com/file/ikSIQS9Lw0qIr3PSeyyrPP/Connections-V2.5?type=design&node-id=1636-89037&mode=design&t=vw8IsvjVsgHt67RL-0
https://sail.stripe.me/foundations/typography/
https://www.figma.com/file/WAFvoybps5uk3FL4tftaee/Sail?type=design&node-id=26-370&mode=design&t=Hd2oiFSiURfCMlmn-0

Testing

UILabel font adjustment to be centered

Before After
before_UILabel_witH_attributes after_AttributedLabel

UITextView font adjustment to be centered

Before After
before_TextView after_TextView

Various Screens That Were Adjusted Due To The Changes

Simulator Screen Shot - iPhone 14 Pro - 2023-05-09 at 16 32 49
Simulator Screen Shot - iPhone 14 Pro - 2023-05-09 at 16 33 13

Simulator Screen Shot - iPhone 14 Pro - 2023-05-09 at 16 31 56
Simulator Screen Shot - iPhone 14 Pro - 2023-05-09 at 16 32 18
Simulator Screen Shot - iPhone 14 Pro - 2023-05-09 at 16 32 26
Simulator Screen Shot - iPhone 14 Pro - 2023-05-09 at 16 32 39

@@ -1,156 +0,0 @@
//
// InstitutionSearchErrorView.swift
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was dead code - you should see no references to this anywhere but here

Comment on lines +27 to +28
// UILabel with custom `lineHeight` via `NSParagraphStyle` was not properly
// centering the text, so here we adjust it to be centered.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this explains why I introduced AttributedLabel...the test plan shows the difference too

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Well this comment + the fact that ClickableLabelNew (now AttributedTextView) does not support single line text (at least easily)

@@ -11,7 +11,10 @@ import SafariServices
@_spi(STP) import StripeUICore
import UIKit

final class ClickableLabelNew: HitTestView {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Renamed because ClickableLabelNew made me confused: I tried to use it as a UILabel replacement, but UITextView is multi-line, so its not a direct replacement. AttributedTextView also matches with its 'similar' AttributedLabel.

@kgaidis-stripe kgaidis-stripe marked this pull request as ready for review May 9, 2023 20:40
@kgaidis-stripe kgaidis-stripe requested review from a team as code owners May 9, 2023 20:40
Comment on lines +188 to +189
// UITextView with custom `lineHeight` via `NSParagraphStyle` was not properly
// centering the text, so here we adjust it to be centered.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

test plan shows the difference of what this centering-logic achieved

Copy link
Contributor

@vardges-stripe vardges-stripe left a comment

Choose a reason for hiding this comment

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

👌

let paragraphStyleLineHeight = paragraphStyle.minimumLineHeight
assert(paragraphStyle.minimumLineHeight == paragraphStyle.maximumLineHeight, "we are assuming that minimum and maximum are the same")

if paragraphStyleLineHeight > uiFontLineHeight {
Copy link
Contributor

Choose a reason for hiding this comment

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

Neat

@kgaidis-stripe kgaidis-stripe merged commit 0582228 into fc-fontspacing May 10, 2023
15 checks passed
@kgaidis-stripe kgaidis-stripe deleted the kg-fontinstitution branch May 10, 2023 13:50
kgaidis-stripe added a commit that referenced this pull request May 15, 2023
…n Picker (#2543)

* Financial Connections: adjusted fonts for Institution Picker.

* Financial Connections: adjusted fonts for prepane.

* Financial Connections: created AttributedLabel and renamed ClickableLabelNew to AttributedTextView.

* Financial Connections: modified AttributedTextView to support better vertical spacing and fixed more institution references to use the new font infra.

* Financial Connections: modified AttributedLabel and AttributedTextView to be more robust.

* Financial Connections: changed FeaturedInstitutionGridCell font to use new font infra.

* Financial Connections: small font fix.
kgaidis-stripe added a commit that referenced this pull request May 17, 2023
…n Picker (#2543)

* Financial Connections: adjusted fonts for Institution Picker.

* Financial Connections: adjusted fonts for prepane.

* Financial Connections: created AttributedLabel and renamed ClickableLabelNew to AttributedTextView.

* Financial Connections: modified AttributedTextView to support better vertical spacing and fixed more institution references to use the new font infra.

* Financial Connections: modified AttributedLabel and AttributedTextView to be more robust.

* Financial Connections: changed FeaturedInstitutionGridCell font to use new font infra.

* Financial Connections: small font fix.
kgaidis-stripe added a commit that referenced this pull request May 23, 2023
* Financial Connections: introduced FinancialConnectionsFont and ClickableLabelNew to support line spacing.

* Financial Connections: modified the consent bottom sheet fonts/spacing.

* Financial Connections: adjusted typography and spacing for Institution Picker (#2543)

* Financial Connections: adjusted fonts for Institution Picker.

* Financial Connections: adjusted fonts for prepane.

* Financial Connections: created AttributedLabel and renamed ClickableLabelNew to AttributedTextView.

* Financial Connections: modified AttributedTextView to support better vertical spacing and fixed more institution references to use the new font infra.

* Financial Connections: modified AttributedLabel and AttributedTextView to be more robust.

* Financial Connections: changed FeaturedInstitutionGridCell font to use new font infra.

* Financial Connections: small font fix.

* Financial Connections: changed account picker typography.

* Financial Connections: changed Networking Account Picker typography.

* Financial Connections: changed success pane typography

* Financial Connections: changed networking sign up pane typography.

* Financial Connections: modified warmup pane typography.

* Financial Connections: changed the typography in networking verification panes.

* Financial Connections: more changes to adopt to new typography.

* Financial Connections: fixed search bar spacing for testmode.

* Financial Connections: fixed unit tests having old font references.
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.

None yet

2 participants