Skip to content

Conversation

@Kyle-Ye
Copy link
Collaborator

@Kyle-Ye Kyle-Ye commented Jan 2, 2026

No description provided.

@augmentcode
Copy link

augmentcode bot commented Jan 2, 2026

🤖 Augment PR Summary

Summary: Adds a direct notification API to emit geometry observer callbacks once measurements transition into a pending state.

Changes:

  • Introduced `ViewGraphGeometryObservers.notify()` to invoke stored callbacks for pending size changes and commit the pending size as the new stable value.
  • Updated the geometry observers test suite to validate callback invocation and old/new size values.
  • Added a `TestMeasurer.mockValue` override so tests can deterministically force measurement changes across successive `needsUpdate(graph:)` calls.

Technical Notes: The test triggers a size change via needsUpdate, then calls notify() to flush the pending change into the observer callback path.

🤖 Was this summary useful? React with 👍 or 👎

Copy link

@augmentcode augmentcode bot left a comment

Choose a reason for hiding this comment

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

Review completed. 2 suggestions posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

}

// [?]
mutating func notify() {
Copy link

Choose a reason for hiding this comment

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

If notify() is intended to be part of the same package-level API surface as needsUpdate(graph:) / notifySizes(), consider marking it package (it’s currently internal, so other modules in the package can’t call it). If it’s only meant for tests/internal use, this may be fine.

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎

}
let emptyViewGraph = ViewGraph(rootViewType: EmptyView.self)
_ = observers.needsUpdate(graph: emptyViewGraph)
TestMeasurer.mockValue = 30.0
Copy link

Choose a reason for hiding this comment

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

Since TestMeasurer.mockValue is static, consider resetting it (e.g. via defer { TestMeasurer.mockValue = nil }) to avoid state leaking between tests and creating order-dependent behavior.

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎

@codecov
Copy link

codecov bot commented Jan 2, 2026

Codecov Report

❌ Patch coverage is 0% with 11 lines in your changes missing coverage. Please review.
✅ Project coverage is 14.31%. Comparing base (c7cd9cf) to head (e4a295b).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...UICore/View/Graph/ViewGraphGeometryObservers.swift 0.00% 11 Missing ⚠️

❗ There is a different number of reports uploaded between BASE (c7cd9cf) and HEAD (e4a295b). Click for more details.

HEAD has 1 upload less than BASE
Flag BASE (c7cd9cf) HEAD (e4a295b)
2 1
Additional details and impacted files
@@             Coverage Diff             @@
##             main     #699       +/-   ##
===========================================
- Coverage   28.80%   14.31%   -14.50%     
===========================================
  Files         589      563       -26     
  Lines       35794    33167     -2627     
===========================================
- Hits        10312     4748     -5564     
- Misses      25482    28419     +2937     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Kyle-Ye Kyle-Ye force-pushed the feature/geometry_observer branch from 7b8a7fa to e4a295b Compare January 2, 2026 11:02
@Kyle-Ye Kyle-Ye merged commit 4e2a39c into main Jan 2, 2026
5 of 8 checks passed
@Kyle-Ye Kyle-Ye deleted the feature/geometry_observer branch January 2, 2026 11:03
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