-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Concierge AI Feature Promo Modal v2 #94012
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
tgolen
merged 43 commits into
Expensify:main
from
gijoe0295:fix/ai-feature-promo-modal-v2
Jul 10, 2026
Merged
Changes from all commits
Commits
Show all changes
43 commits
Select commit
Hold shift + click to select a range
e05a88c
Reapply "Merge pull request #92007 from gijoe0295/feat/ai-feature-pro…
gijoe0295 6b39918
Fix search router opens/closes when AI promo modal is up
gijoe0295 db3dc2a
Fix AI promo modal clipping action buttons in landscape
gijoe0295 0d5e20c
Fix AI promo carousel rendering blank on mWeb
gijoe0295 4e05ef2
Fix AI promo carousel skipping middle page on fast swipe
gijoe0295 e0d7fd3
Suppress AI promo modal while acting as a delegate
gijoe0295 f29182e
Allow external intents to navigate past the AI promo modal
gijoe0295 785c8b7
Merge branch 'main' of github.com:gijoe0295/App into fix/ai-feature-p…
gijoe0295 377ae5c
Migrate AI promo modal to dynamic routes
gijoe0295 6155a82
extract types and refactor FeatureTrainingContent by breaking into sm…
gijoe0295 c9866c3
refactor directories and rename files for clarity
gijoe0295 b9922e0
rename and refactor FeatureTrainingCarousel
gijoe0295 c0ed02e
fix lint an dknip
gijoe0295 81e4b2b
fix: improve guard and fix modal style
gijoe0295 d1cbc6d
Merge branch 'main' of github.com:gijoe0295/App into fix/ai-feature-p…
gijoe0295 70bd957
Revert "Fix search router opens/closes when AI promo modal is up"
gijoe0295 976d7b9
Support landscape mode. Fixes https://github.com/Expensify/App/issues…
gijoe0295 82bdce5
fix https://github.com/Expensify/App/issues/93970
gijoe0295 4f745ea
remove redundant comments
gijoe0295 2fec414
resolve feedbacks
gijoe0295 24fc989
Merge branch 'main' of github.com:gijoe0295/App into fix/ai-feature-p…
gijoe0295 4a8e035
Reapply https://github.com/Expensify/App/pull/94599
gijoe0295 23e869a
fix: animation flickers when moving
gijoe0295 6e1ce64
remove redundant code comments
gijoe0295 4a7b89e
resolved comments
gijoe0295 1635d74
Merge branch 'main' of github.com:gijoe0295/App into fix/ai-feature-p…
gijoe0295 18283e2
Merge branch 'main' of github.com:gijoe0295/App into fix/ai-feature-p…
gijoe0295 4f54860
update lint seatbelt
gijoe0295 73dc4c0
Block pausing animation on mobile Chrome
gijoe0295 34c94c2
Extract modal guard to hook
gijoe0295 c927ed0
Update tests
gijoe0295 4bbd420
Allow promo modal to show on top of any screen
gijoe0295 c31d247
Fix: Animation is broken on swipe on mobile browser
gijoe0295 e05e6ec
Mock useAIFeaturesPromoModal in tests globally
gijoe0295 a5fe7f5
Do not show modal on top of share page. Fixes https://github.com/Expe…
gijoe0295 8ad081f
fix lint
gijoe0295 7f5684e
Merge branch 'main' of github.com:gijoe0295/App into fix/ai-feature-p…
gijoe0295 b523f4d
Run formatting
gijoe0295 369c2f9
Merge branch 'main' of github.com:gijoe0295/App into fix/ai-feature-p…
gijoe0295 8ec7709
Resolve feedbacks
gijoe0295 1fd9f8f
Simplify NVP dismissal
gijoe0295 3260e65
Merge branch 'main' of github.com:gijoe0295/App into fix/ai-feature-p…
gijoe0295 199b3ea
Fix lint
gijoe0295 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
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file not shown.
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 |
|---|---|---|
| @@ -0,0 +1,107 @@ | ||
| import useLocalize from '@hooks/useLocalize'; | ||
| import usePermissions from '@hooks/usePermissions'; | ||
| import useThemeStyles from '@hooks/useThemeStyles'; | ||
|
|
||
| import {dismissProductTraining} from '@libs/actions/Welcome'; | ||
| import Navigation from '@libs/Navigation/Navigation'; | ||
|
|
||
| import variables from '@styles/variables'; | ||
|
|
||
| import CONST from '@src/CONST'; | ||
|
|
||
| import React from 'react'; | ||
| import {View} from 'react-native'; | ||
|
|
||
| import type {FeatureTrainingContentDataProps} from './FeatureTrainingContent'; | ||
|
|
||
| import Badge from './Badge'; | ||
| import CenteredModalLayout from './CenteredModalLayout'; | ||
| import {FeatureTrainingCarousel} from './FeatureTrainingContent'; | ||
| import LottieAnimations from './LottieAnimations'; | ||
| import Text from './Text'; | ||
|
|
||
| function AIFeaturesPromoModal() { | ||
| const {translate} = useLocalize(); | ||
| const styles = useThemeStyles(); | ||
| const {isBetaEnabled} = usePermissions(); | ||
| const canUseCustomAgent = isBetaEnabled(CONST.BETAS.CUSTOM_AGENT); | ||
|
|
||
| const customAgentPromoTitle = ( | ||
| <View style={[styles.dFlex, styles.flexRow]}> | ||
| <Text style={[styles.textHeadlineH1, styles.mb2]}>{translate('aiFeaturesPromoModal.customAgents.title')}</Text> | ||
| <Badge | ||
| isStrong | ||
| isCondensed | ||
| text={translate('common.beta')} | ||
| badgeStyles={styles.mb2} | ||
| /> | ||
| </View> | ||
| ); | ||
|
|
||
| const pages: FeatureTrainingContentDataProps[] = [ | ||
| { | ||
| animation: LottieAnimations.SpendAnalysis, | ||
| title: translate('aiFeaturesPromoModal.spendAnalysis.title'), | ||
| subtitle: translate('aiFeaturesPromoModal.subtitle'), | ||
| description: translate('aiFeaturesPromoModal.spendAnalysis.description'), | ||
| confirmText: translate('common.next'), | ||
| }, | ||
| { | ||
| animation: LottieAnimations.ExpenseAssistant, | ||
| title: translate('aiFeaturesPromoModal.expenseAssistant.title'), | ||
| subtitle: translate('aiFeaturesPromoModal.subtitle'), | ||
| description: translate('aiFeaturesPromoModal.expenseAssistant.description'), | ||
| confirmText: canUseCustomAgent ? translate('common.next') : translate('aiFeaturesPromoModal.confirmText'), | ||
| }, | ||
| ...(canUseCustomAgent | ||
| ? [ | ||
| { | ||
| animation: LottieAnimations.CustomAgents, | ||
| title: customAgentPromoTitle, | ||
| subtitle: translate('aiFeaturesPromoModal.subtitle'), | ||
| description: translate('aiFeaturesPromoModal.customAgents.description'), | ||
| confirmText: translate('aiFeaturesPromoModal.confirmText'), | ||
| }, | ||
| ] | ||
| : []), | ||
| ]; | ||
|
|
||
| const dismissNVP = (isDismissedUsingCloseButton: boolean) => { | ||
| dismissProductTraining(CONST.AI_FEATURES_PROMO_MODAL, isDismissedUsingCloseButton); | ||
| }; | ||
|
|
||
| const confirmAndCloseModal = () => { | ||
| Navigation.goBack(); | ||
| dismissNVP(false); | ||
| }; | ||
|
|
||
| const closeModal = () => { | ||
| Navigation.goBack(); | ||
| dismissNVP(true); | ||
| }; | ||
|
|
||
| return ( | ||
| <CenteredModalLayout | ||
| onBackdropPress={closeModal} | ||
| width={variables.aiFeaturesPromoModalWidth} | ||
| contentStyle={styles.pt0} | ||
| > | ||
| <FeatureTrainingCarousel | ||
| pages={pages} | ||
| onConfirm={confirmAndCloseModal} | ||
| onClose={closeModal} | ||
| width={variables.aiFeaturesPromoModalWidth} | ||
| shouldRenderHTMLDescription | ||
| shouldUseScrollView | ||
| illustrationOuterContainerStyle={styles.p0} | ||
| illustrationAspectRatio={LottieAnimations.SpendAnalysis.w / LottieAnimations.SpendAnalysis.h} | ||
| contentInnerContainerStyles={styles.mb4} | ||
| titleStyles={styles.mb2} | ||
| confirmSentryLabel={CONST.SENTRY_LABEL.AI_FEATURES_PROMO_MODAL.CONFIRM_BUTTON} | ||
| helpSentryLabel={CONST.SENTRY_LABEL.AI_FEATURES_PROMO_MODAL.HELP_BUTTON} | ||
| /> | ||
|
gijoe0295 marked this conversation as resolved.
|
||
| </CenteredModalLayout> | ||
| ); | ||
| } | ||
|
|
||
| export default AIFeaturesPromoModal; | ||
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.
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.
I think this would be better to write with a pattern like this (I believe it's in our react best practices):
Uh oh!
There was an error while loading. Please reload this page.
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.
Oh is this composition over configuration best practice?. Can I defer this refactoring to a followup PR? We need to refactor the whole
FeatureTraningContenttree as well. Plus we have some internal shared logics among the carousel pages which need investigation.cc @ShridharGoel
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.
Yes, you can see we have it detailed over here: https://github.com/Expensify/App/blob/main/.claude/skills/coding-standards/rules/clean-react-1-composition-over-config.md
I didn't know if this was the first PR implementing this or not. If it's not, I'm totally down with it being refactored in a followup PR.