Skip to content

MAGE-323: safe zone handling#541

Draft
amber-klaviyo wants to merge 4 commits intofeat/flyouts-formsfrom
MAGE-323
Draft

MAGE-323: safe zone handling#541
amber-klaviyo wants to merge 4 commits intofeat/flyouts-formsfrom
MAGE-323

Conversation

@amber-klaviyo
Copy link
Copy Markdown
Contributor

Description

add safe zone to user provided offsets

Due Diligence

  • I have tested this on a simulator or a physical device.
  • I have added sufficient unit/integration tests of my changes.
  • I have adjusted or added new test cases to team test docs, if applicable.
  • I am confident these changes are compatible with all iOS and XCode versions the SDK currently supports.

Release/Versioning Considerations

  • Patch Contains internal changes or backwards-compatible bug fixes.
  • Minor Contains changes to the public API.
  • Major Contains breaking changes.
  • Contains readme or migration guide changes.
    • If so, please merge to a feature branch so documentation updates only go live upon official release.
  • This is planned work for an upcoming release.
    • If no, author or reviewer should account for this in a release plan, or describe why not below.

Changelog / Code Overview

Test Plan

Related Issues/Tickets

Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 965b8ce. Configure here.

let availableWidth = screenWidth - marginLeft - marginRight
let availableHeight = screenHeight - marginTop - marginBottom
let clampedWidth = min(width, availableWidth)
let clampedHeight = min(height, availableHeight)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Negative dimensions when margins exceed screen size

Medium Severity

availableWidth and availableHeight can become negative when the combined safe area insets and user-provided margins exceed the screen dimensions. Since clampedWidth and clampedHeight are computed via min(width, availableWidth), they inherit this negative value, resulting in a CGRect with negative dimensions. This could happen on smaller devices in landscape (where safe area left/right insets are significant) or with large user-configured margins. The values need to be floored at zero.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 965b8ce. Configure here.

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