-
Notifications
You must be signed in to change notification settings - Fork 3.9k
[Home Page] Add a simple onboarding slot to Home, focused on "manage my team" intent #86663
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
Merged
mountiny
merged 21 commits into
Expensify:main
from
software-mansion-labs:@adamgrzybowski/onboarding-home
Apr 10, 2026
Merged
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
29e2993
Add tests
adamgrzybowski 86257b0
Add Getting Started onboarding checklist to Home page
adamgrzybowski 4a806bd
Simplify control flow in hasNonDefaultRules
adamgrzybowski 1875f8b
Remove unnecessary useCallback from GettingStartedRow
adamgrzybowski 3703841
Replace magic numbers with consts in GettingStartedRow
adamgrzybowski 7548620
Add explanatory comments to eslint-disable directives in useGettingSt…
adamgrzybowski 7622ea8
Fix isWithinGettingStartedPeriod to reject future trial dates
adamgrzybowski 547cc92
Fix create-workspace route assertions to use WORKSPACE_OVERVIEW
adamgrzybowski 6bab2b8
Add gettingStartedSection translations and format suggestionsAvailable
adamgrzybowski 9405144
Add Sentry label to GettingStartedRow pressable
adamgrzybowski dff7ec9
Remove default ID values from useOnyx collection keys
adamgrzybowski d75f4a7
Fix hasNonDefaultRules to detect customRules without rules object and…
adamgrzybowski b3869c4
Merge branch 'main' into @adamgrzybowski/onboarding-home
adamgrzybowski 5297e87
Add policy guards and company card feed detection to Getting Started …
adamgrzybowski 218be28
Merge branch 'main' into @adamgrzybowski/onboarding-home
adamgrzybowski 72ec6af
Reuse getCompanyFeeds in hasCompanyCardFeeds to remove duplicated fil…
adamgrzybowski a886a1f
Revert accidental changes
adamgrzybowski 4bb453f
Fix GettingStartedSection tests by adding policy type to mock data
adamgrzybowski a7c1262
Navigate to WorkspaceInitialPage on narrow layout in GettingStartedSe…
WojtekBoman 11184c8
Enable feature and navigate directly when checklist item is disabled
WojtekBoman 1d8ae1c
Fix navigating on create workspace button and adjust jest tests
WojtekBoman File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -73,7 +73,7 @@ | |
|
|
||
| let allPolicies: OnyxCollection<Policy>; | ||
|
|
||
| Onyx.connect({ | ||
| key: ONYXKEYS.COLLECTION.POLICY, | ||
| waitForCollectionCallback: true, | ||
| callback: (value) => (allPolicies = value), | ||
|
|
@@ -687,6 +687,25 @@ | |
| return Object.values(policyCategories).some((category) => category && category.pendingAction !== CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE && !defaultCategoryNames.has(category.name)); | ||
| } | ||
|
|
||
| /** | ||
| * Checks if a policy has any non-default rules configured. | ||
| * Defaults are: no approval/expense/coding rules and no custom rules text. | ||
| */ | ||
| function hasNonDefaultRules(policy: OnyxEntry<Policy>): boolean { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you add unit test for this? |
||
| if (!policy) { | ||
| return false; | ||
| } | ||
|
|
||
| const hasCustomRules = !!policy.customRules && policy.customRules.trim().length > 0; | ||
|
|
||
| const {rules} = policy; | ||
| const hasApprovalRules = !!rules?.approvalRules && rules.approvalRules.length > 0; | ||
| const hasExpenseRules = !!rules?.expenseRules && rules.expenseRules.length > 0; | ||
| const hasCodingRules = !!rules?.codingRules && Object.keys(rules.codingRules).length > 0; | ||
|
|
||
| return hasCustomRules || hasApprovalRules || hasExpenseRules || hasCodingRules; | ||
|
Comment on lines
+699
to
+706
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. super minor thing, but you could return early for the |
||
| } | ||
|
|
||
| /** | ||
| * Gets a tag list of a policy by a tag index | ||
| */ | ||
|
|
@@ -2074,6 +2093,7 @@ | |
| getTagLists, | ||
| hasTags, | ||
| hasCustomCategories, | ||
| hasNonDefaultRules, | ||
| getTaxByID, | ||
| getUnitRateValue, | ||
| getRateDisplayValue, | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
79 changes: 79 additions & 0 deletions
79
src/pages/home/GettingStartedSection/GettingStartedRow.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,79 @@ | ||
| import React from 'react'; | ||
| import {View} from 'react-native'; | ||
| import Checkbox from '@components/Checkbox'; | ||
| import Icon from '@components/Icon'; | ||
| import {PressableWithoutFeedback} from '@components/Pressable'; | ||
| import Text from '@components/Text'; | ||
| import {useMemoizedLazyExpensifyIcons} from '@hooks/useLazyAsset'; | ||
| import useResponsiveLayout from '@hooks/useResponsiveLayout'; | ||
| import useStyleUtils from '@hooks/useStyleUtils'; | ||
| import useTheme from '@hooks/useTheme'; | ||
| import useThemeStyles from '@hooks/useThemeStyles'; | ||
| import Navigation from '@libs/Navigation/Navigation'; | ||
| import variables from '@styles/variables'; | ||
| import CONST from '@src/CONST'; | ||
| import type {GettingStartedItem} from './hooks/useGettingStartedItems'; | ||
|
|
||
| type GettingStartedRowProps = { | ||
| item: GettingStartedItem; | ||
| }; | ||
|
|
||
| function GettingStartedRow({item}: GettingStartedRowProps) { | ||
| const styles = useThemeStyles(); | ||
| const theme = useTheme(); | ||
| const StyleUtils = useStyleUtils(); | ||
| const {shouldUseNarrowLayout} = useResponsiveLayout(); | ||
| const icons = useMemoizedLazyExpensifyIcons(['ArrowRight', 'Checkmark'] as const); | ||
|
|
||
| const navigateToItem = () => { | ||
| if (!item.isFeatureEnabled) { | ||
| item.enableFeature?.(); | ||
| } | ||
| Navigation.setNavigationActionToMicrotaskQueue(() => Navigation.navigate(item.route)); | ||
| }; | ||
|
|
||
| return ( | ||
| <PressableWithoutFeedback | ||
| onPress={navigateToItem} | ||
| accessibilityLabel={item.label} | ||
| sentryLabel={CONST.SENTRY_LABEL.HOME_PAGE.GETTING_STARTED_ROW} | ||
| > | ||
| {({hovered}) => ( | ||
| <View style={[styles.flexRow, styles.alignItemsCenter, styles.gap3, shouldUseNarrowLayout ? styles.ph5 : styles.ph8, styles.pv3, hovered && styles.hoveredComponentBG]}> | ||
| {item.isComplete ? ( | ||
| <View | ||
| style={[ | ||
| StyleUtils.getCheckboxContainerStyle(variables.iconSizeNormal, variables.componentBorderRadiusSmall), | ||
| {backgroundColor: theme.icon, borderColor: theme.icon}, | ||
| ]} | ||
| > | ||
| <Icon | ||
|
adamgrzybowski marked this conversation as resolved.
|
||
| src={icons.Checkmark} | ||
| fill={theme.textLight} | ||
| height={variables.iconSizeSemiSmall} | ||
| width={variables.iconSizeSemiSmall} | ||
| /> | ||
| </View> | ||
| ) : ( | ||
| <Checkbox | ||
| isChecked={false} | ||
| onPress={navigateToItem} | ||
| accessibilityLabel={item.label} | ||
| /> | ||
| )} | ||
| <Text style={[styles.flex1, styles.textBold, item.isComplete && {color: theme.textSupporting}]}>{item.label}</Text> | ||
| {!item.isComplete && ( | ||
| <Icon | ||
| src={icons.ArrowRight} | ||
| width={variables.iconSizeNormal} | ||
| height={variables.iconSizeNormal} | ||
| fill={theme.icon} | ||
| /> | ||
| )} | ||
| </View> | ||
| )} | ||
| </PressableWithoutFeedback> | ||
| ); | ||
| } | ||
|
|
||
| export default GettingStartedRow; | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.