Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
0910f09
replace TransactionListItemRow with TransactionItemRow
SzymczakJ May 28, 2025
58ad29c
Merge branch 'main' into @szymczak/replace-TransactionListItemRow-wit…
SzymczakJ May 28, 2025
44ae0bb
fix uneven columns in Reports page
SzymczakJ May 28, 2025
03952b4
clean up ReportListItem and TransactionListItem
SzymczakJ May 29, 2025
edd1068
remove TransactionListItemRow
SzymczakJ May 29, 2025
3b3cf65
Merge branch 'main' into @szymczak/replace-TransactionListItemRow-wit…
SzymczakJ May 29, 2025
94d226d
refactor TransactionItemRow type
SzymczakJ May 29, 2025
204be2f
fix violation message overflowing chat bubble
SzymczakJ May 29, 2025
ad3b126
fix higlight new transactions highlight bug
SzymczakJ May 29, 2025
0744c7c
Merge branch 'main' into @szymczak/replace-TransactionListItemRow-wit…
SzymczakJ May 29, 2025
c170867
Merge branch 'main' into @szymczak/replace-TransactionListItemRow-wit…
SzymczakJ May 30, 2025
2b56309
fix PR comments
SzymczakJ May 30, 2025
767000b
fix MerchantCell and Type cell to match the Reports > Expenses requir…
SzymczakJ May 30, 2025
3dc032b
remove unused components
SzymczakJ May 30, 2025
4af5bf9
Merge branch 'main' into @szymczak/replace-TransactionListItemRow-wit…
SzymczakJ Jun 2, 2025
d573e3d
fix PR comments
SzymczakJ Jun 2, 2025
0e116be
Merge branch 'main' into @szymczak/replace-TransactionListItemRow-wit…
SzymczakJ Jun 2, 2025
69fd387
fix linter
SzymczakJ Jun 2, 2025
aa4bbd7
revert old prettier changes
SzymczakJ Jun 2, 2025
bcdfa6f
make TransactionItemRowRBR use small font on all window sizes
SzymczakJ Jun 2, 2025
5cca579
fix wrong from column
SzymczakJ Jun 3, 2025
be50743
fix TransactionItemRow category and RBR heights
SzymczakJ Jun 3, 2025
df7a7ba
fix PR comments
SzymczakJ Jun 3, 2025
9826c96
make TransactionItemRow accept passed transaction
SzymczakJ Jun 3, 2025
c59ec48
Merge branch 'main' into @szymczak/replace-TransactionListItemRow-wit…
SzymczakJ Jun 4, 2025
8b43627
update SearchUIUtilsTest to new action format
SzymczakJ Jun 4, 2025
c60d674
fix wrong color in item selection
SzymczakJ Jun 4, 2025
5ddb457
fix overflowing text
SzymczakJ Jun 4, 2025
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 cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,7 @@
"islarge",
"ismedium",
"isnonreimbursable",
"issmall",
"ITSM",
"Jakub",
"janky",
Expand Down
16 changes: 11 additions & 5 deletions src/components/HTMLEngineProvider/BaseHTMLEngineProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,12 @@ function BaseHTMLEngineProvider({textSelectable = false, children, enableExperim
}),
rbr: HTMLElementModel.fromCustomModel({
tagName: 'rbr',
mixedUAStyles: {...styles.formError, ...styles.mb0},
getMixedUAStyles: (tnode) => {
if (tnode.attributes.issmall === undefined) {
return {...styles.formError, ...styles.mb0};
}
return {...styles.formError, ...styles.mb0, ...styles.textMicro};
},
contentModel: HTMLContentModel.block,
}),
'muted-text': HTMLElementModel.fromCustomModel({
Expand Down Expand Up @@ -134,22 +139,23 @@ function BaseHTMLEngineProvider({textSelectable = false, children, enableExperim
}),
}),
[
styles.taskTitleMenuItem,
styles.formError,
styles.mb0,
styles.colorMuted,
styles.mutedNormalTextLabel,
styles.textLabelSupporting,
styles.lh16,
styles.textSupporting,
styles.textLineThrough,
styles.mutedNormalTextLabel,
styles.textMicro,
styles.onlyEmojisText,
styles.onlyEmojisTextLineHeight,
styles.taskTitleMenuItem,
styles.strong,
styles.taskTitleMenuItemItalic,
styles.em,
styles.strong,
styles.h1,
styles.blockquote,
styles.onlyEmojisTextLineHeight,
],
);
/* eslint-enable @typescript-eslint/naming-convention */
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
import React from 'react';
import {StyleSheet} from 'react-native';
import type {TextStyle} from 'react-native';
import type {CustomRendererProps, TPhrasing, TText} from 'react-native-render-html';
import {TNodeChildrenRenderer} from 'react-native-render-html';
import Text from '@components/Text';
import useThemeStyles from '@hooks/useThemeStyles';

