-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* upgrade sentry to support profiling monitoring * remove console logs in production builds * feeds tab bar and bottom bar animation centralized * refactor FeedPage out of Home * add script to start in production mode * move FAB inner to reanimated * move FABInner back to `Animated` RN animation * add perf commands * add testing with Maestro and perf with Flashlight * fix merge conflicts * fix resourceClass name in eas.json * fix onEndReachedThreshold in Feed * memoize styles * go back to old styling for LoadLatestBtn * remove reanimated code from useMinimalShellMode * move shell animations to hook/reanimated for perf * fix empty state issue * make shell animation feel smoother * make shell animation more smooth * run animation with autorun * specify keys for tab bar properly * remove comments * remove already imported dep * fix lint * add testing instructions * mock sentry-expo for jest * fix jest mocks * Fix the load-latest button on desktop and tablet * Fix: don't move the FAB in tablet mode * Fix type error * Fix tabs bar positioning on tablet * Fix types --------- Co-authored-by: Paul Frazee <[email protected]>
- Loading branch information
Showing
24 changed files
with
584 additions
and
374 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
# flow.yaml | ||
|
||
appId: xyz.blueskyweb.app | ||
--- | ||
- launchApp | ||
# Login | ||
# - runFlow: | ||
# when: | ||
# - tapOn: "Sign In" | ||
# - tapOn: "Username or email address" | ||
# - inputText: "ansh.bsky.team" | ||
# - tapOn: "Password" | ||
# - inputText: "PASSWORd" | ||
# - tapOn: "Next" | ||
# Allow notifications if popup is visible | ||
# - runFlow: | ||
# when: | ||
# visible: "Notifications" | ||
# commands: | ||
# - tapOn: "Allow" | ||
# Scroll in main feed | ||
- "scroll" | ||
- "scroll" | ||
- "scroll" | ||
- "scroll" | ||
- "scroll" | ||
- "scroll" | ||
- "scroll" | ||
- "scroll" | ||
# Swipe between feeds | ||
- swipe: | ||
direction: "LEFT" | ||
- swipe: | ||
direction: "LEFT" | ||
- swipe: | ||
direction: "LEFT" | ||
- swipe: | ||
direction: "RIGHT" | ||
- swipe: | ||
direction: "RIGHT" | ||
- swipe: | ||
direction: "RIGHT" | ||
# Go to Notifications | ||
- tapOn: | ||
id: "viewHeaderDrawerBtn" | ||
- tapOn: "Notifications" | ||
- "scroll" | ||
- "scroll" | ||
- "scroll" | ||
- "scroll" | ||
- "scroll" | ||
- swipe: | ||
direction: "DOWN" # Make header visible | ||
# Go to Feeds tab | ||
- tapOn: | ||
id: "viewHeaderDrawerBtn" | ||
- tapOn: "Feeds" | ||
- scrollUntilVisible: | ||
element: "Discover" | ||
direction: UP | ||
- tapOn: "Discover" | ||
- waitForAnimationToEnd | ||
- "scroll" | ||
- "scroll" | ||
- "scroll" | ||
- "scroll" | ||
- "scroll" | ||
# Click on post | ||
- tapOn: | ||
id: "postText" | ||
index: 0 | ||
- "scroll" | ||
- "scroll" | ||
- "scroll" | ||
- "scroll" | ||
- "scroll" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
jest.mock('sentry-expo', () => ({ | ||
init: () => jest.fn(), | ||
Native: { | ||
ReactNativeTracing: jest.fn().mockImplementation(() => ({ | ||
start: jest.fn(), | ||
stop: jest.fn(), | ||
})), | ||
ReactNavigationInstrumentation: jest.fn(), | ||
}, | ||
})) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Testing instructions | ||
|
||
### Using Maestro E2E tests | ||
1. Install Maestro by following [these instuctions](https://maestro.mobile.dev/getting-started/installing-maestro). This will help us run the E2E tests. | ||
2. You can write Maestro tests in `__e2e__/maestro` directory by creating a new `.yaml` file or by modifying an existing one. | ||
3. You can also use [Maestro Studio](https://maestro.mobile.dev/getting-started/maestro-studio) which automatically generates commands by recording your actions on the app. Therefore, you can create realistic tests without having to manually write any code. Use the `maestro studio` command to start recording your actions. | ||
|
||
|
||
### Using Flashlight for Performance Testing | ||
1. Make sure Maestro is installed (optional: only for auomated testing) by following the instructions above | ||
2. Install Flashlight by following [these instructions](https://docs.flashlight.dev/) | ||
3. The simplest way to get started is by running `yarn perf:measure` which will run a live preview of the performance test results. You can [see a demo here](https://github.com/bamlab/flashlight/assets/4534323/4038a342-f145-4c3b-8cde-17949bf52612) | ||
4. The `yarn perf:test:measure` will run the `scroll.yaml` test located in `__e2e__/maestro/scroll.yaml` and give the results in `.perf/results.json` which can be viewed by running `yarn:perf:results` | ||
5. You can also run your own tests by running `yarn perf:test <path_to_test>` where `<path_to_test>` is the path to your test file. For example, `yarn perf:test __e2e__/maestro/scroll.yaml` will run the `scroll.yaml` test located in `__e2e__/maestro/scroll.yaml`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,60 @@ | ||
import React from 'react' | ||
import {autorun} from 'mobx' | ||
import {useStores} from 'state/index' | ||
import {Animated} from 'react-native' | ||
import {useAnimatedValue} from 'lib/hooks/useAnimatedValue' | ||
import { | ||
Easing, | ||
interpolate, | ||
useAnimatedStyle, | ||
useSharedValue, | ||
withTiming, | ||
} from 'react-native-reanimated' | ||
|
||
export function useMinimalShellMode() { | ||
const store = useStores() | ||
const minimalShellInterp = useAnimatedValue(0) | ||
const footerMinimalShellTransform = { | ||
opacity: Animated.subtract(1, minimalShellInterp), | ||
transform: [{translateY: Animated.multiply(minimalShellInterp, 50)}], | ||
} | ||
const minimalShellInterp = useSharedValue(0) | ||
const footerMinimalShellTransform = useAnimatedStyle(() => { | ||
return { | ||
opacity: interpolate(minimalShellInterp.value, [0, 1], [1, 0]), | ||
transform: [ | ||
{translateY: interpolate(minimalShellInterp.value, [0, 1], [0, 25])}, | ||
], | ||
} | ||
}) | ||
const headerMinimalShellTransform = useAnimatedStyle(() => { | ||
return { | ||
opacity: interpolate(minimalShellInterp.value, [0, 1], [1, 0]), | ||
transform: [ | ||
{translateY: interpolate(minimalShellInterp.value, [0, 1], [0, -25])}, | ||
], | ||
} | ||
}) | ||
const fabMinimalShellTransform = useAnimatedStyle(() => { | ||
return { | ||
transform: [ | ||
{translateY: interpolate(minimalShellInterp.value, [0, 1], [-44, 0])}, | ||
], | ||
} | ||
}) | ||
|
||
React.useEffect(() => { | ||
return autorun(() => { | ||
if (store.shell.minimalShellMode) { | ||
Animated.timing(minimalShellInterp, { | ||
toValue: 1, | ||
duration: 150, | ||
useNativeDriver: true, | ||
isInteraction: false, | ||
}).start() | ||
minimalShellInterp.value = withTiming(1, { | ||
duration: 125, | ||
easing: Easing.bezier(0.25, 0.1, 0.25, 1), | ||
}) | ||
} else { | ||
Animated.timing(minimalShellInterp, { | ||
toValue: 0, | ||
duration: 150, | ||
useNativeDriver: true, | ||
isInteraction: false, | ||
}).start() | ||
minimalShellInterp.value = withTiming(0, { | ||
duration: 125, | ||
easing: Easing.bezier(0.25, 0.1, 0.25, 1), | ||
}) | ||
} | ||
}) | ||
}, [minimalShellInterp, store]) | ||
}, [minimalShellInterp, store.shell.minimalShellMode]) | ||
This comment has been minimized.
Sorry, something went wrong. |
||
|
||
return {footerMinimalShellTransform} | ||
return { | ||
footerMinimalShellTransform, | ||
headerMinimalShellTransform, | ||
fabMinimalShellTransform, | ||
} | ||
} |
Oops, something went wrong.
Why did we change this back to
store.shell.minimalShellMode
? I think this might have undone my fix from #1691.