Skip to content

[ASDisplayNode] Force a layout pass on a visible node as soon as it enters preload state#779

Merged
nguyenhuy merged 1 commit into
TextureGroup:masterfrom
nguyenhuy:HNRevert751
Jan 31, 2018
Merged

[ASDisplayNode] Force a layout pass on a visible node as soon as it enters preload state#779
nguyenhuy merged 1 commit into
TextureGroup:masterfrom
nguyenhuy:HNRevert751

Conversation

@nguyenhuy

@nguyenhuy nguyenhuy commented Jan 31, 2018

Copy link
Copy Markdown
Member

This reverts #751 (commit 2e98588).

The reason we can't wait for the coming CA's layout pass is that cell node visibility events occur before the pass, at which time the cell's subnodes don't have correct frames for impression tracking.

The root cause of this problem is that, right now, cell node visible states are set by ASRangeController well before the layout pass of the hosting collection/table view. That means we're "jumping the gun". The more I think about this, the more I agree with @Adlai-Holler that we need to treat visible state differently. That is, a node should only be visible (and thus get visibility events) after it's fully loaded, it's view/layer attached to the hierarchy and laid out by a CA transaction. In other words, at the end of the CA layout pass. Such change needs time and effort to be thoroughly reviewed and tested. Until then, let's roll with this fix.

@Adlai-Holler Adlai-Holler left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Always sucks to revert but this lets us move forward with a bigger fix rather than messing with product code. 👍

@nguyenhuy
nguyenhuy merged commit ea54727 into TextureGroup:master Jan 31, 2018
@nguyenhuy
nguyenhuy deleted the HNRevert751 branch January 31, 2018 15:35
Adlai-Holler pushed a commit that referenced this pull request Jan 31, 2018
…nters preload state (#779)

This reverts commit 2e98588 (#751).

The reason we can't wait for the coming CA's layout pass is that cell node visibility events occur before the pass, at which time the cell's subnodes don't have correct frames for impression tracking.

The root cause of this problem is that, right now, cell node visible states are set by ASRangeController well before the layout pass of the hosting collection/table view. That means we're "jumping the gun". The more I think about this, the more I agree with @Adlai-Holler that we need to treat visible state differently. That is, a node should only be visible (and thus get visibility events) after it's fully loaded, it's view/layer attached to the hierarchy and laid out by a CA transaction. In other words, at the end of the CA layout pass. Such change needs time and effort to be thoroughly reviewed and tested. Until then, let's roll with this fix.
bernieperez pushed a commit to AtomTickets/Texture that referenced this pull request Apr 25, 2018
…nters preload state (TextureGroup#779)

This reverts commit 2e98588 (TextureGroup#751).

The reason we can't wait for the coming CA's layout pass is that cell node visibility events occur before the pass, at which time the cell's subnodes don't have correct frames for impression tracking.

The root cause of this problem is that, right now, cell node visible states are set by ASRangeController well before the layout pass of the hosting collection/table view. That means we're "jumping the gun". The more I think about this, the more I agree with @Adlai-Holler that we need to treat visible state differently. That is, a node should only be visible (and thus get visibility events) after it's fully loaded, it's view/layer attached to the hierarchy and laid out by a CA transaction. In other words, at the end of the CA layout pass. Such change needs time and effort to be thoroughly reviewed and tested. Until then, let's roll with this fix.
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