function RBRRenderer({tnode}: CustomRendererProps<TText | TPhrasing>) {
function RBRRenderer({tnode, style}: CustomRendererProps<TText | TPhrasing>) {
const styles = useThemeStyles();
const htmlAttribs = tnode.attributes;
const shouldShowEllipsis = htmlAttribs?.shouldshowellipsis !== undefined;
const flattenStyle = StyleSheet.flatten(style as TextStyle);

return (
<TNodeChildrenRenderer
Expand All @@ -18,7 +21,7 @@ function RBRRenderer({tnode}: CustomRendererProps<TText | TPhrasing>) {
numberOfLines={shouldShowEllipsis ? 1 : 0}
ellipsizeMode="tail"
key={props.key}
style={[styles.textLabelError]}
style={[styles.textLabelError, flattenStyle]}
>
{props.childElement}
</Text>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,7 @@ function MoneyRequestReportTransactionList({
onCheckboxPress={toggleTransaction}
columns={allReportColumns}
scrollToNewTransaction={transaction.transactionID === newTransactions?.at(0)?.transactionID ? scrollToNewTransaction : undefined}
isInReportTableView
/>
</PressableWithFeedback>
);
Expand Down
10 changes: 5 additions & 5 deletions src/components/Search/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,11 @@ function mapTransactionItemToSelectedEntry(item: TransactionListItemType, report
];
}

function mapToTransactionItemWithSelectionInfo(item: TransactionListItemType, selectedTransactions: SelectedTransactions, canSelectMultiple: boolean, shouldAnimateInHighlight: boolean) {
function mapToTransactionItemWithAdditionalInfo(item: TransactionListItemType, selectedTransactions: SelectedTransactions, canSelectMultiple: boolean, shouldAnimateInHighlight: boolean) {
return {...item, shouldAnimateInHighlight, isSelected: selectedTransactions[item.keyForList]?.isSelected && canSelectMultiple};
}

function mapToItemWithSelectionInfo(item: SearchListItem, selectedTransactions: SelectedTransactions, canSelectMultiple: boolean, shouldAnimateInHighlight: boolean) {
function mapToItemWithAdditionalInfo(item: SearchListItem, selectedTransactions: SelectedTransactions, canSelectMultiple: boolean, shouldAnimateInHighlight: boolean) {
if (isTaskListItemType(item)) {
return {
...item,
Expand All @@ -99,11 +99,11 @@ function mapToItemWithSelectionInfo(item: SearchListItem, selectedTransactions:
}

return isTransactionListItemType(item)
? mapToTransactionItemWithSelectionInfo(item, selectedTransactions, canSelectMultiple, shouldAnimateInHighlight)
? mapToTransactionItemWithAdditionalInfo(item, selectedTransactions, canSelectMultiple, shouldAnimateInHighlight)
: {
...item,
shouldAnimateInHighlight,
transactions: item.transactions?.map((transaction) => mapToTransactionItemWithSelectionInfo(transaction, selectedTransactions, canSelectMultiple, shouldAnimateInHighlight)),
transactions: item.transactions?.map((transaction) => mapToTransactionItemWithAdditionalInfo(transaction, selectedTransactions, canSelectMultiple, shouldAnimateInHighlight)),
isSelected: item?.transactions?.length > 0 && item.transactions?.every((transaction) => selectedTransactions[transaction.keyForList]?.isSelected && canSelectMultiple),
};
}
Expand Down Expand Up @@ -502,7 +502,7 @@ function Search({queryJSON, currentSearchResults, lastNonEmptySearchResults, onS
// Determine if either the base key or any transaction key matches
const shouldAnimateInHighlight = isBaseKeyMatch || isAnyTransactionMatch;

return mapToItemWithSelectionInfo(item, selectedTransactions, canSelectMultiple, shouldAnimateInHighlight);
return mapToItemWithAdditionalInfo(item, selectedTransactions, canSelectMultiple, shouldAnimateInHighlight);
});

const hasErrors = Object.keys(searchResults?.errors ?? {}).length > 0 && !isOffline;
Expand Down
106 changes: 0 additions & 106 deletions src/components/SelectionList/Search/ExpenseItemHeaderNarrow.tsx

This file was deleted.

9 changes: 3 additions & 6 deletions src/components/SelectionList/Search/ReportListItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import useResponsiveLayout from '@hooks/useResponsiveLayout';
import useTheme from '@hooks/useTheme';
import useThemeStyles from '@hooks/useThemeStyles';
import Navigation from '@libs/Navigation/Navigation';
import shouldShowTransactionYear from '@libs/TransactionUtils/shouldShowTransactionYear';
import variables from '@styles/variables';
import CONST from '@src/CONST';
import ONYXKEYS from '@src/ONYXKEYS';
Expand Down Expand Up @@ -44,8 +43,7 @@ function ReportListItem<TItem extends ListItem>({
const {isLargeScreenWidth} = useResponsiveLayout();

const dateColumnSize = useMemo(() => {
const shouldShowYearForSomeTransaction = reportItem.transactions.some((transaction) => shouldShowTransactionYear(transaction));
return shouldShowYearForSomeTransaction ? CONST.SEARCH.TABLE_COLUMN_SIZES.WIDE : CONST.SEARCH.TABLE_COLUMN_SIZES.NORMAL;
return reportItem.transactions.some((transaction) => transaction.shouldShowYear) ? CONST.SEARCH.TABLE_COLUMN_SIZES.WIDE : CONST.SEARCH.TABLE_COLUMN_SIZES.NORMAL;
}, [reportItem.transactions]);

const animatedHighlightStyle = useAnimatedHighlightStyle({
Expand Down Expand Up @@ -102,7 +100,7 @@ function ReportListItem<TItem extends ListItem>({
...(sampleTransaction?.shouldShowTax ? [COLUMNS.TAX] : []),
COLUMNS.TOTAL_AMOUNT,
COLUMNS.ACTION,
] as Array<ValueOf<typeof COLUMNS>>;
] satisfies Array<ValueOf<typeof COLUMNS>>;

return (
<BaseListItem
Expand All @@ -129,7 +127,6 @@ function ReportListItem<TItem extends ListItem>({
<ReportListItemHeader
report={reportItem}
policy={policy}
item={item}
onSelectRow={onSelectRow}
onCheckboxPress={onCheckboxPress}
isDisabled={isDisabledOrEmpty}
Expand Down Expand Up @@ -163,7 +160,7 @@ function ReportListItem<TItem extends ListItem>({
}}
isParentHovered={hovered}
columnWrapperStyles={[styles.ph3, styles.pv1half]}
isInReportRow
isReportItemChild
/>
</View>
))
Expand Down
Loading