-
Notifications
You must be signed in to change notification settings - Fork 583
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(art advisor): enable Milestone 1 #10724
Conversation
describe("conditional rendering of old vs new home screen", () => { | ||
beforeEach(() => { | ||
jest.clearAllMocks() | ||
}) | ||
|
||
describe("when running in beta or simulator", () => { | ||
beforeEach(() => (ArtsyNativeModule.ArtsyNativeModule.isBetaOrDev = true)) |
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.
This test run produces:
conditional rendering of old vs new home screen
when running in beta or simulator
when ARPreferLegacyHomeScreen is false
✅ renders the NEW screen
when ARPreferLegacyHomeScreen is true
✅ renders the old screen
when NOT running in beta or simulator
when ARPreferLegacyHomeScreen is false
✅ renders the old screen
when ARPreferLegacyHomeScreen is true
✅ renders the old screen
This matches the table above: the new screen is shown only when you are running in beta/simulator and the "Prefer legacy home screen" has not been toggled on.
For dev/testing purposes you would just toggle that flag on (cc @brainbicycle)
<LinkText | ||
onPress={() => | ||
Linking.openURL("https://www.notion.so/artsy/e9958451ea9d44c6b357aba6505c0abc") | ||
} | ||
> | ||
See more on how to switch back | ||
</LinkText> |
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.
Need to flesh this page out with the some non-technical instructions.
<LinkText | ||
fontWeight="bold" | ||
onPress={() => | ||
Linking.openURL("https://www.notion.so/artsy/abc1123548504ae58051405627fb6c9f") | ||
} | ||
> | ||
Notion feedback board | ||
</LinkText> |
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.
And feedback board is set up now.
ARUseNewHomeView: { | ||
description: "Use new home view", | ||
ARPreferLegacyHomeScreen: { | ||
description: "Prefer legacy home screen", |
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.
Note that we've replaced the old flag with this new one, with reversed semantics. Now you opt out of the new screen (when running in beta or sim).
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.
By default, ARPreferLegacyHomeScreen
will be falsy, this means that we will be already rendering the new home view for all users which I don't think makes sense now since we have not QA'd the home properly yet and some tracking events are still missing.
const preferLegacyHomeScreen = useFeatureFlag("ARPreferLegacyHomeScreen") | ||
|
||
const shouldDisplayNewHomeView = ArtsyNativeModule.isBetaOrDev && !preferLegacyHomeScreen |
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.
@MounirDhahri regarding your comment, I think this shouldDisplayNewHomeView
condition can only be true in a beta build or simulator, no?
I am assuming that the low-level computation of isBetaOrDev
means strictly that you are either in the simulator or beta, but we should be absolutely certain of that (for iOS as well as Android):
eigen/ios/Artsy/App/ARAppStatus.m
Lines 11 to 38 in 8c5e288
+ (BOOL)isDev; | |
{ | |
#if TARGET_IPHONE_SIMULATOR | |
return YES; | |
#elif DEBUG | |
return YES; | |
#else | |
return NO; | |
#endif | |
} | |
+ (BOOL)isBeta; | |
{ | |
static BOOL isBeta = NO; | |
static dispatch_once_t onceToken = 0; | |
dispatch_once(&onceToken, ^{ | |
NSURL *receiptURL = [[NSBundle mainBundle] appStoreReceiptURL]; | |
NSString *receiptURLString = [receiptURL path]; | |
isBeta = [receiptURLString rangeOfString:@"sandboxReceipt"].location != NSNotFound; | |
}); | |
return isBeta; | |
} | |
+ (BOOL)isBetaOrDev; | |
{ | |
return [self isDev] || [self isBeta]; | |
} |
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.
We rely on this to default to staging in betas and prod in app and play store, so if it is not working we are in trouble 😅. It works
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.
👏
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.
🙌
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.
Awesome 💯
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.
LGTM - thanks! I got it now 😄
b25a41c
Cool, thanks for all the 👀 As discussed in Onyx planning today — the last change I'll smuggle into this PR is to change the initial fetch from 5 sections to 10, to make that spinner a little less obtrusive. (b25a41c) (UPDATE: rebasing |
b25a41c
to
f719b2e
Compare
Also inlines the Notion feedback board link.
f719b2e
to
be597a9
Compare
This PR resolves ONYX-1267
Description
Implements the following logic to determine when to serve the new home view:
ARPreferLegacyHomeScreen
) to revert to the legacy home screen for dev/testing/QAOr, in truth table form:
In addition the new info button presents some helpful links for reporting issues related to the new home screen, or reverting back to the old one.
m1.out.mov
PR Checklist
To the reviewers 👀
Changelog updates
Changelog updates
Cross-platform user-facing changes
iOS user-facing changes
Android user-facing changes
Dev changes
Need help with something? Have a look at our docs, or get in touch with us.