Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
0997af1
fix: Reports - Highlight animation is visible on added expense after …
TaduJR Jun 26, 2026
1e120c0
Merge branch 'main' of https://github.com/TaduJR/App into fix-Reports…
TaduJR Jun 26, 2026
d361e64
Merge branch 'main' of https://github.com/TaduJR/App into fix-Reports…
TaduJR Jun 27, 2026
772ba27
fix: drop successData clear of pendingNewTransactionIDs to avoid raci…
TaduJR Jun 27, 2026
9aace7d
fix: fall through to diff when pending rail holds only cleared tombst…
TaduJR Jun 28, 2026
1729366
fix: clear pending rail only from a focused consumer
TaduJR Jun 28, 2026
95d362c
fix: gate highlight rail to multi-tx adds and union it with the rende…
TaduJR Jun 28, 2026
19a87c8
fix: keep unfocused consumers silent so a background preview can't fl…
TaduJR Jun 28, 2026
cd678cd
Merge branch 'main' of https://github.com/TaduJR/App into fix-Reports…
TaduJR Jun 30, 2026
1f092c1
fix: highlight the new row in the background regardless of focus
TaduJR Jun 30, 2026
6f32479
Merge branch 'main' of https://github.com/TaduJR/App into fix-Reports…
TaduJR Jul 5, 2026
fcac4e9
fix: show the new-row highlight per device background on wide, on-clo…
TaduJR Jul 5, 2026
b177dbc
fix: gate the report-preview highlight on visibility so it can't play…
TaduJR Jul 5, 2026
0ecd8b7
fix: don't flash single-expense RHPs at super-wide while transactions…
TaduJR Jul 5, 2026
0c10b07
Merge branch 'main' of https://github.com/TaduJR/App into fix-Reports…
TaduJR Jul 12, 2026
7957678
refactor: drop redundant useCallback from useRHPWidth
TaduJR Jul 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
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,9 @@ function MoneyRequestReportActionsList({onLayout}: MoneyRequestReportListProps)
const didLayout = useRef(false);
const [isVisible, setIsVisible] = useState(Visibility.isVisible);
const isFocused = useIsFocused();
const {shouldUseNarrowLayout} = useResponsiveLayoutOnWideRHP();
// The table is visible whenever it's wide, or — on narrow — only when focused (the RHP has closed).
const isReportVisible = shouldUseNarrowLayout ? isFocused : true;
const route = useRoute<PlatformStackRouteProp<ReportsSplitNavigatorParamList, typeof SCREENS.REPORT>>();
const reportIDFromRoute = route?.params?.reportID;

Expand Down Expand Up @@ -160,8 +163,6 @@ function MoneyRequestReportActionsList({onLayout}: MoneyRequestReportListProps)
const canPerformWriteAction = canUserPerformWriteAction(report, isReportArchived);
const [visibleReportActionsData] = useOnyx(ONYXKEYS.DERIVED.VISIBLE_REPORT_ACTIONS);

const {shouldUseNarrowLayout} = useResponsiveLayoutOnWideRHP();

