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-1915] Fix Content Hugging and Compression in PledgeDisclaimerView.iconImageView #2211

Merged

Conversation

jovaniks
Copy link
Contributor

@jovaniks jovaniks commented Dec 3, 2024

📲 What

Fixes alignment issues for the iconImageView in PledgeDisclaimerView by setting appropriate content hugging and compression resistance priorities.

🤔 Why

The iconImageView displayed inconsistent alignment on the checkout screen due to:

Variations in the "Kickstarter is not a store" text content.
Differences in the checkout screen components rendered.
Changes in the os language, which altered text length based on translations.
This fix ensures consistent alignment of the iconImageView across all scenarios.

🛠 How

Updated constraints for the iconImageView in setupConstraints:

private func setupConstraints() {
   self.iconImageView.setContentHuggingPriority(.required, for: .horizontal)
   self.iconImageView.setContentCompressionResistancePriority(.required, for: .horizontal)
}

Ensures that the iconImageView maintains its alignment regardless of the text length, screen components, or system language.

👀 See

  • Jira
  • See snapshots included in this PR
Before 🐛 After 🦋
Simulator Screenshot - iPhone SE (3rd generation) - 2024-12-04 at 09 20 03 Simulator Screenshot - iPhone SE (3rd generation) - 2024-12-04 at 09 10 54
Simulator Screenshot - iPhone SE (3rd generation) - 2024-12-04 at 08 50 27 Simulator Screenshot - iPhone SE (3rd generation) - 2024-12-04 at 08 52 43
Simulator Screenshot - iPhone SE (3rd generation) - 2024-12-04 at 09 00 00 Simulator Screenshot - iPhone SE (3rd generation) - 2024-12-04 at 08 57 58
Simulator Screenshot - iPhone SE (3rd generation) - 2024-12-04 at 09 03 41 Simulator Screenshot - iPhone SE (3rd generation) - 2024-12-04 at 09 07 57

✅ Acceptance criteria

  • Steps to test:
    1. Navigate to the checkout screen.
    2. Observe iconImageView alignment with various text content lengths and components.
    3. Test alignment in different system languages.
  • Issues to watch:
    • Confirm alignment under edge cases with mixed components.

…View` in `PledgeDisclaimerView` to resolve alignment issues on checkout screens.
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 PR removes unused snapshot files, such as {Test}_OptimizelyExperimentVariant1Enabled.{lang_device}.png.

@jovaniks jovaniks changed the title Fix Content Hugging and Compression in PledgeDisclaimerView.iconImageView [MBL-1915] Fix Content Hugging and Compression in PledgeDisclaimerView.iconImageView Dec 4, 2024
Copy link
Contributor

@ifosli ifosli left a comment

Choose a reason for hiding this comment

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

Nice!

@jovaniks jovaniks merged commit 4434c97 into main Dec 16, 2024
5 checks passed
@jovaniks jovaniks deleted the jluna/MBL-1915/fix-pledge-disclaimer-view-icon-constraints branch December 16, 2024 20:50
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.

3 participants