Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
635797b
feat: update confirmation and rate selection UX for date-aware mileag…
Krishna2323 Jun 7, 2026
8105844
migrate rate tooltip to ProductTrainingContext pattern
Krishna2323 Jun 7, 2026
577fb22
extract tooltip shift values to style variables
Krishna2323 Jun 7, 2026
58c08b1
restore comment.
Krishna2323 Jun 7, 2026
dab1829
align rate display and tooltip with design doc
Krishna2323 Jun 7, 2026
8358365
dismiss tooltip on press
Krishna2323 Jun 7, 2026
2b4f30e
fix: add default rate fallback in date-aware auto-selection
Krishna2323 Jun 7, 2026
331cedc
simplify tooltip detection with usePrevious
Krishna2323 Jun 7, 2026
aab2966
update translations.
Krishna2323 Jun 8, 2026
eecff6c
Merge branch 'Expensify:main' into krishna/89835-confirmation-rate-se…
Krishna2323 Jun 8, 2026
a2ddca2
fix prettier.
Krishna2323 Jun 8, 2026
5c57e41
address Codex review for tooltip and rate list display
Krishna2323 Jun 8, 2026
229bb5c
fix: prevent tooltip render loop and unnamed rate duplicate
Krishna2323 Jun 8, 2026
6d4c6e2
hide tooltip on scroll.
Krishna2323 Jun 8, 2026
97a9581
Merge branch 'Expensify:main' into krishna/89835-confirmation-rate-se…
Krishna2323 Jun 8, 2026
8509171
Merge branch 'Expensify:main' into krishna/89835-confirmation-rate-se…
Krishna2323 Jun 9, 2026
70a5daf
address review comment.
Krishna2323 Jun 9, 2026
44ea7f3
fix: signal rate auto-update via Onyx flag instead of render-phase tr…
Krishna2323 Jun 9, 2026
4358237
fix lint errors.
Krishna2323 Jun 9, 2026
a73c989
Merge branch 'Expensify:main' into krishna/89835-confirmation-rate-se…
Krishna2323 Jun 11, 2026
6dccac0
Merge branch 'Expensify:main' into krishna/89835-confirmation-rate-se…
Krishna2323 Jun 12, 2026
0bcf63a
Simplify alternateText construction for distance rate options
Krishna2323 Jun 12, 2026
08eccad
Remove duplicate translation entries for rateValid keys
Krishna2323 Jun 12, 2026
c901141
Merge branch 'Expensify:main' into krishna/89835-confirmation-rate-se…
Krishna2323 Jun 12, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/CONST/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7759,6 +7759,7 @@ const CONST = {
MULTI_SCAN_EDUCATIONAL_MODAL: 'multiScanEducationalModal',
GPS_TOOLTIP: 'gpsTooltip',
HAS_FILTER_NEGATION: 'hasFilterNegation',
MILEAGE_RATE_AUTO_UPDATED: 'mileageRateAutoUpdated',
},
CHANGE_POLICY_TRAINING_MODAL: 'changePolicyModal',
AGENTS_RULES_BANNER: 'agentsRulesBanner',
Expand Down
4 changes: 3 additions & 1 deletion src/components/MoneyRequestConfirmationList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,8 @@ function MoneyRequestConfirmationList({
const previousTransactionCurrency = usePrevious(transaction?.currency);
const customUnitRateID = getRateID(transaction);

const shouldShowRateAutoUpdatedTooltip = isDistanceRequest && !!transaction?.comment?.customUnit?.rateAutoUpdated;

const subRates = transaction?.comment?.customUnit?.subRates ?? [];
const prevSubRates = usePrevious(subRates);

Expand Down Expand Up @@ -545,7 +547,7 @@ function MoneyRequestConfirmationList({
isPolicyExpenseChat={isPolicyExpenseChat}
expenseMode={{isDistance: isDistanceRequest, isTime: isTimeRequest, isInvoice: isTypeInvoice, isPerDiem: isPerDiemRequest}}
distanceFlags={{isManualDistanceRequest, isOdometerDistanceRequest, isGPSDistanceRequest}}
distanceData={{distance, hasRoute, unit, rate, distanceRateName: mileageRate.name, distanceRateCurrency: currency}}
distanceData={{distance, hasRoute, unit, rate, distanceRateName: mileageRate.name, distanceRateCurrency: currency, shouldShowRateAutoUpdatedTooltip}}
amountDisplay={{amount: amountToBeUsed, formattedAmount, formattedAmountPerAttendee}}
requiredFlags={{isCategoryRequired, isMerchantRequired, isDescriptionRequired}}
visibilityFlags={{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,29 @@ function DistanceRequestController({
return;
}

setCustomUnitRateID(transactionID, lastSelectedRate, transaction, policy);
}, [customUnitRateID, transactionID, lastSelectedRate, isDistanceRequest, isPolicyExpenseChat, isMovingTransactionFromTrackExpense, transaction, policy, selectedParticipants]);
let rateToUse = lastSelectedRate;
const expenseDate = transaction?.created;
if (expenseDate) {
const mileageRates = DistanceRequestUtils.getMileageRates(policy);
const lastRate = lastSelectedRate ? mileageRates[lastSelectedRate] : undefined;
if (!lastRate || !DistanceRequestUtils.isRateEligibleForDate(lastRate, expenseDate)) {
const bestRate = DistanceRequestUtils.getBestEligibleRate(mileageRates, expenseDate);
rateToUse = bestRate?.customUnitRateID ?? defaultMileageRateCustomUnitRateID ?? lastSelectedRate;
}
}
setCustomUnitRateID(transactionID, rateToUse, transaction, policy);
}, [
customUnitRateID,
transactionID,
lastSelectedRate,
isDistanceRequest,
isPolicyExpenseChat,
isMovingTransactionFromTrackExpense,
transaction,
policy,
selectedParticipants,
defaultMileageRateCustomUnitRateID,
]);

useEffect(() => {
if (!isDistanceRequest || !transactionID || isReadOnly) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
import React from 'react';
import type {OnyxEntry} from 'react-native-onyx';
import MenuItemWithTopDescription from '@components/MenuItemWithTopDescription';
import {useProductTrainingContext} from '@components/ProductTrainingContext';
import {useCurrencyListActions} from '@hooks/useCurrencyList';
import useLocalize from '@hooks/useLocalize';
import useNetwork from '@hooks/useNetwork';
import useThemeStyles from '@hooks/useThemeStyles';
import DistanceRequestUtils from '@libs/DistanceRequestUtils';
import Navigation from '@libs/Navigation/Navigation';
import variables from '@styles/variables';
import CONST from '@src/CONST';
import type {IOUAction, IOUType} from '@src/CONST';
import ROUTES from '@src/ROUTES';
Expand All @@ -30,6 +32,7 @@ type RateFieldProps = {
formError: string;
shouldNavigateToUpgradePath: boolean;
shouldSelectPolicy: boolean;
shouldShowRateAutoUpdatedTooltip?: boolean;
};

function RateField({
Expand All @@ -49,6 +52,7 @@ function RateField({
formError,
shouldNavigateToUpgradePath,
shouldSelectPolicy,
shouldShowRateAutoUpdatedTooltip,
}: RateFieldProps) {
const styles = useThemeStyles();
const {translate, toLocaleDigit} = useLocalize();
Expand All @@ -59,6 +63,11 @@ function RateField({
const isTrackExpense = iouType === CONST.IOU.TYPE.TRACK;
const isRateInteractive = !!rate && !isReadOnly && iouType !== CONST.IOU.TYPE.SPLIT;

const {renderProductTrainingTooltip, shouldShowProductTrainingTooltip, hideProductTrainingTooltip} = useProductTrainingContext(
CONST.PRODUCT_TRAINING_TOOLTIP_NAMES.MILEAGE_RATE_AUTO_UPDATED,
!!shouldShowRateAutoUpdatedTooltip,
);

return (
<MenuItemWithTopDescription
shouldShowRightIcon={isRateInteractive}
Expand Down Expand Up @@ -99,6 +108,14 @@ function RateField({
disabled={didConfirm}
interactive={isRateInteractive}
sentryLabel={CONST.SENTRY_LABEL.REQUEST_CONFIRMATION_LIST.RATE_FIELD}
shouldRenderTooltip={shouldShowProductTrainingTooltip}
renderTooltipContent={renderProductTrainingTooltip}
tooltipWrapperStyle={styles.productTrainingTooltipWrapper}
tooltipAnchorAlignment={{horizontal: CONST.MODAL.ANCHOR_ORIGIN_HORIZONTAL.LEFT, vertical: CONST.MODAL.ANCHOR_ORIGIN_VERTICAL.BOTTOM}}
tooltipShiftHorizontal={variables.mileageRateTooltipShiftHorizontal}
tooltipShiftVertical={variables.mileageRateTooltipShiftVertical}
onEducationTooltipPress={hideProductTrainingTooltip}
shouldHideOnScroll
/>
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ type DistanceData = {
rate: number | undefined;
distanceRateName: string | undefined;
distanceRateCurrency: string;
shouldShowRateAutoUpdatedTooltip?: boolean;
};

/** Distance-mode discriminators (manual / odometer / GPS) */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ function TransactionDetailsFields({
formError={errorState.formError}
shouldNavigateToUpgradePath={shouldNavigateToUpgradePath}
shouldSelectPolicy={shouldSelectPolicy}
shouldShowRateAutoUpdatedTooltip={distanceData.shouldShowRateAutoUpdatedTooltip}
/>
)}

Expand Down
10 changes: 9 additions & 1 deletion src/components/ProductTrainingContext/TOOLTIPS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import {dismissProductTraining} from '@libs/actions/Welcome';
import CONST from '@src/CONST';
import type {TranslationPaths} from '@src/languages/types';

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;
const {CONCIERGE_LHN_GBR, RENAME_SAVED_SEARCH, OUTSTANDING_FILTER, ACCOUNT_SWITCHER, SCAN_TEST_DRIVE_CONFIRMATION, GPS_TOOLTIP, HAS_FILTER_NEGATION, MILEAGE_RATE_AUTO_UPDATED} =
CONST.PRODUCT_TRAINING_TOOLTIP_NAMES;

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

Expand Down Expand Up @@ -75,6 +76,13 @@ const TOOLTIPS: Record<ProductTrainingTooltipName, TooltipData> = {
priority: 1000,
shouldShow: () => true,
},
[MILEAGE_RATE_AUTO_UPDATED]: {
content: 'productTrainingTooltip.mileageRateAutoUpdated',
onHideTooltip: (isDismissedUsingCloseButton = false) => dismissProductTraining(MILEAGE_RATE_AUTO_UPDATED, isDismissedUsingCloseButton),
name: MILEAGE_RATE_AUTO_UPDATED,
priority: 800,
Comment thread
rlinoz marked this conversation as resolved.
shouldShow: () => true,
},
};

export default TOOLTIPS;
Expand Down
1 change: 1 addition & 0 deletions src/components/ProductTrainingContext/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ function ProductTrainingContextProvider({children}: ChildrenProps) {
tooltipName !== CONST.PRODUCT_TRAINING_TOOLTIP_NAMES.SCAN_TEST_DRIVE_CONFIRMATION &&
tooltipName !== CONST.PRODUCT_TRAINING_TOOLTIP_NAMES.GPS_TOOLTIP &&
tooltipName !== CONST.PRODUCT_TRAINING_TOOLTIP_NAMES.HAS_FILTER_NEGATION &&
tooltipName !== CONST.PRODUCT_TRAINING_TOOLTIP_NAMES.MILEAGE_RATE_AUTO_UPDATED &&
isModalVisible
) {
return false;
Expand Down
1 change: 1 addition & 0 deletions src/languages/de.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9547,6 +9547,7 @@ Fügen Sie weitere Ausgabelimits hinzu, um den Cashflow Ihres Unternehmens zu sc
scanTestDriveTooltip: '<tooltip>Sende diese Quittung, um\n<strong>die Probefahrt abzuschließen!</strong></tooltip>',
gpsTooltip: '<tooltip>GPS-Tracking läuft! Wenn du fertig bist, stoppe die Aufzeichnung unten.</tooltip>',
hasFilterNegation: '<tooltip>Suchen Sie nach Ausgaben ohne Belege mit <strong>-has:receipt</strong>.</tooltip>',
mileageRateAutoUpdated: '<tooltip>Wir haben den Kurs basierend auf Ihrem Reisedatum aktualisiert.</tooltip>',
},
discardChangesConfirmation: {
title: 'Änderungen verwerfen?',
Expand Down
1 change: 1 addition & 0 deletions src/languages/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9604,6 +9604,7 @@ const translations = {
scanTestDriveTooltip: '<tooltip>Send this receipt to\n<strong>complete the test drive!</strong></tooltip>',
gpsTooltip: "<tooltip>GPS tracking in progress! When you're done, stop tracking below.</tooltip>",
hasFilterNegation: '<tooltip>Search for expenses without receipts using <strong>-has:receipt</strong>.</tooltip>',
mileageRateAutoUpdated: '<tooltip>We updated the rate based on your travel date.</tooltip>',
},
discardChangesConfirmation: {
title: 'Discard changes?',
Expand Down
1 change: 1 addition & 0 deletions src/languages/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9705,6 +9705,7 @@ ${amount} para ${merchant} - ${date}`,
scanTestDriveTooltip: '<tooltip>¡Envía este recibo para\n<strong>completar la prueba</strong>!</tooltip>',
gpsTooltip: '<tooltip>¡Seguimiento por GPS en curso! Cuando termines, detén el seguimiento a continuación.</tooltip>',
hasFilterNegation: '<tooltip>Busca gastos sin recibos usando <strong>-has:receipt</strong>.</tooltip>',
mileageRateAutoUpdated: '<tooltip>Hemos actualizado la tasa según tu fecha de viaje.</tooltip>',
},
discardChangesConfirmation: {
title: '¿Descartar cambios?',
Expand Down
1 change: 1 addition & 0 deletions src/languages/fr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9578,6 +9578,7 @@ Ajoutez davantage de règles de dépenses pour protéger la trésorerie de l’e
scanTestDriveTooltip: '<tooltip>Envoyez ce reçu pour\n<strong>terminer l’essai !</strong></tooltip>',
gpsTooltip: '<tooltip>Suivi GPS en cours ! Lorsque vous avez terminé, arrêtez le suivi ci-dessous.</tooltip>',
hasFilterNegation: '<tooltip>Recherchez les dépenses sans reçus à l’aide de <strong>-has:receipt</strong>.</tooltip>',
mileageRateAutoUpdated: '<tooltip>Nous avons mis à jour le taux en fonction de votre date de voyage.</tooltip>',
},
discardChangesConfirmation: {
title: 'Ignorer les modifications ?',
Expand Down
1 change: 1 addition & 0 deletions src/languages/it.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9534,6 +9534,7 @@ Aggiungi altre regole di spesa per proteggere il flusso di cassa aziendale.`,
scanTestDriveTooltip: '<tooltip>Invia questa ricevuta per\n<strong>completare il test drive!</strong></tooltip>',
gpsTooltip: '<tooltip>Tracciamento GPS in corso! Quando hai finito, interrompi il tracciamento qui sotto.</tooltip>',
hasFilterNegation: '<tooltip>Cerca le spese senza ricevute usando <strong>-has:receipt</strong>.</tooltip>',
mileageRateAutoUpdated: '<tooltip>Abbiamo aggiornato il tasso in base alla tua data di viaggio.</tooltip>',
},
discardChangesConfirmation: {
title: 'Scartare le modifiche?',
Expand Down
1 change: 1 addition & 0 deletions src/languages/ja.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9414,6 +9414,7 @@ ${reportName}
scanTestDriveTooltip: '<tooltip>このレシートを送信して\n<strong>試用を完了しましょう!</strong></tooltip>',
gpsTooltip: '<tooltip>GPS追跡を実行中です!完了したら、下で追跡を停止してください。</tooltip>',
hasFilterNegation: '<tooltip><strong>-has:receipt</strong> を使って、レシートのない経費を検索します。</tooltip>',
mileageRateAutoUpdated: '<tooltip>出張日にもとづいてレートを更新しました。</tooltip>',
},
discardChangesConfirmation: {
title: '変更を破棄しますか?',
Expand Down
1 change: 1 addition & 0 deletions src/languages/nl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9501,6 +9501,7 @@ er bestedingsregels toe om de kasstroom van het bedrijf te beschermen.`,
scanTestDriveTooltip: '<tooltip>Stuur deze bon om\n<strong>de proefrit te voltooien!</strong></tooltip>',
gpsTooltip: '<tooltip>GPS-tracking bezig! Als je klaar bent, stop dan hieronder met bijhouden.</tooltip>',
hasFilterNegation: '<tooltip>Zoek naar uitgaven zonder bonnen met <strong>-has:receipt</strong>.</tooltip>',
mileageRateAutoUpdated: '<tooltip>We hebben het tarief bijgewerkt op basis van je reisdatum.</tooltip>',
},
discardChangesConfirmation: {
title: 'Wijzigingen negeren?',
Expand Down
1 change: 1 addition & 0 deletions src/languages/pl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9486,6 +9486,7 @@ Dodaj więcej zasad wydatków, żeby chronić płynność finansową firmy.`,
scanTestDriveTooltip: '<tooltip>Wyślij ten paragon, aby\n<strong>zakończyć jazdę próbną!</strong></tooltip>',
gpsTooltip: '<tooltip>Śledzenie GPS w toku! Gdy skończysz, zatrzymaj śledzenie poniżej.</tooltip>',
hasFilterNegation: '<tooltip>Wyszukaj wydatki bez paragonów za pomocą <strong>-has:receipt</strong>.</tooltip>',
mileageRateAutoUpdated: '<tooltip>Zaktualizowaliśmy stawkę na podstawie daty twojej podróży.</tooltip>',
},
discardChangesConfirmation: {
title: 'Odrzucić zmiany?',
Expand Down
1 change: 1 addition & 0 deletions src/languages/pt-BR.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9494,6 +9494,7 @@ Adicione mais regras de gasto para proteger o fluxo de caixa da empresa.`,
scanTestDriveTooltip: '<tooltip>Envie este recibo para\n<strong>concluir o test drive!</strong></tooltip>',
gpsTooltip: '<tooltip>Rastreamento por GPS em andamento! Quando terminar, pare o rastreamento abaixo.</tooltip>',
hasFilterNegation: '<tooltip>Pesquise despesas sem recibos usando <strong>-has:receipt</strong>.</tooltip>',
mileageRateAutoUpdated: '<tooltip>Nós atualizamos a taxa com base na sua data de viagem.</tooltip>',
},
discardChangesConfirmation: {
title: 'Descartar alterações?',
Expand Down
1 change: 1 addition & 0 deletions src/languages/zh-hans.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9242,6 +9242,7 @@ ${reportName}
scanTestDriveTooltip: '<tooltip>发送此收据以\n<strong>完成试用体验!</strong></tooltip>',
gpsTooltip: '<tooltip>正在进行 GPS 跟踪!完成后,请在下方停止跟踪。</tooltip>',
hasFilterNegation: '<tooltip>使用 <strong>-has:receipt</strong> 搜索没有收据的报销。</tooltip>',
mileageRateAutoUpdated: '<tooltip>我们已根据您的出行日期更新了汇率。</tooltip>',
},
discardChangesConfirmation: {
title: '放弃更改?',
Expand Down
1 change: 1 addition & 0 deletions src/libs/DebugUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1069,6 +1069,7 @@ function validateTransactionDraftProperty(key: keyof Transaction, value: string)
name: CONST.RED_BRICK_ROAD_PENDING_ACTION,
defaultP2PRate: CONST.RED_BRICK_ROAD_PENDING_ACTION,
distanceUnit: CONST.RED_BRICK_ROAD_PENDING_ACTION,
rateAutoUpdated: CONST.RED_BRICK_ROAD_PENDING_ACTION,
odometerStart: CONST.RED_BRICK_ROAD_PENDING_ACTION,
odometerEnd: CONST.RED_BRICK_ROAD_PENDING_ACTION,
odometerStartImage: CONST.RED_BRICK_ROAD_PENDING_ACTION,
Expand Down
4 changes: 3 additions & 1 deletion src/libs/actions/IOU/MoneyRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -615,7 +615,7 @@ function setMoneyRequestTimeCount(transactionID: string, count: number, isDraft:
* if passed transaction previously had it to make sure that transaction does not have inconsistent
* states (for example distanceUnit not matching distance unit of the new customUnitRateID)
*/
function setCustomUnitRateID(transactionID: string, customUnitRateID: string | undefined, transaction: OnyxEntry<Transaction>, policy: OnyxEntry<Policy>) {
function setCustomUnitRateID(transactionID: string, customUnitRateID: string | undefined, transaction: OnyxEntry<Transaction>, policy: OnyxEntry<Policy>, rateAutoUpdated = false) {
const isFakeP2PRate = customUnitRateID === CONST.CUSTOM_UNITS.FAKE_P2P_ID;

let newDistanceUnit: Unit | undefined;
Expand Down Expand Up @@ -652,6 +652,7 @@ function setCustomUnitRateID(transactionID: string, customUnitRateID: string | u
...(!isFakeP2PRate && {defaultP2PRate: null}),
distanceUnit: newDistanceUnit,
quantity: newQuantity,
rateAutoUpdated,
},
},
});
Expand Down Expand Up @@ -733,6 +734,7 @@ function setMoneyRequestDistanceRate(currentTransaction: OnyxEntry<Transaction>,
...(!!policy && {defaultP2PRate: null}),
...(newDistanceUnit && {distanceUnit: newDistanceUnit}),
...(newDistance && {quantity: newDistance}),
rateAutoUpdated: false,
},
},
});
Expand Down
3 changes: 2 additions & 1 deletion src/pages/iou/request/step/IOURequestStepDate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,8 @@ function IOURequestStepDate({
isTrackDistanceExpense: isTrackExpense,
expenseDate: newCreated,
});
setCustomUnitRateID(transactionID, rateID, transaction, effectivePolicy);
const currentRateID = transaction?.comment?.customUnit?.customUnitRateID;
setCustomUnitRateID(transactionID, rateID, transaction, effectivePolicy, rateID !== currentRateID);
}
}

Expand Down
4 changes: 3 additions & 1 deletion src/pages/iou/request/step/IOURequestStepDistanceRate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,11 @@ function IOURequestStepDistanceRate({
? effectiveRateID === rate.customUnitRateID && !hasUnitMismatchForMovingTrackExpense
: DistanceRequestUtils.getDefaultMileageRate(policy)?.customUnitRateID === rate.customUnitRateID;
const rateForDisplay = DistanceRequestUtils.getFormattedRateValue(unit, rate.rate, isSelected ? transactionCurrency : rate.currency, translate, toLocaleDigit, getCurrencySymbol);
const dateLabel = DistanceRequestUtils.getRateDateLabel(rate, translate);
const alternateText = [rate.name ? rateForDisplay : '', dateLabel].filter(Boolean).join(' • ');
return {
text: rate.name ?? rateForDisplay,
alternateText: rate.name ? rateForDisplay : '',
alternateText,
keyForList: rate.customUnitRateID ?? rateForDisplay,
value: rate.customUnitRateID,
isDisabled: !rate.enabled,
Expand Down
2 changes: 2 additions & 0 deletions src/styles/variables.ts
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,8 @@ export default {
hasFilterNegationTooltipShiftHorizontal: -16,
hasFilterNegationTooltipShiftVertical: 40,
hasFilterNegationTooltipMaxWidth: 260,
mileageRateTooltipShiftHorizontal: 12,
mileageRateTooltipShiftVertical: 4,

inlineImagePreviewMinSize: 64,
inlineImagePreviewMaxSize: 148,
Expand Down
18 changes: 16 additions & 2 deletions src/types/onyx/DismissedProductTraining.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
import CONST from '@src/CONST';

const {CONCIERGE_LHN_GBR, RENAME_SAVED_SEARCH, OUTSTANDING_FILTER, ACCOUNT_SWITCHER, SCAN_TEST_DRIVE_CONFIRMATION, MULTI_SCAN_EDUCATIONAL_MODAL, GPS_TOOLTIP, HAS_FILTER_NEGATION} =
CONST.PRODUCT_TRAINING_TOOLTIP_NAMES;
const {
CONCIERGE_LHN_GBR,
RENAME_SAVED_SEARCH,
OUTSTANDING_FILTER,
ACCOUNT_SWITCHER,
SCAN_TEST_DRIVE_CONFIRMATION,
MULTI_SCAN_EDUCATIONAL_MODAL,
GPS_TOOLTIP,
HAS_FILTER_NEGATION,
MILEAGE_RATE_AUTO_UPDATED,
} = CONST.PRODUCT_TRAINING_TOOLTIP_NAMES;

/**
* This type is used to store the timestamp of when the user dismisses a product training ui elements.
Expand Down Expand Up @@ -73,6 +82,11 @@ type DismissedProductTraining = {
* When user dismisses the Has filter negation tooltip, we store the timestamp here.
*/
[HAS_FILTER_NEGATION]: DismissedProductTrainingElement;

/**
* When user dismisses the mileage rate auto-updated tooltip, we store the timestamp here.
*/
[MILEAGE_RATE_AUTO_UPDATED]: DismissedProductTrainingElement;
};

export default DismissedProductTraining;
3 changes: 3 additions & 0 deletions src/types/onyx/Transaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,9 @@ type TransactionCustomUnit = {
/** The unit for the distance/quantity */
distanceUnit?: Unit;

/** Whether the rate was auto-updated due to a date change (used for tooltip display) */
rateAutoUpdated?: boolean;

/**
* The distance in meters from the route Mapbox or Google Maps chose through the user supplied waypoints.
* It is used to track when the user has manually increased the distance above the system-calculated route distance.
Expand Down
Loading