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

Fix cross-axis natural measurements #510

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

kyleve
Copy link
Collaborator

@kyleve kyleve commented Oct 16, 2023

This fixes the measurement of cross-axis sizing when providing the .natural size parameter. Concretely, this means that you can now have a horizontally scrolling list that can also correctly measure its height. Before, the height would end up taking up all the size provided to it.

https://square.slack.com/archives/CTJ4UNLHF/p1695414540305019

Checklist

Please do the following before merging:

  • Ensure any public-facing changes are reflected in the changelog. Include them in the Main section.

…rements

* origin/main:
  Update CHANGELOG.md
  Allow other panning to work on other cells while another is open
  Remove `isTouchWithinSwipeActionView`
  Update swipe actions to more closely match iOS behavior
  Update CHANGELOG.md
  Release 13.1.0
  Only return existing view if there is a contained first responder
  Self code review
  Fixed an issue where a crash would occur when applying an external update to list content while a live reorder event was occurring.
  Remove override of performBatchUpdates, it causes warnings for consumers
  Update CHANGELOG.md (#508)
  Revert "Supplementary Tracking Fixes (#433)"
  Revert "Force layout before appear, to avoid animated updates (#505)"
horizontalFill: .natural,
verticalFill: .natural
),
CGSize(width: 900, height: 1000)
)

XCTAssertEqual(
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is the test for this new case. Note the 900 in the returned size. Before, it would be 1000.

@kyleve kyleve changed the title [WIP DNR] Fix cross-axis natural measurements Fix cross-axis natural measurements Dec 8, 2023
@kyleve kyleve requested a review from a team December 8, 2023 17:08
@kyleve kyleve marked this pull request as ready for review December 8, 2023 17:08
@kyleve
Copy link
Collaborator Author

kyleve commented Dec 12, 2023

Still looking for reviews on this!

Comment on lines +188 to +191
precondition(
layoutMode == .caffeinated,
"Listable only supports the `.caffeinated` layout mode in Blueprint."
)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Isn't this still feature flagged? Does this need to occur in this PR?

I think I'd prefer that the switch to only supporting caffeinated layout be in a separate PR that's combined with the work to do so in Market/Register if we can...

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The flag still exists, though in theory its 100% rolled out. I had been hoping maybe we'd be ripping out the old layout mode before this merged, but it looks like that's not happening! I'll add this back in.

Copy link
Collaborator

Choose a reason for hiding this comment

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

OK feel free to ping me on Slack for another review when it's ready!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I also decided to take a swing at removing legacy layout: square/Blueprint#475

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.

2 participants