Skip to content

Commit 9f8d61d

Browse files
authored
Merge pull request Expensify#88995 from Expensify/claude-removeScanTestTooltipV2
[Payment due @ChavdaSachin] Remove SCAN_TEST_TOOLTIP from Create Expense Scan flow
2 parents c0a0868 + debec00 commit 9f8d61d

45 files changed

Lines changed: 174 additions & 838 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

assets/images/fake-receipt.png

-61.3 KB
Binary file not shown.

src/CONST/index.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8579,9 +8579,6 @@ const CONST = {
85798579
SIGN_UP: 'sign_up',
85808580
WORKSPACE_CREATED: 'workspace_created',
85818581
PAID_ADOPTION: 'paid_adoption',
8582-
PRODUCT_TRAINING_SCAN_TEST_TOOLTIP_SHOWN: 'training_scan_test_tooltip_shown',
8583-
PRODUCT_TRAINING_SCAN_TEST_TOOLTIP_DISMISSED: 'training_scan_test_tooltip_dismissed',
8584-
PRODUCT_TRAINING_SCAN_TEST_TOOLTIP_CONFIRMED: 'training_scan_test_tooltip_confirmed',
85858582
},
85868583
},
85878584

@@ -8640,9 +8637,6 @@ const CONST = {
86408637
// https://github.com/Expensify/App/issues/57045#issuecomment-2701455668
86418638
CONCIERGE_LHN_GBR: 'conciergeLHNGBR',
86428639
RENAME_SAVED_SEARCH: 'renameSavedSearch',
8643-
SCAN_TEST_TOOLTIP: 'scanTestTooltip',
8644-
SCAN_TEST_TOOLTIP_MANAGER: 'scanTestTooltipManager',
8645-
SCAN_TEST_CONFIRMATION: 'scanTestConfirmation',
86468640
OUTSTANDING_FILTER: 'outstandingFilter',
86478641
ACCOUNT_SWITCHER: 'accountSwitcher',
86488642
SCAN_TEST_DRIVE_CONFIRMATION: 'scanTestDriveConfirmation',

src/components/MoneyRequestConfirmationList.tsx

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ import {validateAmount} from '@libs/MoneyRequestUtils';
2828
import Navigation from '@libs/Navigation/Navigation';
2929
import {getIOUConfirmationOptionsFromPayeePersonalDetail, hasEnabledOptions} from '@libs/OptionsListUtils';
3030
import {getTagLists, isAttendeeTrackingEnabled, isTaxTrackingEnabled} from '@libs/PolicyUtils';
31-
import {isSelectedManagerMcTest} from '@libs/ReportUtils';
3231
import type {OptionData} from '@libs/ReportUtils';
3332
import {hasEnabledTags, hasMatchingTag} from '@libs/TagsOptionsListUtils';
3433
import {isValidTimeExpenseAmount} from '@libs/TimeTrackingUtils';
@@ -258,14 +257,7 @@ function MoneyRequestConfirmationList({
258257
return transaction?.receipt?.isTestDriveReceipt ?? false;
259258
}, [transaction?.receipt?.isTestDriveReceipt]);
260259

261-
const isManagerMcTestReceipt = useMemo(() => {
262-
return isBetaEnabled(CONST.BETAS.NEWDOT_MANAGER_MCTEST) && selectedParticipantsProp.some((participant) => isSelectedManagerMcTest(participant.login));
263-
}, [isBetaEnabled, selectedParticipantsProp]);
264-
265-
const {shouldShowProductTrainingTooltip, renderProductTrainingTooltip} = useProductTrainingContext(
266-
isTestDriveReceipt ? CONST.PRODUCT_TRAINING_TOOLTIP_NAMES.SCAN_TEST_DRIVE_CONFIRMATION : CONST.PRODUCT_TRAINING_TOOLTIP_NAMES.SCAN_TEST_CONFIRMATION,
267-
isTestDriveReceipt || isManagerMcTestReceipt,
268-
);
260+
const {shouldShowProductTrainingTooltip, renderProductTrainingTooltip} = useProductTrainingContext(CONST.PRODUCT_TRAINING_TOOLTIP_NAMES.SCAN_TEST_DRIVE_CONFIRMATION, isTestDriveReceipt);
269261

270262
const isTrackExpense = iouType === CONST.IOU.TYPE.TRACK;
271263
const {policy} = usePolicyForTransaction({

src/components/ProductTrainingContext/TOOLTIPS.ts

Lines changed: 1 addition & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,7 @@ import {dismissProductTraining} from '@libs/actions/Welcome';
33
import CONST from '@src/CONST';
44
import type {TranslationPaths} from '@src/languages/types';
55

6-
const {
7-
CONCIERGE_LHN_GBR,
8-
RENAME_SAVED_SEARCH,
9-
SCAN_TEST_TOOLTIP,
10-
SCAN_TEST_TOOLTIP_MANAGER,
11-
SCAN_TEST_CONFIRMATION,
12-
OUTSTANDING_FILTER,
13-
ACCOUNT_SWITCHER,
14-
SCAN_TEST_DRIVE_CONFIRMATION,
15-
GPS_TOOLTIP,
16-
HAS_FILTER_NEGATION,
17-
} = CONST.PRODUCT_TRAINING_TOOLTIP_NAMES;
6+
const {CONCIERGE_LHN_GBR, RENAME_SAVED_SEARCH, OUTSTANDING_FILTER, ACCOUNT_SWITCHER, SCAN_TEST_DRIVE_CONFIRMATION, GPS_TOOLTIP, HAS_FILTER_NEGATION} = CONST.PRODUCT_TRAINING_TOOLTIP_NAMES;
187

198
type ProductTrainingTooltipName = Exclude<ValueOf<typeof CONST.PRODUCT_TRAINING_TOOLTIP_NAMES>, typeof CONST.PRODUCT_TRAINING_TOOLTIP_NAMES.MULTI_SCAN_EDUCATIONAL_MODAL>;
209

@@ -32,7 +21,6 @@ type TooltipData = {
3221
name: ProductTrainingTooltipName;
3322
priority: number;
3423
shouldShow: (props: ShouldShowConditionProps) => boolean;
35-
shouldRenderActionButtons?: boolean;
3624
};
3725

3826
const TOOLTIPS: Record<ProductTrainingTooltipName, TooltipData> = {
@@ -59,28 +47,6 @@ const TOOLTIPS: Record<ProductTrainingTooltipName, TooltipData> = {
5947
priority: 1600,
6048
shouldShow: () => true,
6149
},
62-
[SCAN_TEST_TOOLTIP]: {
63-
content: 'productTrainingTooltip.scanTestTooltip.main',
64-
onHideTooltip: () => dismissProductTraining(SCAN_TEST_TOOLTIP),
65-
name: SCAN_TEST_TOOLTIP,
66-
priority: 900,
67-
shouldShow: ({isUserInPaidPolicy, hasBeenAddedToNudgeMigration}) => !isUserInPaidPolicy && !hasBeenAddedToNudgeMigration,
68-
shouldRenderActionButtons: true,
69-
},
70-
[SCAN_TEST_TOOLTIP_MANAGER]: {
71-
content: 'productTrainingTooltip.scanTestTooltip.manager',
72-
onHideTooltip: (isDismissedUsingCloseButton = false) => dismissProductTraining(SCAN_TEST_TOOLTIP_MANAGER, isDismissedUsingCloseButton),
73-
name: SCAN_TEST_TOOLTIP_MANAGER,
74-
priority: 1000,
75-
shouldShow: ({hasBeenAddedToNudgeMigration}) => !hasBeenAddedToNudgeMigration,
76-
},
77-
[SCAN_TEST_CONFIRMATION]: {
78-
content: 'productTrainingTooltip.scanTestTooltip.confirmation',
79-
onHideTooltip: (isDismissedUsingCloseButton = false) => dismissProductTraining(SCAN_TEST_CONFIRMATION, isDismissedUsingCloseButton),
80-
name: SCAN_TEST_CONFIRMATION,
81-
priority: 1100,
82-
shouldShow: ({hasBeenAddedToNudgeMigration}) => !hasBeenAddedToNudgeMigration,
83-
},
8450
[OUTSTANDING_FILTER]: {
8551
content: 'productTrainingTooltip.outstandingFilter',
8652
onHideTooltip: () => dismissProductTraining(OUTSTANDING_FILTER),

src/components/ProductTrainingContext/index.tsx

Lines changed: 15 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import {hasCompletedGuidedSetupFlowSelector} from '@selectors/Onboarding';
33
import {emailSelector} from '@selectors/Session';
44
import React, {createContext, useCallback, useContext, useEffect, useMemo, useState} from 'react';
55
import {View} from 'react-native';
6-
import Button from '@components/Button';
76
import Icon from '@components/Icon';
87
import PressableWithoutFeedback from '@components/Pressable/PressableWithoutFeedback';
98
import RenderHTML from '@components/RenderHTML';
@@ -31,16 +30,6 @@ type ProductTrainingContextType = {
3130
};
3231

3332
type ProductTrainingContextConfig = {
34-
/**
35-
* Callback to be called when the tooltip is dismissed
36-
*/
37-
onDismiss?: () => void;
38-
39-
/**
40-
* Callback to be called when the tooltip is confirmed
41-
*/
42-
onConfirm?: () => void;
43-
4433
/**
4534
* Callback to be called when the tooltip is shown
4635
*/
@@ -151,9 +140,6 @@ function ProductTrainingContextProvider({children}: ChildrenProps) {
151140

152141
// We need to make an exception for these tooltips because it is shown in a modal, otherwise it would be hidden if a modal is visible
153142
if (
154-
tooltipName !== CONST.PRODUCT_TRAINING_TOOLTIP_NAMES.SCAN_TEST_TOOLTIP &&
155-
tooltipName !== CONST.PRODUCT_TRAINING_TOOLTIP_NAMES.SCAN_TEST_TOOLTIP_MANAGER &&
156-
tooltipName !== CONST.PRODUCT_TRAINING_TOOLTIP_NAMES.SCAN_TEST_CONFIRMATION &&
157143
tooltipName !== CONST.PRODUCT_TRAINING_TOOLTIP_NAMES.SCAN_TEST_DRIVE_CONFIRMATION &&
158144
tooltipName !== CONST.PRODUCT_TRAINING_TOOLTIP_NAMES.GPS_TOOLTIP &&
159145
tooltipName !== CONST.PRODUCT_TRAINING_TOOLTIP_NAMES.HAS_FILTER_NEGATION &&
@@ -278,17 +264,7 @@ const useProductTrainingContext = (tooltipName: ProductTrainingTooltipName, shou
278264
fsClass={CONST.FULLSTORY.CLASS.UNMASK}
279265
onLayout={config.onShown}
280266
>
281-
<View
282-
style={[
283-
styles.alignItemsCenter,
284-
styles.flexRow,
285-
tooltip?.shouldRenderActionButtons ? styles.justifyContentStart : styles.justifyContentCenter,
286-
styles.textAlignCenter,
287-
styles.gap3,
288-
styles.pv2,
289-
styles.ph2,
290-
]}
291-
>
267+
<View style={[styles.alignItemsCenter, styles.flexRow, styles.justifyContentCenter, styles.textAlignCenter, styles.gap3, styles.pv2, styles.ph2]}>
292268
<Icon
293269
src={expensifyIcons.Lightbulb}
294270
fill={theme.tooltipHighlightText}
@@ -297,62 +273,39 @@ const useProductTrainingContext = (tooltipName: ProductTrainingTooltipName, shou
297273
<View style={[styles.renderHTML, styles.dFlex, styles.flexShrink1]}>
298274
<RenderHTML html={translate(tooltip.content)} />
299275
</View>
300-
{!tooltip?.shouldRenderActionButtons && (
301-
<PressableWithoutFeedback
302-
sentryLabel={CONST.SENTRY_LABEL.PRODUCT_TRAINING.TOOLTIP}
303-
shouldUseAutoHitSlop
304-
accessibilityLabel={translate('common.noThanks')}
305-
role={CONST.ROLE.BUTTON}
306-
onPress={() => hideTooltip(true)}
307-
>
308-
<Icon
309-
src={expensifyIcons.Close}
310-
fill={theme.icon}
311-
width={variables.iconSizeSemiSmall}
312-
height={variables.iconSizeSemiSmall}
313-
/>
314-
</PressableWithoutFeedback>
315-
)}
316-
</View>
317-
{!!tooltip?.shouldRenderActionButtons && (
318-
<View style={[styles.alignItemsCenter, styles.justifyContentBetween, styles.flexRow, styles.ph2, styles.pv2, styles.gap2]}>
319-
<Button
320-
success
321-
text={translate('productTrainingTooltip.scanTestTooltip.tryItOut')}
322-
style={[styles.flex1]}
323-
onPress={config.onConfirm}
324-
/>
325-
<Button
326-
text={translate('common.noThanks')}
327-
style={[styles.flex1]}
328-
onPress={config.onDismiss}
276+
<PressableWithoutFeedback
277+
sentryLabel={CONST.SENTRY_LABEL.PRODUCT_TRAINING.TOOLTIP}
278+
shouldUseAutoHitSlop
279+
accessibilityLabel={translate('common.noThanks')}
280+
role={CONST.ROLE.BUTTON}
281+
onPress={() => hideTooltip(true)}
282+
>
283+
<Icon
284+
src={expensifyIcons.Close}
285+
fill={theme.icon}
286+
width={variables.iconSizeSemiSmall}
287+
height={variables.iconSizeSemiSmall}
329288
/>
330-
</View>
331-
)}
289+
</PressableWithoutFeedback>
290+
</View>
332291
</View>
333292
);
334293
}, [
335294
tooltipName,
336295
styles.alignItemsCenter,
337296
styles.flexRow,
338-
styles.justifyContentStart,
339297
styles.justifyContentCenter,
340298
styles.textAlignCenter,
341299
styles.gap3,
342300
styles.pv2,
343-
styles.flex1,
344-
styles.justifyContentBetween,
345301
styles.ph2,
346-
styles.gap2,
347302
styles.renderHTML,
348303
styles.dFlex,
349304
styles.flexShrink1,
350305
theme.tooltipHighlightText,
351306
theme.icon,
352307
translate,
353308
config.onShown,
354-
config.onConfirm,
355-
config.onDismiss,
356309
hideTooltip,
357310
expensifyIcons.Close,
358311
expensifyIcons.Lightbulb,

src/components/Search/FilterDropdowns/InSelectPopup.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@ function InSelectPopup({closeOverlay, updateFilterForm}: InSelectPopupProps) {
7575
const cleanSearchTerm = searchTerm.trim().toLowerCase();
7676
const [draftComments] = useOnyx(ONYXKEYS.COLLECTION.REPORT_DRAFT_COMMENT);
7777
const privateIsArchivedMap = usePrivateIsArchivedMap();
78-
const [nvpDismissedProductTraining] = useOnyx(ONYXKEYS.NVP_DISMISSED_PRODUCT_TRAINING);
7978
const [policyTags] = useOnyx(ONYXKEYS.COLLECTION.POLICY_TAGS, {selector: passthroughPolicyTagListSelector});
8079
const [conciergeReportID] = useOnyx(ONYXKEYS.CONCIERGE_REPORT_ID);
8180

@@ -96,7 +95,6 @@ function InSelectPopup({closeOverlay, updateFilterForm}: InSelectPopupProps) {
9695
: getSearchOptions({
9796
options,
9897
draftComments,
99-
nvpDismissedProductTraining,
10098
betas: undefined,
10199
isUsedInChatFinder: false,
102100
countryCode,

src/components/Search/SearchAutocompleteList.tsx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,6 @@ function SearchAutocompleteList({
148148
const feedKeysWithCards = useFeedKeysWithAssignedCards();
149149
const reportAttributes = useReportAttributes();
150150
const [draftComments] = useOnyx(ONYXKEYS.COLLECTION.REPORT_DRAFT_COMMENT);
151-
const [nvpDismissedProductTraining] = useOnyx(ONYXKEYS.NVP_DISMISSED_PRODUCT_TRAINING);
152151
const [recentSearches, recentSearchesMetadata] = useOnyx(ONYXKEYS.RECENT_SEARCHES);
153152
const [countryCode] = useOnyx(ONYXKEYS.COUNTRY_CODE);
154153
const [loginList] = useOnyx(ONYXKEYS.LOGIN_LIST);
@@ -196,7 +195,6 @@ function SearchAutocompleteList({
196195
return getSearchOptions({
197196
options: listOptions,
198197
draftComments,
199-
nvpDismissedProductTraining,
200198
betas: betas ?? [],
201199
isUsedInChatFinder: true,
202200
includeReadOnly: true,
@@ -220,7 +218,6 @@ function SearchAutocompleteList({
220218
}, [
221219
listOptions,
222220
draftComments,
223-
nvpDismissedProductTraining,
224221
betas,
225222
autocompleteQueryValue,
226223
countryCode,
@@ -297,7 +294,6 @@ function SearchAutocompleteList({
297294
allFeeds,
298295
options: listOptions ?? emptyOptionList,
299296
draftComments,
300-
nvpDismissedProductTraining,
301297
betas,
302298
countryCode,
303299
loginList,

src/components/Search/SearchFiltersChatsSelector.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ function SearchFiltersChatsSelector({initialReportIDs, onFiltersUpdate, isScreen
6868
const cleanSearchTerm = searchTerm.trim().toLowerCase();
6969
const [draftComments] = useOnyx(ONYXKEYS.COLLECTION.REPORT_DRAFT_COMMENT);
7070
const privateIsArchivedMap = usePrivateIsArchivedMap();
71-
const [nvpDismissedProductTraining] = useOnyx(ONYXKEYS.NVP_DISMISSED_PRODUCT_TRAINING);
7271
const [policyTags] = useOnyx(ONYXKEYS.COLLECTION.POLICY_TAGS, {selector: passthroughPolicyTagListSelector});
7372
const sortedActions = useSortedActions();
7473

@@ -89,7 +88,6 @@ function SearchFiltersChatsSelector({initialReportIDs, onFiltersUpdate, isScreen
8988
: getSearchOptions({
9089
options: listOptions,
9190
draftComments,
92-
nvpDismissedProductTraining,
9391
betas: undefined,
9492
isUsedInChatFinder: false,
9593
countryCode,

0 commit comments

Comments
 (0)