Skip to content

[MBL-3151] Update profile page to support dynamic type#2817

Merged
ifosli merged 6 commits into
mainfrom
ifosli/dynamicTypeInProfile
Apr 6, 2026
Merged

[MBL-3151] Update profile page to support dynamic type#2817
ifosli merged 6 commits into
mainfrom
ifosli/dynamicTypeInProfile

Conversation

@ifosli

@ifosli ifosli commented Mar 26, 2026

Copy link
Copy Markdown
Contributor

📲 What

Update profile page to support dynamic type, primarily by deleting the BackerDashboardProjectCell storyboard and redoing the layout logic using autolayout. I'm also updating the backer dashboard view controller tests to use the new helpers, in order to easily test dynamic type behavior.

🛠 How

I considered trying to match the current UI perfectly (take a look at just commit 1 to see for yourself; I updated BackerDashboard tests as part of this commit so you can see the slight differences) but I swift does something with the layout logic that means that if I perfectly match the border of a cell to the previous version, the spacing of the next cell is off.

Instead, I intentionally updated the spacing in the cell to fit in our Spacing units. See commit 2 for these changes (or look at both 1 and 2 together), if you want to see the BackerDashboard screenshot differences before I updated the tests and deleted old screenshots).

For the largest font sizes, the choices I made to let the cell grow were: keep the image relative to the top of the cell, and keep the metadata label relative to the bottom of the cell. This generally lets the user see both (except when project titles are really short and don't force the cell to expand). I also decided to let the metadata label use multiple lines instead of truncating; we're not wordbreaking in any kind of smart way, but I still think that's more helpful. Happy to revisit any of these decisions if other people have opinions, though!

👀 See

Jira

Before 🐛 After 🦋
image image
image image
image image
image image

✅ Acceptance criteria

  • Cells look mostly the same for normal font sizes
  • The backer dashboard is functional for accessibility large sizes

@ifosli ifosli self-assigned this Mar 26, 2026
)
self.animateToFilledHeart()
}
self.titleLabel.numberOfLines = 0

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I wasn't originally planning to update the empty state, but when I saw the tests were still using the old combos I figured it was about time. This was the only change needed to make the empty state look good.

constant: -Spacing.unit_02
),
self.savedIconImageView.heightAnchor.constraint(equalToConstant: 17),
self.savedIconImageView.widthAnchor.constraint(equalToConstant: 17)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The image/icon sizes here are pulled straight from the storyboard

left: Styles.grid(2),
bottom: Styles.grid(1),
right: Styles.grid(2)
)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I converted these to constraints instead, so I could anchor subviews directly to the container view instead of needing to anchor to layout margins

|> UIView.lens.layer.borderWidth .~ 1.0

_ = self.metadataStackView
|> UIStackView.lens.layoutMargins .~ .init(topBottom: Styles.grid(30), leftRight: Styles.grid(20))

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

As far as I could tell, this one was ignored

@ifosli ifosli marked this pull request as ready for review March 26, 2026 22:03
@ifosli ifosli requested review from a team and stevestreza-ksr and removed request for a team March 26, 2026 22:04

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.

Hooray! 🎉


public enum Nib: String {
case BackerDashboardEmptyStateCell
case BackerDashboardProjectCell

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.

🎉

@stevestreza-ksr stevestreza-ksr 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.

This is great, nice job!

It would be nice to pull the constants out to a struct or style object, but that's up to you.

@ifosli ifosli merged commit 7a44ea1 into main Apr 6, 2026
7 checks passed
@ifosli ifosli deleted the ifosli/dynamicTypeInProfile branch April 6, 2026 21:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants