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

MBL-1374: Handle long add-on names on late pledge confirmation page #2055

Merged

Conversation

amy-at-kickstarter
Copy link
Contributor

@amy-at-kickstarter amy-at-kickstarter commented May 8, 2024

📲 What

In the summary view for late pledge confirmation,

  • Fix missing price information when the title ran over
  • Fix multi-line title tables
  • Clean up some Prelude

🤔 Why

Long add-on names would break the summary view:

👀 See

Here's the same project, fixed:
Screenshot 2024-05-08 at 3 04 05 PM

Here's an example of it working, with a very long hard-coded string:
Screenshot 2024-05-08 at 2 20 28 PM

As well as working with the largest font size:
Screenshot 2024-05-08 at 2 23 28 PM

override func viewWillLayoutSubviews() {
super.viewWillLayoutSubviews()

self.tableViewContainerHeightConstraint?.constant = self.tableView.intrinsicContentSize.height
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 constraint needed to be updated; otherwise it squashes the table.

}

private func rootStackViewStyle(_ isAccessibilityCategory: Bool) -> (StackViewStyle) {
let alignment: UIStackView.Alignment = (isAccessibilityCategory ? .center : .top)
let axis: NSLayoutConstraint.Axis = (isAccessibilityCategory ? .vertical : .horizontal)
let distribution: UIStackView.Distribution = (isAccessibilityCategory ? .equalSpacing : .fill)
let distribution: UIStackView.Distribution = (isAccessibilityCategory ? .equalSpacing : .fillProportionally)
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 is the only behavioral change in this function; the rest is just making the Prelude-y bits less Prelude-y. (Which had the benefit of fixing a warning about type check taking 2000 ms!)

override func layoutSubviews() {
super.layoutSubviews()
self.titleLabel.preferredMaxLayoutWidth = self.titleLabel.frame.size.width
super.layoutSubviews()
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ugly little hack to make multi-line labels work properly in automatically sized cells.

@amy-at-kickstarter amy-at-kickstarter marked this pull request as ready for review May 8, 2024 18:35
@amy-at-kickstarter amy-at-kickstarter force-pushed the bug/adyer/MBL-1374/late-pledge-titles-overflow branch from aee4baf to dcfa58c Compare May 8, 2024 18:51
@amy-at-kickstarter amy-at-kickstarter requested review from a team and ifosli and removed request for a team May 8, 2024 19:04
@amy-at-kickstarter amy-at-kickstarter self-assigned this May 8, 2024
@amy-at-kickstarter amy-at-kickstarter merged commit b7175f0 into main May 13, 2024
5 checks passed
@amy-at-kickstarter amy-at-kickstarter deleted the bug/adyer/MBL-1374/late-pledge-titles-overflow branch May 13, 2024 14:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants