Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
c43082f
Merge pull request #61170 from Expensify/jsenyitko-search-lhn-suggest…
luacmartins May 22, 2025
5d324b4
Merge branch 'main' of github.com:Expensify/App into jsenyitko-sugges…
JS00001 May 27, 2025
90420eb
Merge pull request #61170 from Expensify/jsenyitko-search-lhn-suggest…
luacmartins May 22, 2025
c917ef0
update status search and grouping
JS00001 May 27, 2025
d0dcf06
fix clear button
JS00001 May 27, 2025
da2b21c
fix suggested search with savged serch
JS00001 May 27, 2025
dcf863d
fix self not being included
JS00001 May 27, 2025
c0d9d6a
fix keyboard on web
JS00001 May 27, 2025
9a04fa8
fix caret wrapper
JS00001 May 27, 2025
0c4d9fc
fix keyboard persisting taps, fix popup autofocus
JS00001 May 27, 2025
e190e84
add beta for report view
JS00001 May 27, 2025
c0af38a
fix user selection size
JS00001 May 27, 2025
95b0812
Merge branch 'main' of github.com:Expensify/App into jsenyitko-sugges…
JS00001 May 27, 2025
807410e
fix eslint & typescript
JS00001 May 27, 2025
78f9d68
fix selfdm issue
JS00001 May 27, 2025
6149f58
fix tests, dont use wrong properties
JS00001 May 27, 2025
24393a2
fix mobile boldness
JS00001 May 28, 2025
341e614
Merge branch 'main' of github.com:Expensify/App into jsenyitko-sugges…
JS00001 May 28, 2025
79c41b6
fix text overflow on web
JS00001 May 28, 2025
309d7c0
fix dropdown on web
JS00001 May 28, 2025
a67db46
smooth out keyboard on web
JS00001 May 28, 2025
fba379b
fix filters bar including invoice
JS00001 May 28, 2025
a3c020c
fix empty report state
JS00001 May 29, 2025
63a9488
fix suggested search
JS00001 May 29, 2025
458c3b6
fix saved & suggested on mobile
JS00001 May 29, 2025
f951c31
Merge branch 'main' of github.com:Expensify/App into jsenyitko-sugges…
JS00001 May 29, 2025
e6ab699
fix input positioning
JS00001 May 29, 2025
e5fa9c2
fix lint
JS00001 May 29, 2025
c447aca
put user at top of list
JS00001 May 29, 2025
47ba220
remove submodule
JS00001 May 29, 2025
e3f084f
prettier fix
JS00001 May 29, 2025
6e7042c
fix crash
JS00001 May 29, 2025
53f168e
update create report to be behind beta
JS00001 May 29, 2025
0149a57
remove initial states, update stable key & types
JS00001 May 29, 2025
270e0c2
add comments, remove beta in search utils, cleanup conditions in use …
JS00001 May 29, 2025
5e5407a
fix helpdocs
JS00001 May 29, 2025
1502dab
Merge branch 'main' of github.com:Expensify/App into jsenyitko-sugges…
JS00001 May 30, 2025
5853b82
Merge branch 'main' of github.com:Expensify/App into jsenyitko-sugges…
JS00001 May 30, 2025
5cae141
Merge branch 'main' of github.com:Expensify/App into jsenyitko-sugges…
JS00001 May 30, 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
12 changes: 9 additions & 3 deletions src/CONST.ts
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,9 @@ const CONST = {
horizontal: 12 + variables.navigationTabBarSize,
vertical: 72,
},
POPOVER_DROPDOWN_WIDTH: 336,
POPOVER_DROPDOWN_MIN_HEIGHT: 0,
POPOVER_DROPDOWN_MAX_HEIGHT: 416,
POPOVER_DATE_WIDTH: 338,
POPOVER_DATE_MAX_HEIGHT: 366,
POPOVER_DATE_MIN_HEIGHT: 322,
Expand Down Expand Up @@ -6531,6 +6534,7 @@ const CONST = {
},

