Skip to content

Fix SizePreferenceKey reduce logic - #85

Open
WendellXY wants to merge 2 commits into
dscyrescotti:mainfrom
WendellXY:fix/size_preference_key_reduce_logic
Open

Fix SizePreferenceKey reduce logic#85
WendellXY wants to merge 2 commits into
dscyrescotti:mainfrom
WendellXY:fix/size_preference_key_reduce_logic

Conversation

@WendellXY

Copy link
Copy Markdown

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

Copilot AI left a comment

Copy link
Copy Markdown

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

Comment thread Sources/Utils/PreferenceKeys/SizePreferenceKey.swift Outdated
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.

2 participants