Skip to content

Conversation

@WendellXY
Copy link

I changed the reduce method to sum the width and height of CGSize values instead of leaving the value unchanged. This resolves a UI overlapping issue in CarouselStack when the element view is complex and the initial index is not the default.

Changed the reduce method to sum the width and height of CGSize values instead of leaving the value unchanged. I also updated defaultValue to be a constant. This resolves a UI overlapping issue in CarouselStack.
Copilot AI review requested due to automatic review settings July 21, 2025 18:20
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes the SizePreferenceKey reduce logic to properly accumulate CGSize values instead of ignoring them. The fix addresses a UI overlapping issue in CarouselStack when using complex element views with non-default initial indices.

  • Implements proper size accumulation by summing width and height values in the reduce method
  • Changes defaultValue from var to let for immutability
  • Replaces empty reduce method with meaningful size aggregation logic

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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.

1 participant