-
Notifications
You must be signed in to change notification settings - Fork 24.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Add iOS Paper implementation of inset logical properties #36241
feat: Add iOS Paper implementation of inset logical properties #36241
Conversation
Base commit: 9718c17 |
Yeah, I think that is the main extra thing we need to merge this. Just ensuring that We are allowed to have a sequence that looks like:
There, we should evaluate a top position of "5" at steps 1 and 2, then "10" at step 3. So if we clear out one prop, the state for the other one still needs to be around. The way I solved this in the Fabric case was that we always had the full set of props available to read from (this is already Fabric's prop parsing model), then we generated the flattened YGStyle after parsing everything. The model for how prop parsing works on paper is different, but I imagine we might need the state for both potential props around, to do this sort of thing. |
f3ce6da
to
474b0ca
Compare
Thanks for the review @NickGerleman, I managed to fix the precedence problem by adding a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, that looks correct. Were you able to validate it against the scenario?
@NickGerleman has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
Yeah, from my testing everything is working as expected |
@NickGerleman merged this pull request in 33d4e2d. |
Hey @gabrieldonadel, we had to revert this change since it caused a few screenshot test failures that seem legitimate. I think this example is setting position via |
…ies" Summary: This backs out #36241 for causing screenshot failures in an app still using Paper. Changelog: [iOS][Removed] - Back out "[react-native][PR] feat: Add iOS Paper implementation of inset logical properties" Reviewed By: motiz88, rshest Differential Revision: D43621612 fbshipit-source-id: 0fc01d6c6ae5c5bfb2813bd60b25e9315e42e3c3
Hey @NickGerleman, do you mind sharing some more details about this screenshot test? Which combination of props were you using? Setting positions using |
It looks like |
Hmm, not sure why that would happen, maybe we're not computing the position on the first pass somehow? |
Let me see if I can get a small repro of the issue out so we can debug and also see if the Android version suffers the same issue |
@gabrieldonadel I can reproduce on Paper with this:
|
Sorry for the delay on this, I'll take a look this week*! |
Hey @gabrieldonadel do you have a status update on this? |
Hi @lunaleaps unfortunately I was still not able to reproduce this issue, are you testing it through RNTester? |
Yes, essentially the same as RNTester, it's an empty surface. You're not able to reproduce on the legacy renderer? |
Yes @lunaleaps, I'm trying to reproduce this inside the View Example of RNTester running Paper Screen.Recording.2023-03-21.at.07.35.14.mov |
Any thoughts on how can I reproduce this @lunaleaps using RNTester? |
Hey @gabrieldonadel sorry for the delay, I just tested it on the 0.72 release, picking this commit and I was able to reproduce in RNTester Here's the repro code lunaleaps@29c081b |
…ook#36241) Summary: This PR adds Paper support to `inset` logical properties on iOS as requested on facebook#34425. This implementation includes the addition of the following style properties - `inset`, equivalent to `top`, `bottom`, `right` and `left`. - `insetBlock`, equivalent to `top` and `bottom`. - `insetBlockEnd`, equivalent to `bottom`. - `insetBlockStart`, equivalent to `top`. - `insetInline`, equivalent to `right` and `left`. - `insetInlineEnd`, equivalent to `right` or `left`. - `insetInlineStart`, equivalent to `right` or `left`. Android changes are in a separate PR to facilitate code review facebook#36242 ## Changelog [IOS] [ADDED] - Add Paper implementation of inset logical properties Pull Request resolved: facebook#36241 Test Plan: 1. Open the RNTester app and navigate to the `View` page 2. Test the new style properties through the `Insets` section ![image](https://user-images.githubusercontent.com/11707729/220512607-a1d89dbe-64db-4140-9fdb-f9d7897fe3bd.png) Reviewed By: lunaleaps Differential Revision: D43525110 Pulled By: NickGerleman fbshipit-source-id: b70b0ef183dcf192b2c3547422bbe161b7bdba50
…ook#36241) Summary: This PR adds Paper support to `inset` logical properties on iOS as requested on facebook#34425. This implementation includes the addition of the following style properties - `inset`, equivalent to `top`, `bottom`, `right` and `left`. - `insetBlock`, equivalent to `top` and `bottom`. - `insetBlockEnd`, equivalent to `bottom`. - `insetBlockStart`, equivalent to `top`. - `insetInline`, equivalent to `right` and `left`. - `insetInlineEnd`, equivalent to `right` or `left`. - `insetInlineStart`, equivalent to `right` or `left`. Android changes are in a separate PR to facilitate code review facebook#36242 ## Changelog [IOS] [ADDED] - Add Paper implementation of inset logical properties Pull Request resolved: facebook#36241 Test Plan: 1. Open the RNTester app and navigate to the `View` page 2. Test the new style properties through the `Insets` section ![image](https://user-images.githubusercontent.com/11707729/220512607-a1d89dbe-64db-4140-9fdb-f9d7897fe3bd.png) Reviewed By: lunaleaps Differential Revision: D43525110 Pulled By: NickGerleman fbshipit-source-id: b70b0ef183dcf192b2c3547422bbe161b7bdba50
…ies" Summary: This backs out facebook#36241 for causing screenshot failures in an app still using Paper. Changelog: [iOS][Removed] - Back out "[react-native][PR] feat: Add iOS Paper implementation of inset logical properties" Reviewed By: motiz88, rshest Differential Revision: D43621612 fbshipit-source-id: 0fc01d6c6ae5c5bfb2813bd60b25e9315e42e3c3
Summary
This PR adds Paper support to
inset
logical properties on iOS as requested on #34425. This implementation includes the addition of the following style propertiesinset
, equivalent totop
,bottom
,right
andleft
.insetBlock
, equivalent totop
andbottom
.insetBlockEnd
, equivalent tobottom
.insetBlockStart
, equivalent totop
.insetInline
, equivalent toright
andleft
.insetInlineEnd
, equivalent toright
orleft
.insetInlineStart
, equivalent toright
orleft
.Android changes are in a separate PR to facilitate code review #36242
Changelog
[IOS] [ADDED] - Add Paper implementation of inset logical properties
Test Plan
View
pageInsets
section