Skip to content

Commit d8f61a5

Browse files
authored
Merge pull request Expensify#88751 from Expensify/revert-83127-fix/82534
Revert "feat: Add inline editing for tables on desktop"
2 parents 94e1e10 + 78be79e commit d8f61a5

45 files changed

Lines changed: 91 additions & 2074 deletions

Some content is hidden

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

src/App.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ import SafeArea from './components/SafeArea';
3131
import ScrollOffsetContextProvider from './components/ScrollOffsetContextProvider';
3232
import SidePanelContextProvider from './components/SidePanel/SidePanelContextProvider';
3333
import SVGDefinitionsProvider from './components/SVGDefinitionsProvider';
34-
import {EditingCellProvider} from './components/Table/EditableCell';
3534
import ThemeIllustrationsProvider from './components/ThemeIllustrationsProvider';
3635
import ThemeProvider from './components/ThemeProvider';
3736
import ThemeStylesProvider from './components/ThemeStylesContextProvider';
@@ -116,7 +115,6 @@ function App() {
116115
FullScreenLoaderContextProvider,
117116
ModalProvider,
118117
SidePanelContextProvider,
119-
EditingCellProvider,
120118
]}
121119
>
122120
<CustomStatusBarAndBackground />

src/CONST/index.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -257,8 +257,6 @@ const CONST = {
257257
POPOVER_DROPDOWN_WIDTH: 334,
258258
POPOVER_DROPDOWN_MIN_HEIGHT: 0,
259259
POPOVER_DROPDOWN_MAX_HEIGHT: 416,
260-
POPOVER_CATEGORY_PICKER_WIDTH: 350,
261-
POPOVER_CATEGORY_PICKER_MAX_HEIGHT: 450,
262260
POPOVER_MENU_MAX_HEIGHT: 496,
263261
POPOVER_MENU_MAX_HEIGHT_MOBILE: 432,
264262
POPOVER_DATE_WIDTH: 338,
@@ -8936,9 +8934,6 @@ const CONST = {
89368934
SORTABLE_HEADER: 'Search-SortableHeader',
89378935
UNREPORTED_EXPENSE_LIST_ITEM: 'UnreportedExpenseListItem',
89388936
},
8939-
TABLE: {
8940-
EDITABLE_CELL: 'Table-EditableCell',
8941-
},
89428937
REPORT: {
89438938
FLOATING_MESSAGE_COUNTER: 'Report-FloatingMessageCounter',
89448939
LIST_BOUNDARY_LOADER_RETRY: 'Report-ListBoundaryLoaderRetry',
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
11
import React from 'react';
2-
import RadioListItem from '@components/SelectionList/ListItem/RadioListItem';
3-
import SelectionListWithSections from '@components/SelectionList/SelectionListWithSections';
4-
import type {ListItem} from '@components/SelectionList/types';
5-
import type {BaseTextInputRef} from '@components/TextInput/BaseTextInput/types';
62
import useAutoFocusInput from '@hooks/useAutoFocusInput';
73
import useDebouncedState from '@hooks/useDebouncedState';
84
import useLocalize from '@hooks/useLocalize';
@@ -16,6 +12,10 @@ import {getHeaderMessageForNonUserList} from '@libs/OptionsListUtils';
1612
import CONST from '@src/CONST';
1713
import ONYXKEYS from '@src/ONYXKEYS';
1814
import {isEmptyObject} from '@src/types/utils/EmptyObject';
15+
import RadioListItem from './SelectionList/ListItem/RadioListItem';
16+
import SelectionListWithSections from './SelectionList/SelectionListWithSections';
17+
import type {ListItem} from './SelectionList/types';
18+
import type {BaseTextInputRef} from './TextInput/BaseTextInput/types';
1919

2020
type CategoryPickerProps = {
2121
policyID: string | undefined;

src/components/CategoryPicker/CategoryPickerModal.tsx

Lines changed: 0 additions & 86 deletions
This file was deleted.

src/components/ConfirmCancelButtonRow.tsx

Lines changed: 0 additions & 40 deletions
This file was deleted.

src/components/DatePicker/DatePickerModal.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ const DEFAULT_ANCHOR_ORIGIN = {
1313
horizontal: CONST.MODAL.ANCHOR_ORIGIN_HORIZONTAL.RIGHT,
1414
vertical: CONST.MODAL.ANCHOR_ORIGIN_VERTICAL.TOP,
1515
};
16-
1716
const popoverDimensions = {
1817
height: CONST.POPOVER_DATE_MIN_HEIGHT,
1918
width: CONST.POPOVER_DATE_WIDTH,
@@ -32,7 +31,6 @@ function DatePickerModal({
3231
isVisible,
3332
onClose,
3433
anchorPosition,
35-
anchorAlignment = DEFAULT_ANCHOR_ORIGIN,
3634
onSelected,
3735
shouldCloseWhenBrowserNavigationChanged = false,
3836
shouldPositionFromTop = false,
@@ -71,8 +69,7 @@ function DatePickerModal({
7169
popoverDimensions={popoverDimensions}
7270
shouldCloseWhenBrowserNavigationChanged={shouldCloseWhenBrowserNavigationChanged}
7371
innerContainerStyle={isSmallScreenWidth ? styles.w100 : {width: CONST.POPOVER_DATE_WIDTH}}
74-
anchorAlignment={anchorAlignment}
75-
restoreFocusType={CONST.MODAL.RESTORE_FOCUS_TYPE.DELETE}
72+
anchorAlignment={DEFAULT_ANCHOR_ORIGIN}
7673
shouldSwitchPositionIfOverflow
7774
shouldReturnFocus={false}
7875
shouldMeasureAnchorPositionFromTop={shouldPositionFromTop}

src/components/MoneyRequestAmountInput.tsx

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -124,15 +124,6 @@ type MoneyRequestAmountInputProps = {
124124
*/
125125
shouldWrapInputInContainer?: boolean;
126126

127-
/** Style applied to the outer ScrollView inside NumberWithSymbolForm */
128-
scrollViewStyle?: StyleProp<ViewStyle>;
129-
130-
/**
131-
* Whether to refocus the input when clicking on the ScrollView empty space.
132-
* Prevents focus loss when clicking empty space left of the right-aligned input.
133-
*/
134-
shouldRefocusOnScrollViewClick?: boolean;
135-
136127
/** Whether the input is disabled or not */
137128
disabled?: boolean;
138129

@@ -141,7 +132,7 @@ type MoneyRequestAmountInputProps = {
141132

142133
/** Determines which keyboard to open */
143134
keyboardType?: KeyboardTypeOptions;
144-
} & Pick<TextInputWithSymbolProps, 'autoGrowExtraSpace' | 'submitBehavior' | 'shouldUseDefaultLineHeightForPrefix' | 'onFocus' | 'onBlur' | 'symbolTextStyle'>;
135+
} & Pick<TextInputWithSymbolProps, 'autoGrowExtraSpace' | 'submitBehavior' | 'shouldUseDefaultLineHeightForPrefix' | 'onFocus' | 'onBlur'>;
145136

146137
type Selection = {
147138
start: number;
@@ -176,8 +167,6 @@ function MoneyRequestAmountInput({
176167
shouldApplyPaddingToContainer = false,
177168
shouldUseDefaultLineHeightForPrefix = true,
178169
shouldWrapInputInContainer = true,
179-
scrollViewStyle,
180-
shouldRefocusOnScrollViewClick = false,
181170
isNegative = false,
182171
allowFlippingAmount = false,
183172
allowNegativeInput = false,
@@ -256,7 +245,6 @@ function MoneyRequestAmountInput({
256245
currency={currency}
257246
hideSymbol={hideCurrencySymbol}
258247
isSymbolPressable={isCurrencyPressable}
259-
symbolTextStyle={props.symbolTextStyle}
260248
shouldShowBigNumberPad={shouldShowBigNumberPad}
261249
style={inputStyle}
262250
autoGrow={autoGrow}
@@ -266,8 +254,6 @@ function MoneyRequestAmountInput({
266254
shouldApplyPaddingToContainer={shouldApplyPaddingToContainer}
267255
shouldUseDefaultLineHeightForPrefix={shouldUseDefaultLineHeightForPrefix}
268256
shouldWrapInputInContainer={shouldWrapInputInContainer}
269-
scrollViewStyle={scrollViewStyle}
270-
shouldRefocusOnScrollViewClick={shouldRefocusOnScrollViewClick}
271257
containerStyle={props.containerStyle}
272258
prefixStyle={props.prefixStyle}
273259
prefixContainerStyle={props.prefixContainerStyle}

src/components/MoneyRequestReportView/MoneyRequestReportTransactionItem.tsx

Lines changed: 1 addition & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,13 @@ import {getButtonRole} from '@components/Button/utils';
55
import OfflineWithFeedback from '@components/OfflineWithFeedback';
66
import {PressableWithFeedback} from '@components/Pressable';
77
import type {SearchColumnType, TableColumnSize} from '@components/Search/types';
8-
import {useEditingCellState} from '@components/Table/EditableCell';
98
import TransactionItemRow from '@components/TransactionItemRow';
109
import useAnimatedHighlightStyle from '@hooks/useAnimatedHighlightStyle';
1110
import useLocalize from '@hooks/useLocalize';
1211
import useResponsiveLayout from '@hooks/useResponsiveLayout';
1312
import useResponsiveLayoutOnWideRHP from '@hooks/useResponsiveLayoutOnWideRHP';
1413
import useTheme from '@hooks/useTheme';
1514
import useThemeStyles from '@hooks/useThemeStyles';
16-
import useTransactionInlineEdit from '@hooks/useTransactionInlineEdit';
1715
import useTransactionViolations from '@hooks/useTransactionViolations';
1816
import ControlSelection from '@libs/ControlSelection';
1917
import canUseTouchScreen from '@libs/DeviceCapabilities/canUseTouchScreen';
@@ -93,7 +91,6 @@ function MoneyRequestReportTransactionItem({
9391
}: MoneyRequestReportTransactionItemProps) {
9492
const {translate} = useLocalize();
9593
const styles = useThemeStyles();
96-
const {isEditingCell} = useEditingCellState();
9794
// eslint-disable-next-line rulesdir/prefer-shouldUseNarrowLayout-instead-of-isSmallScreenWidth
9895
const {isSmallScreenWidth, isMediumScreenWidth} = useResponsiveLayout();
9996
const {shouldUseNarrowLayout} = useResponsiveLayoutOnWideRHP();
@@ -103,22 +100,6 @@ function MoneyRequestReportTransactionItem({
103100
// Filter violations based on user visibility and dismissal state at the row level.
104101
const filteredViolations = useTransactionViolations(transaction.transactionID);
105102

106-
const {
107-
canEditDate,
108-
canEditMerchant,
109-
canEditDescription,
110-
canEditCategory,
111-
canEditAmount,
112-
canEditTag,
113-
onEditDate,
114-
onEditMerchant,
115-
onEditDescription,
116-
onEditCategory,
117-
onEditAmount,
118-
onEditTag,
119-
wasEditingOnMouseDownRef,
120-
} = useTransactionInlineEdit({transactionID: transaction.transactionID, reportID: transaction.reportID});
121-
122103
const viewRef = useRef<View>(null);
123104

124105
// This useEffect scrolls to this transaction when it is newly added to the report
@@ -143,12 +124,6 @@ function MoneyRequestReportTransactionItem({
143124
<PressableWithFeedback
144125
key={transaction.transactionID}
145126
onPress={() => {
146-
// If a cell was being edited when the user tapped the row, suppress navigation
147-
// so the second tap doesn't immediately open the transaction detail.
148-
if (wasEditingOnMouseDownRef.current) {
149-
wasEditingOnMouseDownRef.current = false;
150-
return;
151-
}
152127
handleOnPress(transaction.transactionID);
153128
}}
154129
accessibilityLabel={translate('iou.viewDetails')}
@@ -159,12 +134,7 @@ function MoneyRequestReportTransactionItem({
159134
style={[styles.transactionListItemStyle]}
160135
hoverStyle={[!isPendingDelete && styles.hoveredComponentBG, isSelected && styles.activeComponentBG]}
161136
dataSet={{[CONST.SELECTION_SCRAPER_HIDDEN_ELEMENT]: true}}
162-
onPressIn={() => {
163-
wasEditingOnMouseDownRef.current = isEditingCell;
164-
if (canUseTouchScreen()) {
165-
ControlSelection.block();
166-
}
167-
}}
137+
onPressIn={() => canUseTouchScreen() && ControlSelection.block()}
168138
onPressOut={() => ControlSelection.unblock()}
169139
onLongPress={() => {
170140
handleLongPress(transaction.transactionID);
@@ -196,18 +166,6 @@ function MoneyRequestReportTransactionItem({
196166
onArrowRightPress={() => onArrowRightPress?.(transaction.transactionID)}
197167
isHover={hovered}
198168
nonPersonalAndWorkspaceCards={nonPersonalAndWorkspaceCards}
199-
canEditDate={canEditDate}
200-
canEditMerchant={canEditMerchant}
201-
canEditDescription={canEditDescription}
202-
canEditCategory={canEditCategory}
203-
canEditAmount={canEditAmount}
204-
canEditTag={canEditTag}
205-
onEditDate={onEditDate}
206-
onEditMerchant={onEditMerchant}
207-
onEditDescription={onEditDescription}
208-
onEditCategory={onEditCategory}
209-
onEditAmount={onEditAmount}
210-
onEditTag={onEditTag}
211169
/>
212170
)}
213171
</PressableWithFeedback>

0 commit comments

Comments
 (0)