Fix Maestro E2E regressions on iOS and Android (#11258)

This commit is contained in:
Samuel Newman
2026-07-24 13:48:03 +03:00
committed by GitHub
parent 3b6fbf315b
commit 63b284030a
6 changed files with 31 additions and 44 deletions
+2 -18
View File
@@ -197,24 +197,8 @@ export function Outer({
/** /**
* @deprecated use `Dialog.ScrollableInner` instead * @deprecated use `Dialog.ScrollableInner` instead
*/ */
export function Inner({children, style, header}: DialogInnerProps) { export function Inner(props: DialogInnerProps) {
const insets = useSafeAreaInsets() return <ScrollableInner {...props} />
return (
<>
{header}
<View
style={[
a.pt_2xl,
a.px_xl,
IS_LIQUID_GLASS
? a.pb_2xl
: {paddingBottom: insets.bottom + insets.top},
style,
]}>
{children}
</View>
</>
)
} }
export const ScrollableInner = forwardRef<ScrollView, DialogInnerProps>( export const ScrollableInner = forwardRef<ScrollView, DialogInnerProps>(
+3
View File
@@ -165,6 +165,9 @@ export function Outer({
) )
} }
/**
* @deprecated use `Dialog.ScrollableInner` instead
*/
export function Inner({ export function Inner({
children, children,
style, style,
@@ -1,8 +1,7 @@
import {useMemo} from 'react' import {useMemo} from 'react'
import {View} from 'react-native' import {View} from 'react-native'
import {Image as ExpoImage} from 'expo-image' import {Image as ExpoImage} from 'expo-image'
import {msg} from '@lingui/core/macro' import {useLingui} from '@lingui/react/macro'
import {useLingui} from '@lingui/react'
import {AvatarCreatorCircle} from '#/screens/Onboarding/StepProfile/AvatarCreatorCircle' import {AvatarCreatorCircle} from '#/screens/Onboarding/StepProfile/AvatarCreatorCircle'
import {useAvatar} from '#/screens/Onboarding/StepProfile/index' import {useAvatar} from '#/screens/Onboarding/StepProfile/index'
@@ -18,7 +17,7 @@ export function AvatarCircle({
openLibrary: () => unknown openLibrary: () => unknown
openCreator: () => unknown openCreator: () => unknown
}) { }) {
const {_} = useLingui() const {t: l} = useLingui()
const t = useTheme() const t = useTheme()
const {avatar} = useAvatar() const {avatar} = useAvatar()
@@ -63,7 +62,7 @@ export function AvatarCircle({
)} )}
<View style={[a.absolute, {bottom: 2, right: 2}]}> <View style={[a.absolute, {bottom: 2, right: 2}]}>
<Button <Button
label={_(msg`Select an avatar`)} label={l`Select an avatar`}
size="large" size="large"
shape="round" shape="round"
variant="solid" variant="solid"
@@ -1,7 +1,6 @@
import {useCallback} from 'react' import {useCallback} from 'react'
import {View} from 'react-native' import {View} from 'react-native'
import {msg} from '@lingui/core/macro' import {useLingui} from '@lingui/react/macro'
import {useLingui} from '@lingui/react'
import {Trans} from '@lingui/react/macro' import {Trans} from '@lingui/react/macro'
import {type Avatar} from '#/screens/Onboarding/StepProfile/index' import {type Avatar} from '#/screens/Onboarding/StepProfile/index'
@@ -35,7 +34,7 @@ export function AvatarCreatorItems({
avatar: Avatar avatar: Avatar
setAvatar: React.Dispatch<React.SetStateAction<Avatar>> setAvatar: React.Dispatch<React.SetStateAction<Avatar>>
}) { }) {
const {_} = useLingui() const {t: l} = useLingui()
const t = useTheme() const t = useTheme()
const isEmojis = type === 'emojis' const isEmojis = type === 'emojis'
@@ -68,7 +67,6 @@ export function AvatarCreatorItems({
<Trans>Select a color</Trans> <Trans>Select a color</Trans>
)} )}
</Text> </Text>
<View <View
style={[ style={[
a.flex_row, a.flex_row,
@@ -81,7 +79,7 @@ export function AvatarCreatorItems({
? emojiNames.map(emojiName => ( ? emojiNames.map(emojiName => (
<Button <Button
key={emojiName} key={emojiName}
label={_(msg`Select the ${emojiName} emoji as your avatar`)} label={l`Select the ${emojiName} emoji as your avatar`}
size="small" size="small"
shape="round" shape="round"
variant="solid" variant="solid"
@@ -105,7 +103,7 @@ export function AvatarCreatorItems({
: avatarColors.map(color => ( : avatarColors.map(color => (
<Button <Button
key={color} key={color}
label={_(msg`Choose this color as your avatar`)} label={l`Choose this color as your avatar`}
size="small" size="small"
shape="round" shape="round"
variant="solid" variant="solid"
+14 -16
View File
@@ -15,8 +15,7 @@ import {
launchImageLibraryAsync, launchImageLibraryAsync,
UIImagePickerPreferredAssetRepresentationMode, UIImagePickerPreferredAssetRepresentationMode,
} from 'expo-image-picker' } from 'expo-image-picker'
import {msg} from '@lingui/core/macro' import {useLingui} from '@lingui/react/macro'
import {useLingui} from '@lingui/react'
import {Trans} from '@lingui/react/macro' import {Trans} from '@lingui/react/macro'
import {IMAGE_SIZE_CONFIG_2K_1MB} from '#/lib/constants' import {IMAGE_SIZE_CONFIG_2K_1MB} from '#/lib/constants'
@@ -78,7 +77,7 @@ const randomColor =
export function StepProfile() { export function StepProfile() {
const ax = useAnalytics() const ax = useAnalytics()
const {_} = useLingui() const {t: l} = useLingui()
const t = useTheme() const t = useTheme()
const {gtMobile} = useBreakpoints() const {gtMobile} = useBreakpoints()
const {requestPhotoAccessIfNeeded} = usePhotoLibraryPermission() const {requestPhotoAccessIfNeeded} = usePhotoLibraryPermission()
@@ -138,14 +137,12 @@ export function StepProfile() {
] ]
} catch { } catch {
setError( setError(
_( l`This image could not be used. Try a different format like .jpg or .png.`,
msg`This image could not be used. Try a different format like .jpg or .png.`,
),
) )
return [] return []
} }
}, },
[_, setError, sheetWrapper], [l, setError, sheetWrapper],
) )
const onContinue = useCallback(async () => { const onContinue = useCallback(async () => {
@@ -298,7 +295,7 @@ export function StepProfile() {
testID="onboardingContinue" testID="onboardingContinue"
color="primary" color="primary"
size="large" size="large"
label={_(msg`Continue to next step`)} label={l`Continue to next step`}
onPress={onContinue}> onPress={onContinue}>
<ButtonText> <ButtonText>
<Trans>Continue</Trans> <Trans>Continue</Trans>
@@ -308,7 +305,7 @@ export function StepProfile() {
testID="onboardingAvatarCreator" testID="onboardingAvatarCreator"
color="primary_subtle" color="primary_subtle"
size="large" size="large"
label={_(msg`Open avatar creator`)} label={l`Open avatar creator`}
onPress={onSecondaryPress}> onPress={onSecondaryPress}>
<ButtonText> <ButtonText>
{avatar.useCreatedAvatar ? ( {avatar.useCreatedAvatar ? (
@@ -321,10 +318,12 @@ export function StepProfile() {
</View> </View>
</OnboardingControls.Portal> </OnboardingControls.Portal>
</View> </View>
<Dialog.Outer
<Dialog.Outer control={creatorControl}> control={creatorControl}
<Dialog.Inner nativeOptions={{preventExpansion: true}}>
label="Avatar creator" <Dialog.Handle />
<Dialog.ScrollableInner
label={l`Avatar creator`}
style={[ style={[
{ {
width: 'auto', width: 'auto',
@@ -351,16 +350,15 @@ export function StepProfile() {
<Button <Button
color="primary" color="primary"
size="large" size="large"
label={_(msg`Done`)} label={l`Done`}
onPress={onDoneCreating}> onPress={onDoneCreating}>
<ButtonText> <ButtonText>
<Trans>Done</Trans> <Trans>Done</Trans>
</ButtonText> </ButtonText>
</Button> </Button>
</View> </View>
</Dialog.Inner> </Dialog.ScrollableInner>
</Dialog.Outer> </Dialog.Outer>
<PlaceholderCanvas ref={canvasRef} /> <PlaceholderCanvas ref={canvasRef} />
</AvatarContext.Provider> </AvatarContext.Provider>
) )
+5
View File
@@ -713,6 +713,11 @@ export const ComposePost = ({
const [publishOnUpload, setPublishOnUpload] = useState(false) const [publishOnUpload, setPublishOnUpload] = useState(false)
const onClose = useCallback(() => { const onClose = useCallback(() => {
// HACKFIX: Android keyboard doesn't consistently dismiss IME
// TODO: investigate the root cause and fix properly -sfn
if (IS_ANDROID) {
Keyboard.dismiss()
}
closeComposer() closeComposer()
clearThumbnailCache(queryClient) clearThumbnailCache(queryClient)
revokeAllMediaUrls() revokeAllMediaUrls()