const [reportNameValuePairs] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT_NAME_VALUE_PAIRS}${getNonEmptyStringOnyxID(reportID)}`);
const shouldShowHarvestCreatedAction = isHarvestCreatedExpenseReport(reportNameValuePairs?.origin, reportNameValuePairs?.originalID);
const [enableScrollToEnd, setEnableScrollToEnd] = useState<boolean>(false);
Expand Down Expand Up @@ -753,6 +754,7 @@ function MoneyRequestReportActionsList({onLayout}: MoneyRequestReportListProps)
onLayout={onLayout}
transactions={transactions}
newTransactions={newTransactions}
isReportVisible={isReportVisible}
hasPendingDeletionTransaction={hasPendingDeletionTransaction}
reportActions={reportActions}
scrollToNewTransaction={scrollToNewTransaction}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,9 @@ type MoneyRequestReportTransactionListProps = {
/** List of transactions that arrived when the report was open */
newTransactions: OnyxTypes.Transaction[];

/** Whether the report table is visible — gates the new-row highlight (background on wide, on-close on narrow) */
isReportVisible?: boolean;

/** Array of report actions for the report that these transactions belong to */
reportActions: OnyxTypes.ReportAction[];

Expand Down Expand Up @@ -167,6 +170,7 @@ function MoneyRequestReportTransactionList({
report,
transactions,
newTransactions,
isReportVisible = true,
reportActions,
hasPendingDeletionTransaction = false,
scrollToNewTransaction,
Expand Down Expand Up @@ -706,7 +710,7 @@ function MoneyRequestReportTransactionList({
key={transaction.transactionID}
transaction={transaction}
violations={violationsByTransactionID.get(transaction.transactionID) ?? EMPTY_VIOLATIONS}
shouldBeHighlighted={highlightedTransactionIDs.has(transaction.transactionID)}
shouldBeHighlighted={isReportVisible && highlightedTransactionIDs.has(transaction.transactionID)}
columns={columnsToShow}
report={report}
policy={policy}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ function MoneyRequestReportTransactionsNavigation({currentTransactionID, isFromR
const [introSelected] = useOnyx(ONYXKEYS.NVP_INTRO_SELECTED);
const [betas] = useOnyx(ONYXKEYS.BETAS);
const {email: currentUserEmail, accountID: currentUserAccountID} = useCurrentUserPersonalDetails();
const {markReportIDAsExpense} = useWideRHPActions();
const {markReportRHPWidth} = useWideRHPActions();

const {prevTransactionID, nextTransactionID} = useMemo(() => {
if (!transactionIDsList || transactionIDsList.length < 2) {
Expand Down Expand Up @@ -142,7 +142,7 @@ function MoneyRequestReportTransactionsNavigation({currentTransactionID, isFromR
if (nextDescriptor) {
requestAnimationFrame(() => {
const nextReportID = getReportIDToOpenForExpense(nextDescriptor, {introSelected, betas, currentUserEmail, currentUserAccountID});
markReportIDAsExpense(nextReportID);
markReportRHPWidth(nextReportID, 'wide');
requestAnimationFrame(() => startTransition(() => Navigation.setParams({reportID: nextReportID, reportActionID: undefined, backTo})));
});
return;
Expand All @@ -153,7 +153,7 @@ function MoneyRequestReportTransactionsNavigation({currentTransactionID, isFromR

requestAnimationFrame(() => {
if (nextThreadReportID) {
markReportIDAsExpense(nextThreadReportID);
markReportRHPWidth(nextThreadReportID, 'wide');
}
// We know that the next thread report exists, it just wasn't fetched to Onyx yet, so we set it optimistically.
if (!nextThreadReport && nextThreadReportID) {
Expand Down Expand Up @@ -192,7 +192,7 @@ function MoneyRequestReportTransactionsNavigation({currentTransactionID, isFromR
if (prevDescriptor) {
requestAnimationFrame(() => {
const prevReportID = getReportIDToOpenForExpense(prevDescriptor, {introSelected, betas, currentUserEmail, currentUserAccountID});
markReportIDAsExpense(prevReportID);
markReportRHPWidth(prevReportID, 'wide');
requestAnimationFrame(() => startTransition(() => Navigation.setParams({reportID: prevReportID, reportActionID: undefined, backTo})));
});
return;
Expand All @@ -203,7 +203,7 @@ function MoneyRequestReportTransactionsNavigation({currentTransactionID, isFromR

requestAnimationFrame(() => {
if (prevThreadReportID) {
markReportIDAsExpense(prevThreadReportID);
markReportRHPWidth(prevThreadReportID, 'wide');
}
// We know that the previous thread report exists, it just wasn't fetched to Onyx yet, so we set it optimistically.
if (!prevThreadReport && prevThreadReportID) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,9 @@ function MoneyRequestReportPreview({
});
const isFocused = useIsFocused();
const newTransactions = useNewTransactions(hasOnceLoadedReportActions, transactions, pendingNewTransactionIDs, chatReportID, isFocused);
const newTransactionIDs = new Set(newTransactions.map((transaction) => transaction.transactionID));
// Don't surface the highlight while the preview is covered — it'd animate the one-shot off-screen and be missed.
const isReportVisible = shouldUseNarrowLayout ? isFocused : true;
const newTransactionIDs = new Set(isReportVisible ? newTransactions.map((transaction) => transaction.transactionID) : []);

const transactionPreviewContainerStyles = [styles.h100, reportPreviewStyles.transactionPreviewCarouselStyle];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ function TransactionGroupListExpanded<TItem extends ListItem>({

const isActionColumnWide = transactions.some((transaction) => !!transaction.isActionColumnWide || isDeletedTransaction(transaction));

const {markReportIDAsExpense} = useWideRHPActions();
const {markReportRHPWidth} = useWideRHPActions();
const selectRow = onSelectRow as (item: TItem, transactionPreviewData?: TransactionPreviewData, event?: ModifiedMouseEvent) => void;
const getTransactionPreviewData = (transactionItem: TransactionListItemType): TransactionPreviewData => {
const parentReportAction = getReportAction(transactionItem?.reportID, transactionItem?.reportAction?.reportActionID);
Expand Down Expand Up @@ -222,7 +222,7 @@ function TransactionGroupListExpanded<TItem extends ListItem>({
});
return;
}
markReportIDAsExpense(reportID);
markReportRHPWidth(reportID, 'wide');
const route = ROUTES.SEARCH_REPORT.getRoute({reportID, backTo});
if (openInternalRouteInNewTab(route, event)) {
return;
Expand Down
13 changes: 6 additions & 7 deletions src/components/Search/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ function Search({
const navigation = useNavigation<PlatformStackNavigationProp<SearchFullscreenNavigatorParamList>>();
const isFocused = useIsFocused();

const {markReportIDAsExpense, markReportIDAsMultiTransactionExpense, unmarkReportIDAsMultiTransactionExpense} = useWideRHPActions();
const {markReportRHPWidth, unmarkReportRHPWidth} = useWideRHPActions();
const {currentSearchHash, currentSearchKey, shouldResetSearchQuery, suggestedSearches} = useSearchQueryContext();
const {lastSearchType, shouldUseLiveData} = useSearchResultsContext();

Expand Down Expand Up @@ -597,9 +597,9 @@ function Search({
}

if (item.transactions.length > 1) {
markReportIDAsMultiTransactionExpense(reportID);
markReportRHPWidth(reportID, 'super-wide');
} else {
unmarkReportIDAsMultiTransactionExpense(reportID);
unmarkReportRHPWidth(reportID, 'super-wide');
}

// Persist the current search context so prev/next navigation arrows
Expand Down Expand Up @@ -644,7 +644,7 @@ function Search({
return;
}

markReportIDAsExpense(reportID);
markReportRHPWidth(reportID, 'wide');

if (isTransactionItem && transactionPreviewData) {
setOptimisticDataForTransactionThreadPreview(transactionItem, transactionPreviewData, transactionItem?.reportAction?.childReportID);
Expand All @@ -657,10 +657,9 @@ function Search({
requestAnimationFrame(() => Navigation.navigate(route));
},
[
markReportIDAsExpense,
markReportRHPWidth,
handleSearch,
markReportIDAsMultiTransactionExpense,
unmarkReportIDAsMultiTransactionExpense,
unmarkReportRHPWidth,
introSelected,
betas,
isSelfTourViewed,
Expand Down
14 changes: 5 additions & 9 deletions src/components/WideRHPContextProvider/default.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,11 @@ const defaultWideRHPStateContextValue: WideRHPStateContextType = {
};

const defaultWideRHPActionsContextValue: WideRHPActionsContextType = {
showWideRHPVersion: () => {},
showSuperWideRHPVersion: () => {},
removeWideRHPRouteKey: () => {},
removeSuperWideRHPRouteKey: () => {},
markReportIDAsExpense: () => {},
markReportIDAsMultiTransactionExpense: () => {},
unmarkReportIDAsMultiTransactionExpense: () => {},
isReportIDMarkedAsExpense: () => false,
isReportIDMarkedAsMultiTransactionExpense: () => false,
setRHPWidth: () => {},
removeRHPRouteKey: () => {},
markReportRHPWidth: () => {},
unmarkReportRHPWidth: () => {},
getReportRHPWidthHint: () => undefined,
syncRHPKeys: () => {},
clearWideRHPKeys: () => {},
setIsWideRHPClosing: () => {},
Expand Down
Loading
Loading