Skip to content

Commit

Permalink
Merge branch 'main' into srikar-hideMutedChats
Browse files Browse the repository at this point in the history
  • Loading branch information
srikarparsi authored Jul 26, 2023
2 parents 478aa7b + ecfbafe commit bcf4c81
Show file tree
Hide file tree
Showing 132 changed files with 2,397 additions and 1,645 deletions.
4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@ android {
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
multiDexEnabled rootProject.ext.multiDexEnabled
versionCode 1001034402
versionName "1.3.44-2"
versionCode 1001034600
versionName "1.3.46-0"
}

splits {
Expand Down
1 change: 1 addition & 0 deletions assets/animations/ExpensifyLounge.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions assets/animations/WorkspacePlanet.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion contributingGuides/FORMS.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ Form inputs will NOT store draft values by default. This is to avoid accidentall

### Validate on Blur, on Change and Submit

Each individual form field that requires validation will have its own validate test defined. When the form field loses focus (blur) we will run that validate test and show feedback. A blur on one field will not cause other fields to validate or show errors unless they have already been blurred.
Each individual form field that requires validation will have its own validate test defined. When the form field loses focus (blur) we will run that validate test and show feedback. A blur on one field will not cause other fields to validate or show errors unless they have already been blurred. To prevent server errors from being cleared inadvertently, we only run validation on blur if any form data has changed since the last validation/submit.

Once a user has “touched” an input, i.e. blurred the input, we will also start validating that input on change when the user goes back to editing it.

Expand Down
18 changes: 17 additions & 1 deletion contributingGuides/TS_STYLE.md
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,23 @@ declare module "external-library-name" {
- If you're migrating a module that doesn't have a default implementation (i.e. `index.ts`, e.g. `getPlatform`), convert `index.website.js` to `index.ts`. Without `index.ts`, TypeScript cannot get type information where the module is imported.
- Deprecate the usage of `underscore`. Use the corresponding methods from `lodash`. eslint: [`no-restricted-imports`](https://eslint.org/docs/latest/rules/no-restricted-imports)
- Deprecate the usage of `underscore`. Use vanilla methods from JS instead. Only use `lodash` when there is no easy vanilla alternative (eg. `lodashMerge`). eslint: [`no-restricted-imports`](https://eslint.org/docs/latest/rules/no-restricted-imports)
```ts
// BAD
var arr = [];
_.each(arr, () => {});

// GOOD
var arr = [];
arr.forEach(() => {});

// BAD
lodashGet(object, ['foo'], 'bar');

// GOOD
object?.foo ?? 'bar';
```
- Found type bugs. Now what?
Expand Down
4 changes: 2 additions & 2 deletions ios/NewExpensify/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.3.44</string>
<string>1.3.46</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleURLTypes</key>
Expand All @@ -32,7 +32,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>1.3.44.2</string>
<string>1.3.46.0</string>
<key>ITSAppUsesNonExemptEncryption</key>
<false/>
<key>LSApplicationQueriesSchemes</key>
Expand Down
4 changes: 2 additions & 2 deletions ios/NewExpensifyTests/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>1.3.44</string>
<string>1.3.46</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.3.44.2</string>
<string>1.3.46.0</string>
</dict>
</plist>
6 changes: 4 additions & 2 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -672,11 +672,12 @@ PODS:
- React-Core
- RNReactNativeHapticFeedback (1.14.0):
- React-Core
- RNReanimated (3.1.0):
- RNReanimated (3.4.0):
- DoubleConversion
- FBLazyVector
- FBReactNativeSpec
- glog
- hermes-engine
- RCT-Folly
- RCTRequired
- RCTTypeSafety
Expand All @@ -686,6 +687,7 @@ PODS:
- React-Core/RCTWebSocket
- React-CoreModules
- React-cxxreact
- React-hermes
- React-jsi
- React-jsiexecutor
- React-jsinspector
Expand Down Expand Up @@ -1130,7 +1132,7 @@ SPEC CHECKSUMS:
RNLocalize: d4b8af4e442d4bcca54e68fc687a2129b4d71a81
RNPermissions: dcdb7b99796bbeda6975a6e79ad519c41b251b1c
RNReactNativeHapticFeedback: 1e3efeca9628ff9876ee7cdd9edec1b336913f8c
RNReanimated: b1220a0e5168745283ff5d53bfc7d2144b2cee1b
RNReanimated: 532818a3578a0832d95ea9d0a6a9dc0e73bbce29
RNScreens: 0df01424e9e0ed7827200d6ed1087ddd06c493f9
RNSVG: 53c661b76829783cdaf9b7a57258f3d3b4c28315
SDWebImage: a7f831e1a65eb5e285e3fb046a23fcfbf08e696d
Expand Down
18 changes: 9 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "new.expensify",
"version": "1.3.44-2",
"version": "1.3.46-0",
"author": "Expensify, Inc.",
"homepage": "https://new.expensify.com",
"description": "New Expensify is the next generation of Expensify: a reimagination of payments based atop a foundation of chat.",
Expand Down Expand Up @@ -123,7 +123,7 @@
"react-native-plaid-link-sdk": "^10.0.0",
"react-native-qrcode-svg": "^6.2.0",
"react-native-quick-sqlite": "^8.0.0-beta.2",
"react-native-reanimated": "3.1.0",
"react-native-reanimated": "3.4.0",
"react-native-render-html": "6.3.1",
"react-native-safe-area-context": "4.4.1",
"react-native-screens": "3.17.0",
Expand Down
112 changes: 112 additions & 0 deletions patches/@react-navigation+stack+6.3.16.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
diff --git a/node_modules/@react-navigation/stack/lib/module/utils/edgeDragGestureMonitor.js b/node_modules/@react-navigation/stack/lib/module/utils/edgeDragGestureMonitor.js
new file mode 100644
index 0000000..d8284fc
--- /dev/null
+++ b/node_modules/@react-navigation/stack/lib/module/utils/edgeDragGestureMonitor.js
@@ -0,0 +1,44 @@
+let isInitialized = false;
+let justFinishedEdgeGestureFromLeft = false;
+let expectingTouchend = false;
+
+/// This returns information if the user just performed edge gesture on iOS safari to navigate in the browser history.
+export const getIsEdgeDragGesture = () => {
+ return expectingTouchend || justFinishedEdgeGestureFromLeft;
+};
+
+// We need to manualy reset this flag after deciding if there should be animation for navigation.
+export const resetExpectingTouchendWithDelay = () => {
+ setTimeout(() => {
+ expectingTouchend = false;
+ }, 100);
+};
+
+export const maybeInitializeEdgeDragGestureMonitor = () => {
+ if (isInitialized) {
+ return;
+ }
+ isInitialized = true;
+ let timer;
+
+ // Gestures that would trigger navigation forward are broken on iOS safari.
+ // They don't have touchend event fired so we can look at expectingTouchEnd flag to detect if we should run animation.
+ const handleTouchStart = () => {
+ expectingTouchend = true;
+ };
+ const handleTouchEnd = e => {
+ var _e$changedTouches$;
+ const pageX = (_e$changedTouches$ = e.changedTouches[0]) === null || _e$changedTouches$ === void 0 ? void 0 : _e$changedTouches$.pageX;
+ // PageX for gesture that would trigger navigation back is negative.
+ if (pageX < 0) {
+ if (timer) {
+ clearTimeout(timer);
+ }
+ justFinishedEdgeGestureFromLeft = true;
+ timer = setTimeout(() => justFinishedEdgeGestureFromLeft = false, 100);
+ }
+ expectingTouchend = false;
+ };
+ document.addEventListener('touchstart', handleTouchStart);
+ document.addEventListener('touchend', handleTouchEnd);
+};
diff --git a/node_modules/@react-navigation/stack/lib/module/utils/edgeDragGestureMonitor.native.js b/node_modules/@react-navigation/stack/lib/module/utils/edgeDragGestureMonitor.native.js
new file mode 100644
index 0000000..668d198
--- /dev/null
+++ b/node_modules/@react-navigation/stack/lib/module/utils/edgeDragGestureMonitor.native.js
@@ -0,0 +1,5 @@
+// We don't need edgeDragGestureMonitor for native platforms.
+
+export const getIsEdgeDragGesture = () => false;
+export const resetExpectingTouchendWithDelay = () => {};
+export const maybeInitializeEdgeDragGestureMonitor = () => {};
diff --git a/node_modules/@react-navigation/stack/lib/module/views/Stack/Card.js b/node_modules/@react-navigation/stack/lib/module/views/Stack/Card.js
index 548ba79..4bedb81 100644
--- a/node_modules/@react-navigation/stack/lib/module/views/Stack/Card.js
+++ b/node_modules/@react-navigation/stack/lib/module/views/Stack/Card.js
@@ -4,6 +4,7 @@ import * as React from 'react';
import { Animated, InteractionManager, Platform, StyleSheet, View } from 'react-native';
import { forModalPresentationIOS } from '../../TransitionConfigs/CardStyleInterpolators';
import CardAnimationContext from '../../utils/CardAnimationContext';
+import { getIsEdgeDragGesture, resetExpectingTouchendWithDelay } from '../../utils/edgeDragGestureMonitor';
import getDistanceForDirection from '../../utils/getDistanceForDirection';
import getInvertedMultiplier from '../../utils/getInvertedMultiplier';
import memoize from '../../utils/memoize';
@@ -121,6 +122,8 @@ export default class Card extends React.Component {
});
animation(gesture, {
...spec.config,
+ // Detecting if the user used swipe gesture on iOS safari to trigger navigation in the browser history.
+ duration: getIsEdgeDragGesture() ? 0 : undefined,
velocity,
toValue,
useNativeDriver,
@@ -131,6 +134,8 @@ export default class Card extends React.Component {
} = _ref3;
this.handleEndInteraction();
clearTimeout(this.pendingGestureCallback);
+ // We need to reset edgeDragGestureMonitor manualy because of broken events on iOS safari.
+ resetExpectingTouchendWithDelay();
if (finished) {
if (closing) {
onClose();
diff --git a/node_modules/@react-navigation/stack/lib/module/views/Stack/CardStack.js b/node_modules/@react-navigation/stack/lib/module/views/Stack/CardStack.js
index 95e6871..7558eb3 100644
--- a/node_modules/@react-navigation/stack/lib/module/views/Stack/CardStack.js
+++ b/node_modules/@react-navigation/stack/lib/module/views/Stack/CardStack.js
@@ -4,6 +4,7 @@ import * as React from 'react';
import { Animated, Platform, StyleSheet } from 'react-native';
import { forModalPresentationIOS, forNoAnimation as forNoAnimationCard } from '../../TransitionConfigs/CardStyleInterpolators';
import { DefaultTransition, ModalFadeTransition, ModalTransition } from '../../TransitionConfigs/TransitionPresets';
+import { maybeInitializeEdgeDragGestureMonitor } from '../../utils/edgeDragGestureMonitor';
import findLastIndex from '../../utils/findLastIndex';
import getDistanceForDirection from '../../utils/getDistanceForDirection';
import { MaybeScreen, MaybeScreenContainer } from '../Screens';
@@ -166,6 +167,8 @@ export default class CardStack extends React.Component {
}
constructor(props) {
super(props);
+ // Gesture monitor is only needed on iOS safari to detect if the user performed edge swipe gesture to to navigate in the browser history.
+ maybeInitializeEdgeDragGestureMonitor();
this.state = {
routes: [],
scenes: [],
Loading

0 comments on commit bcf4c81

Please sign in to comment.