SEARCH: {
NEVER: 'never',
RESULTS_PAGE_SIZE: 50,
DATA_TYPES: {
EXPENSE: 'expense',
Expand Down Expand Up @@ -6627,7 +6631,6 @@ const CONST = {
TAX_AMOUNT: 'taxAmount',
TITLE: 'title',
ASSIGNEE: 'assignee',
CREATED_BY: 'createdBy',
IN: 'in',
},
SYNTAX_OPERATORS: {
Expand Down Expand Up @@ -6656,6 +6659,8 @@ const CONST = {
DESCRIPTION: 'description',
FROM: 'from',
TO: 'to',
PAYER: 'payer',
EXPORTER: 'exporter',
CATEGORY: 'category',
TAG: 'tag',
TAX_RATE: 'taxRate',
Expand All @@ -6671,7 +6676,6 @@ const CONST = {
POSTED: 'posted',
TITLE: 'title',
ASSIGNEE: 'assignee',
CREATED_BY: 'createdBy',
REIMBURSABLE: 'reimbursable',
BILLABLE: 'billable',
POLICY_ID: 'policyID',
Expand All @@ -6697,6 +6701,8 @@ const CONST = {
DESCRIPTION: 'description',
FROM: 'from',
TO: 'to',
PAYER: 'payer',
EXPORTER: 'exporter',
CATEGORY: 'category',
TAG: 'tag',
TAX_RATE: 'tax-rate',
Expand All @@ -6712,13 +6718,13 @@ const CONST = {
POSTED: 'posted',
TITLE: 'title',
ASSIGNEE: 'assignee',
CREATED_BY: 'created-by',
REIMBURSABLE: 'reimbursable',
BILLABLE: 'billable',
},
DATE_MODIFIERS: {
BEFORE: 'Before',
AFTER: 'After',
ON: 'On',
},
SNAPSHOT_ONYX_KEYS: [
ONYXKEYS.COLLECTION.REPORT,
Expand Down
1 change: 0 additions & 1 deletion src/ROUTES.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ const ROUTES = {
SEARCH_ADVANCED_FILTERS_POSTED: 'search/filters/posted',
SEARCH_ADVANCED_FILTERS_TITLE: 'search/filters/title',
SEARCH_ADVANCED_FILTERS_ASSIGNEE: 'search/filters/assignee',
SEARCH_ADVANCED_FILTERS_CREATED_BY: 'search/filters/createdBy',
SEARCH_ADVANCED_FILTERS_REIMBURSABLE: 'search/filters/reimbursable',
SEARCH_ADVANCED_FILTERS_BILLABLE: 'search/filters/billable',
SEARCH_ADVANCED_FILTERS_WORKSPACE: 'search/filters/workspace',
Expand Down
1 change: 0 additions & 1 deletion src/SCREENS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ const SCREENS = {
ADVANCED_FILTERS_TO_RHP: 'Search_Advanced_Filters_To_RHP',
ADVANCED_FILTERS_TITLE_RHP: 'Search_Advanced_Filters_Title_RHP',
ADVANCED_FILTERS_ASSIGNEE_RHP: 'Search_Advanced_Filters_Assignee_RHP',
ADVANCED_FILTERS_CREATED_BY_RHP: 'Search_Advanced_Filters_Created_By_RHP',
ADVANCED_FILTERS_REIMBURSABLE_RHP: 'Search_Advanced_Filters_Reimbursable_RHP',
ADVANCED_FILTERS_BILLABLE_RHP: 'Search_Advanced_Filters_Billable_RHP',
ADVANCED_FILTERS_WORKSPACE_RHP: 'Search_Advanced_Filters_Workspace_RHP',
Expand Down
6 changes: 3 additions & 3 deletions src/components/Button/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -294,12 +294,12 @@ function Button(
danger && styles.buttonDangerText,
!!icon && styles.textAlignLeft,
!!secondLineText && styles.noPaddingBottom,
textStyles,
isHovered && textHoverStyles,
link && styles.link,
link && isHovered && StyleUtils.getColorStyle(theme.linkHover),
link && styles.fontWeightNormal,
link && styles.fontSizeLabel,
textStyles,
link && styles.link,
link && isHovered && StyleUtils.getColorStyle(theme.linkHover),
]}
dataSet={{[CONST.SELECTION_SCRAPER_HIDDEN_ELEMENT]: true}}
>
Expand Down
4 changes: 2 additions & 2 deletions src/components/CaretWrapper.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import type {ViewStyle} from 'react-native';
import type {StyleProp, ViewStyle} from 'react-native';
import {View} from 'react-native';
import useTheme from '@hooks/useTheme';
import useThemeStyles from '@hooks/useThemeStyles';
Expand All @@ -9,7 +9,7 @@ import Icon from './Icon';
import * as Expensicons from './Icon/Expensicons';

type CaretWrapperProps = ChildrenProps & {
style?: ViewStyle;
style?: StyleProp<ViewStyle>;
};

function CaretWrapper({children, style}: CaretWrapperProps) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ function YearPickerModal({isVisible, years, currentYear = new Date().getFullYear
hideModalContentWhileAnimating
useNativeDriver
shouldHandleNavigationBack
shouldUseCustomBackdrop
onBackdropPress={onClose}
enableEdgeToEdgeBottomSafeAreaPadding
>
<ScreenWrapper
Expand Down
1 change: 1 addition & 0 deletions src/components/EmptyStateComponent/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ function EmptyStateComponent({
<View style={[styles.gap2, styles.mt5, !shouldUseNarrowLayout ? styles.flexRow : styles.mhAuto]}>
{buttons?.map(({buttonText, buttonAction, success, icon, isDisabled, style}) => (
<Button
key={buttonText}
success={success}
onPress={buttonAction}
text={buttonText}
Expand Down
6 changes: 3 additions & 3 deletions src/components/EmptyStateComponent/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ import type IconAsset from '@src/types/utils/IconAsset';

type ValidSkeletons = typeof SearchRowSkeleton | typeof TableRowSkeleton;
type MediaTypes = ValueOf<typeof CONST.EMPTY_STATE_MEDIA>;
type Button = {buttonText?: string; buttonAction?: () => void; success?: boolean; icon?: IconAsset; isDisabled?: boolean; style?: StyleProp<ViewStyle>};
type EmptyStateButton = {buttonText?: string; buttonAction?: () => void; success?: boolean; icon?: IconAsset; isDisabled?: boolean; style?: StyleProp<ViewStyle>};

type SharedProps<T> = {
SkeletonComponent?: ValidSkeletons;
title: string;
titleStyles?: StyleProp<TextStyle>;
subtitle?: string;
children?: React.ReactNode;
buttons?: Button[];
buttons?: EmptyStateButton[];
containerStyles?: StyleProp<ViewStyle>;
cardStyles?: StyleProp<ViewStyle>;
cardContentStyles?: StyleProp<ViewStyle>;
Expand Down Expand Up @@ -45,4 +45,4 @@ type VideoLoadedEventType = {
};
};

export type {EmptyStateComponentProps, VideoLoadedEventType};
export type {EmptyStateComponentProps, VideoLoadedEventType, EmptyStateButton};
16 changes: 12 additions & 4 deletions src/components/MenuItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -502,10 +502,12 @@ function MenuItem(
const {isExecuting, singleExecution, waitForNavigate} = useContext(MenuItemGroupContext) ?? {};
const popoverAnchor = useRef<View>(null);

const isCompact = viewMode === CONST.OPTION_MODE.COMPACT;
const isDeleted = style && Array.isArray(style) ? style.includes(styles.offlineFeedback.deleted) : false;
const descriptionVerticalMargin = shouldShowDescriptionOnTop ? styles.mb1 : styles.mt1;
const fallbackAvatarSize = viewMode === CONST.OPTION_MODE.COMPACT ? CONST.AVATAR_SIZE.SMALL : CONST.AVATAR_SIZE.DEFAULT;
const fallbackAvatarSize = isCompact ? CONST.AVATAR_SIZE.SMALL : CONST.AVATAR_SIZE.DEFAULT;
const firstRightIcon = floatRightAvatars.at(0);

const combinedTitleTextStyle = StyleUtils.combineStyles(
[
styles.flexShrink1,
Expand Down Expand Up @@ -663,6 +665,8 @@ function MenuItem(
containerStyle,
combinedStyle,
!interactive && styles.cursorDefault,
isCompact && styles.alignItemsCenter,
isCompact && styles.optionRowCompact,
!shouldRemoveBackground &&
StyleUtils.getButtonBackgroundColorStyle(getButtonState(focused || isHovered, pressed, success, disabled, interactive), true),
...(Array.isArray(wrapperStyle) ? wrapperStyle : [wrapperStyle]),
Expand Down Expand Up @@ -797,7 +801,7 @@ function MenuItem(
style={[
styles.justifyContentCenter,
styles.flex1,
StyleUtils.getMenuItemTextContainerStyle(isSmallAvatarSubscriptMenu),
StyleUtils.getMenuItemTextContainerStyle(isSmallAvatarSubscriptMenu || isCompact),
titleContainerStyle,
]}
>
Expand Down Expand Up @@ -869,7 +873,7 @@ function MenuItem(
</View>
</View>
</View>
<View style={[styles.flexRow, styles.menuItemTextContainer, !hasPressableRightComponent && styles.pointerEventsNone]}>
<View style={[styles.flexRow, StyleUtils.getMenuItemTextContainerStyle(isCompact), !hasPressableRightComponent && styles.pointerEventsNone]}>
{!!badgeText && (
<Badge
text={badgeText}
Expand Down Expand Up @@ -919,7 +923,11 @@ function MenuItem(
)}
{shouldShowRightIcon && (
<View
style={[styles.popoverMenuIcon, styles.pointerEventsAuto, disabled && !shouldUseDefaultCursorWhenDisabled && styles.cursorDisabled]}
style={[
styles.pointerEventsAuto,
StyleUtils.getMenuItemIconStyle(isCompact),
disabled && !shouldUseDefaultCursorWhenDisabled && styles.cursorDisabled,
]}
>
<Icon
src={iconRight}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ const shouldShowColumnConfig: Record<SortableColumnName, (isIOUReport: boolean)
[CONST.SEARCH.TABLE_COLUMNS.ACTION]: () => false,
[CONST.SEARCH.TABLE_COLUMNS.TITLE]: () => false,
[CONST.SEARCH.TABLE_COLUMNS.ASSIGNEE]: () => false,
[CONST.SEARCH.TABLE_COLUMNS.CREATED_BY]: () => false,
};

const columnConfig: ColumnConfig[] = [
Expand Down
1 change: 1 addition & 0 deletions src/components/PopoverMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,7 @@ function PopoverMenu({

const renderedMenuItems = currentMenuItems.map((item, menuIndex) => {
const {text, onSelected, subMenuItems, shouldCallAfterModalHide, key, testID: menuItemTestID, ...menuItemProps} = item;

return (
<OfflineWithFeedback
// eslint-disable-next-line react/no-array-index-key
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
import React, {useState} from 'react';
import {View} from 'react-native';
import Button from '@components/Button';
import CalendarPicker from '@components/DatePicker/CalendarPicker';
import HeaderWithBackButton from '@components/HeaderWithBackButton';
import useLocalize from '@hooks/useLocalize';
import useResponsiveLayout from '@hooks/useResponsiveLayout';
import useThemeStyles from '@hooks/useThemeStyles';
import type {SearchDateModifier, SearchDateModifierLower} from '@libs/SearchUIUtils';
import CONST from '@src/CONST';

type CalendarViewProps = {
view: SearchDateModifier;
value: string | null;
navigateBack: () => void;
setValue: (key: SearchDateModifier, value: string | null) => void;
};

function CalendarView({view, value, navigateBack, setValue}: CalendarViewProps) {
const styles = useThemeStyles();
const {translate} = useLocalize();
const {shouldUseNarrowLayout} = useResponsiveLayout();
const [localDateValue, setLocalDateValue] = useState(value);

const lowerDateModifier = view.toLowerCase() as SearchDateModifierLower;

const resetChanges = () => {
setValue(view, null);
navigateBack();
};

const saveChanges = () => {
setValue(view, localDateValue);
navigateBack();
};

return (
<View style={[!shouldUseNarrowLayout && styles.pv4]}>
<HeaderWithBackButton
shouldDisplayHelpButton={false}
style={[styles.h10, styles.pb3]}
subtitle={translate(`common.${lowerDateModifier}`)}
onBackButtonPress={navigateBack}
/>

<CalendarPicker
value={localDateValue ?? undefined}
onSelected={setLocalDateValue}
maxDate={CONST.CALENDAR_PICKER.MAX_DATE}
minDate={CONST.CALENDAR_PICKER.MIN_DATE}
/>

<View style={[styles.flexRow, styles.gap2, styles.ph5, styles.pt2]}>
<Button
medium
style={[styles.flex1]}
text={translate('common.reset')}
onPress={resetChanges}
/>
<Button
success
medium
style={[styles.flex1]}
text={translate('common.save')}
onPress={saveChanges}
/>
</View>
</View>
);
}

CalendarView.displayName = 'CalendarView';
export default CalendarView;
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
import React from 'react';
import {View} from 'react-native';
import Button from '@components/Button';
import MenuItem from '@components/MenuItem';
import Text from '@components/Text';
import useLocalize from '@hooks/useLocalize';
import useResponsiveLayout from '@hooks/useResponsiveLayout';
import useThemeStyles from '@hooks/useThemeStyles';
import type {SearchDateModifier, SearchDateModifierLower} from '@libs/SearchUIUtils';
import CONST from '@src/CONST';
import type {DateSelectPopupValue} from '.';

type RootViewProps = {
value: DateSelectPopupValue;
applyChanges: () => void;
resetChanges: () => void;
setView: (view: SearchDateModifier) => void;
};

function RootView({value, applyChanges, resetChanges, setView}: RootViewProps) {
const styles = useThemeStyles();
const {translate} = useLocalize();
const {shouldUseNarrowLayout} = useResponsiveLayout();

const label = translate('common.date');

return (
<View style={[!shouldUseNarrowLayout && styles.pv4, styles.gap2]}>
{shouldUseNarrowLayout && <Text style={[styles.textLabel, styles.textSupporting, styles.ph5, styles.pv1]}>{label}</Text>}

<View>
{Object.values(CONST.SEARCH.DATE_MODIFIERS).map((dateType) => {
const dateValue = value[dateType];
const description = dateValue ?? undefined;
const lowerDateModifier = dateType.toLowerCase() as SearchDateModifierLower;

return (
<MenuItem
key={dateType}
shouldShowRightIcon
title={translate(`common.${lowerDateModifier}`)}
description={description}
viewMode={CONST.OPTION_MODE.COMPACT}
onPress={() => setView(dateType)}
/>
);
})}
</View>

<View style={[styles.flexRow, styles.gap2, styles.ph5]}>
<Button
medium
style={[styles.flex1]}
text={translate('common.reset')}
onPress={resetChanges}
/>
<Button
success
medium
style={[styles.flex1]}
text={translate('common.apply')}
onPress={applyChanges}
/>
</View>
</View>
);
}

RootView.displayName = 'RootView';
export default RootView;
Loading