Skip to content

Commit 9e146a4

Browse files
committed
Merge branch 'main' into fix/offline-pattern-in-reoprt-table-view-fixes
2 parents 05efb24 + 198e354 commit 9e146a4

23 files changed

Lines changed: 308 additions & 121 deletions

Mobile-Expensify

android/app/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,8 @@ android {
114114
minSdkVersion rootProject.ext.minSdkVersion
115115
targetSdkVersion rootProject.ext.targetSdkVersion
116116
multiDexEnabled rootProject.ext.multiDexEnabled
117-
versionCode 1009015402
118-
versionName "9.1.54-2"
117+
versionCode 1009015403
118+
versionName "9.1.54-3"
119119
// Supported language variants must be declared here to avoid from being removed during the compilation.
120120
// This also helps us to not include unnecessary language variants in the APK.
121121
resConfigs "en", "es"

ios/NewExpensify/Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
</dict>
4545
</array>
4646
<key>CFBundleVersion</key>
47-
<string>9.1.54.2</string>
47+
<string>9.1.54.3</string>
4848
<key>FullStory</key>
4949
<dict>
5050
<key>OrgId</key>

ios/NotificationServiceExtension/Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<key>CFBundleShortVersionString</key>
1414
<string>9.1.54</string>
1515
<key>CFBundleVersion</key>
16-
<string>9.1.54.2</string>
16+
<string>9.1.54.3</string>
1717
<key>NSExtension</key>
1818
<dict>
1919
<key>NSExtensionPointIdentifier</key>

ios/ShareViewController/Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<key>CFBundleShortVersionString</key>
1414
<string>9.1.54</string>
1515
<key>CFBundleVersion</key>
16-
<string>9.1.54.2</string>
16+
<string>9.1.54.3</string>
1717
<key>NSExtension</key>
1818
<dict>
1919
<key>NSExtensionAttributes</key>

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "new.expensify",
3-
"version": "9.1.54-2",
3+
"version": "9.1.54-3",
44
"author": "Expensify, Inc.",
55
"homepage": "https://new.expensify.com",
66
"description": "New Expensify is the next generation of Expensify: a reimagination of payments based atop a foundation of chat.",

src/CONST.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1661,6 +1661,7 @@ const CONST = {
16611661
LOCATION_UPDATE_INTERVAL: 5000,
16621662
PLAY_SOUND_MESSAGE_DEBOUNCE_TIME: 500,
16631663
SKELETON_ANIMATION_SPEED: 3,
1664+
SEARCH_OPTIONS_COMPARISON: 'search_options_comparison',
16641665
},
16651666
PRIORITY_MODE: {
16661667
GSD: 'gsd',

src/components/LHNOptionsList/LHNOptionsList.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {useRoute} from '@react-navigation/native';
1+
import {useIsFocused, useRoute} from '@react-navigation/native';
22
import type {FlashListProps} from '@shopify/flash-list';
33
import {FlashList} from '@shopify/flash-list';
44
import type {ReactElement} from 'react';
@@ -58,6 +58,8 @@ function LHNOptionsList({style, contentContainerStyles, data, onSelectRow, optio
5858
const styles = useThemeStyles();
5959
const {translate, preferredLocale} = useLocalize();
6060
const estimatedListSize = useLHNEstimatedListSize();
61+
const isScreenFocused = useIsFocused();
62+
6163
const shouldShowEmptyLHN = data.length === 0;
6264
const estimatedItemSize = optionMode === CONST.OPTION_MODE.COMPACT ? variables.optionRowHeightCompact : variables.optionRowHeight;
6365
const platform = getPlatform();
@@ -225,14 +227,15 @@ function LHNOptionsList({style, contentContainerStyles, data, onSelectRow, optio
225227
lastReportActionTransaction={lastReportActionTransaction}
226228
receiptTransactions={transactions}
227229
viewMode={optionMode}
228-
isFocused={!shouldDisableFocusOptions}
230+
isOptionFocused={!shouldDisableFocusOptions}
229231
lastMessageTextFromReport={lastMessageTextFromReport}
230232
onSelectRow={onSelectRow}
231233
preferredLocale={preferredLocale}
232234
hasDraftComment={hasDraftComment}
233235
transactionViolations={transactionViolations}
234236
onLayout={onLayoutItem}
235237
shouldShowRBRorGBRTooltip={shouldShowRBRorGBRTooltip}
238+
isScreenFocused={isScreenFocused}
236239
/>
237240
);
238241
},
@@ -253,6 +256,7 @@ function LHNOptionsList({style, contentContainerStyles, data, onSelectRow, optio
253256
onLayoutItem,
254257
isOffline,
255258
firstReportIDWithGBRorRBR,
259+
isScreenFocused,
256260
],
257261
);
258262

src/components/LHNOptionsList/OptionRowLHN.tsx

Lines changed: 11 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
import {useFocusEffect} from '@react-navigation/native';
2-
import React, {useCallback, useMemo, useRef, useState} from 'react';
1+
import React, {useMemo, useRef, useState} from 'react';
32
import type {GestureResponderEvent, ViewStyle} from 'react-native';
43
import {StyleSheet, View} from 'react-native';
54
import {useOnyx} from 'react-native-onyx';
@@ -51,20 +50,20 @@ import type {OptionRowLHNProps} from './types';
5150

5251
function OptionRowLHN({
5352
reportID,
54-
isFocused = false,
53+
isOptionFocused = false,
5554
onSelectRow = () => {},
5655
optionItem,
5756
viewMode = 'default',
5857
style,
5958
onLayout = () => {},
6059
hasDraftComment,
6160
shouldShowRBRorGBRTooltip,
61+
isScreenFocused,
6262
}: OptionRowLHNProps) {
6363
const theme = useTheme();
6464
const styles = useThemeStyles();
6565
const popoverAnchor = useRef<View>(null);
6666
const StyleUtils = useStyleUtils();
67-
const [isScreenFocused, setIsScreenFocused] = useState(false);
6867
const {shouldUseNarrowLayout} = useResponsiveLayout();
6968

7069
const [report] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${optionItem?.reportID}`, {canBeMissing: true});
@@ -105,23 +104,14 @@ function OptionRowLHN({
105104
const {translate} = useLocalize();
106105
const [isContextMenuActive, setIsContextMenuActive] = useState(false);
107106

108-
useFocusEffect(
109-
useCallback(() => {
110-
setIsScreenFocused(true);
111-
return () => {
112-
setIsScreenFocused(false);
113-
};
114-
}, []),
115-
);
116-
117107
const isInFocusMode = viewMode === CONST.OPTION_MODE.COMPACT;
118108
const sidebarInnerRowStyle = StyleSheet.flatten<ViewStyle>(
119109
isInFocusMode
120110
? [styles.chatLinkRowPressable, styles.flexGrow1, styles.optionItemAvatarNameWrapper, styles.optionRowCompact, styles.justifyContentCenter]
121111
: [styles.chatLinkRowPressable, styles.flexGrow1, styles.optionItemAvatarNameWrapper, styles.optionRow, styles.justifyContentCenter],
122112
);
123113

124-
if (!optionItem && !isFocused) {
114+
if (!optionItem && !isOptionFocused) {
125115
// rendering null as a render item causes the FlashList to render all
126116
// its children and consume significant memory on the first render. We can avoid this by
127117
// rendering a placeholder view instead. This behaviour is only observed when we
@@ -140,7 +130,7 @@ function OptionRowLHN({
140130
}
141131

142132
const brickRoadIndicator = optionItem.brickRoadIndicator;
143-
const textStyle = isFocused ? styles.sidebarLinkActiveText : styles.sidebarLinkText;
133+
const textStyle = isOptionFocused ? styles.sidebarLinkActiveText : styles.sidebarLinkText;
144134
const textUnreadStyle = shouldUseBoldText(optionItem) ? [textStyle, styles.sidebarLinkTextBold] : [textStyle];
145135
const displayNameStyle = [styles.optionDisplayName, styles.optionDisplayNameCompact, styles.pre, textUnreadStyle, style];
146136
const alternateTextStyle = isInFocusMode
@@ -188,7 +178,7 @@ function OptionRowLHN({
188178
const statusContent = formattedDate ? `${statusText ? `${statusText} ` : ''}(${formattedDate})` : statusText;
189179
const isStatusVisible = !!emojiCode && isOneOnOneChat(!isEmptyObject(report) ? report : undefined);
190180

191-
const subscriptAvatarBorderColor = isFocused ? focusedBackgroundColor : theme.sidebar;
181+
const subscriptAvatarBorderColor = isOptionFocused ? focusedBackgroundColor : theme.sidebar;
192182
const firstIcon = optionItem.icons?.at(0);
193183

194184
const onOptionPress = (event: GestureResponderEvent | KeyboardEvent | undefined) => {
@@ -256,8 +246,8 @@ function OptionRowLHN({
256246
styles.sidebarLink,
257247
styles.sidebarLinkInnerLHN,
258248
StyleUtils.getBackgroundColorStyle(theme.sidebar),
259-
isFocused ? styles.sidebarLinkActive : null,
260-
(hovered || isContextMenuActive) && !isFocused ? styles.sidebarLinkHover : null,
249+
isOptionFocused ? styles.sidebarLinkActive : null,
250+
(hovered || isContextMenuActive) && !isOptionFocused ? styles.sidebarLinkHover : null,
261251
]}
262252
role={CONST.ROLE.BUTTON}
263253
accessibilityLabel={`${translate('accessibilityHints.navigatesToChat')} ${optionItem.text}. ${optionItem.isUnread ? `${translate('common.unread')}.` : ''} ${
@@ -272,7 +262,7 @@ function OptionRowLHN({
272262
firstIcon &&
273263
(optionItem.shouldShowSubscript ? (
274264
<SubscriptAvatar
275-
backgroundColor={hovered && !isFocused ? hoveredBackgroundColor : subscriptAvatarBorderColor}
265+
backgroundColor={hovered && !isOptionFocused ? hoveredBackgroundColor : subscriptAvatarBorderColor}
276266
mainAvatar={firstIcon}
277267
secondaryAvatar={optionItem.icons.at(1)}
278268
size={isInFocusMode ? CONST.AVATAR_SIZE.SMALL : CONST.AVATAR_SIZE.DEFAULT}
@@ -284,8 +274,8 @@ function OptionRowLHN({
284274
size={isInFocusMode ? CONST.AVATAR_SIZE.SMALL : CONST.AVATAR_SIZE.DEFAULT}
285275
secondAvatarStyle={[
286276
StyleUtils.getBackgroundAndBorderStyle(theme.sidebar),
287-
isFocused ? StyleUtils.getBackgroundAndBorderStyle(focusedBackgroundColor) : undefined,
288-
hovered && !isFocused ? StyleUtils.getBackgroundAndBorderStyle(hoveredBackgroundColor) : undefined,
277+
isOptionFocused ? StyleUtils.getBackgroundAndBorderStyle(focusedBackgroundColor) : undefined,
278+
hovered && !isOptionFocused ? StyleUtils.getBackgroundAndBorderStyle(hoveredBackgroundColor) : undefined,
289279
]}
290280
shouldShowTooltip={shouldOptionShowTooltip(optionItem)}
291281
/>

0 commit comments

Comments
 (0)