Skip to content

Conversation

@yaira2
Copy link
Member

@yaira2 yaira2 commented Apr 8, 2025

@yaira2 yaira2 requested a review from Copilot April 8, 2025 22:19
Copy link
Contributor

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.

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

Comments suppressed due to low confidence (2)

src/Files.App.Controls/AdaptiveGridView/AdaptiveGridView.cs:122

  • Confirm that returning 0 for cases where columns is 0 is the desired behavior for downstream layout calculations; adding a clarifying comment may help future maintainability.
return columns > 0 ? (containerWidth / columns) - itemMargin.Left - itemMargin.Right : 0;

src/Files.App.Controls/AdaptiveGridView/AdaptiveGridView.Properties.cs:155

  • Consider explicitly handling cases where itemWidth is negative by checking for itemWidth <= 0 to strengthen the robustness of the calculation.
var columns = itemWidth > 0 ? (int)Math.Round(containerWidth / itemWidth) : 0;

@yaira2 yaira2 merged commit 87730e3 into main Apr 8, 2025
7 checks passed
@yaira2 yaira2 deleted the ya/DivideByZeroException branch April 8, 2025 22:28
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