refactor createWorkspace to use isSelfTourViewed from useOnyx#80979
refactor createWorkspace to use isSelfTourViewed from useOnyx#80979tgolen merged 15 commits intoExpensify:mainfrom
Conversation
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
|
@DylanDylann Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
|
@DylanDylann can you please review this PR? |
JmillsExpensify
left a comment
There was a problem hiding this comment.
Product review not required.
|
@dukenv0307 Please check this: #80979 (comment) |
|
All tests passed on my end, will try to merge main soon cc @DylanDylann |
|
@DylanDylann Kindly bump |
| onboardingPurposeSelected?: OnboardingPurpose; | ||
| shouldAddGuideWelcomeMessage?: boolean; | ||
| shouldCreateControlPolicy?: boolean; | ||
| // TODO: Make it required once we complete refactoring the buildPolicyData function to use isSelfTourViewed |
There was a problem hiding this comment.
Please link the issue where this will be addressed
| type CreateWorkspaceDataOptions = Omit<BuildPolicyDataOptions, 'isSelfTourViewed'> & { | ||
| isSelfTourViewed: boolean; |
There was a problem hiding this comment.
Why do we need to remove isSelfTourViewed and add it again?
There was a problem hiding this comment.
If this is just a temporary change to enforce that isSelfTourViewed always exists, please add a TODO comment to remove this type later
Reviewer Checklist
Screenshots/VideosScreen.Recording.2026-02-16.at.17.36.36.mov |
|
@dukenv0307 Some minor comments. The rest looks fine to me |
|
@DylanDylann I updated |
|
|
@DylanDylann Done |
|
We did not find an internal engineer to review this PR, trying to assign a random engineer to #66424 as well as to this PR... Please reach out for help on Slack if no one gets assigned! |
|
cc @tgolen |
|
@dukenv0307 Can you please fix the conflicts, then I'll review. |
|
@tgolen I resolved the conflicts |
| const [initialLastUpdateIDAppliedToClient] = useOnyx(ONYXKEYS.ONYX_UPDATES_LAST_UPDATE_ID_APPLIED_TO_CLIENT); | ||
| const [modal] = useOnyx(ONYXKEYS.MODAL); | ||
| const [activePolicyID] = useOnyx(ONYXKEYS.NVP_ACTIVE_POLICY_ID); | ||
| const [isSelfTourViewed = false] = useOnyx(ONYXKEYS.NVP_ONBOARDING, {selector: hasSeenTourSelector}); |
There was a problem hiding this comment.
I think having a default here is a slight anti-pattern (as you can see, not very many of the hooks being used will have a default value configured). What we typically do is let Onyx return whatever it will (which can be undefined) and then update the function parameters using the data to allow | undefined and then handle the undefined value inside of the function (where you can default it to false).
The benefit of this pattern is that it makes the function call very safe, and doesn't run the risk of someone forgetting to default the value to false if they add a new instance useOnyx() instance.
Would you mind changing this, please?
There was a problem hiding this comment.
Make sense to me, I updated. Thank you @tgolen
|
We did not find an internal engineer to review this PR, trying to assign a random engineer to #66424 as well as to this PR... Please reach out for help on Slack if no one gets assigned! |
|
🚧 @tgolen has triggered a test Expensify/App build. You can view the workflow run here. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
🚀 Deployed to staging by https://github.com/tgolen in version: 9.3.26-0 🚀
|
|
🚀 Deployed to production by https://github.com/puneetlath in version: 9.3.26-8 🚀
|
Explanation of Change
Fixed Issues
$ #66424
PROPOSAL:
Tests
Offline tests
QA Steps
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
Screen.Recording.2026-01-30.at.08.50.46.mov