Fix Find channels not being interactable (#8794)

* Fix Find channels not being interactable

* fix(e2e): Uncomment find channel tests

* Fix tsc

* Use platform select

---------

Co-authored-by: yasserfaraazkhan <attitude3cena.yf@gmail.com>
This commit is contained in:
Daniel Espino García 2025-04-29 13:56:22 +02:00 committed by GitHub
parent 098c219932
commit f963855875
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 19 additions and 18 deletions

View file

@ -2,7 +2,7 @@
// See LICENSE.txt for license information.
import React from 'react';
import {Text, TouchableOpacity, useWindowDimensions} from 'react-native';
import {Platform, Text, TouchableOpacity, useWindowDimensions} from 'react-native';
import Animated, {FadeIn, FadeOut} from 'react-native-reanimated';
import CompassIcon from '@components/compass_icon';
@ -103,10 +103,13 @@ export default function BaseChip({
</TouchableOpacity>
);
}
// https://mattermost.atlassian.net/browse/MM-63814?focusedCommentId=178584
const useFadeOut = showAnimation && Platform.OS !== 'android';
return (
<Animated.View
entering={showAnimation ? FadeIn.duration(FADE_DURATION) : undefined}
exiting={showAnimation ? FadeOut.duration(FADE_DURATION) : undefined}
exiting={useFadeOut ? FadeOut.duration(FADE_DURATION) : undefined}
style={style.container}
testID={testID}
>

View file

@ -145,7 +145,7 @@ const SkinToneSelector = ({skinTone = 'default', containerWidth, isSearching, tu
>
<Animated.View
style={widthAnimatedStyle}
exiting={FadeOut}
exiting={Platform.OS === 'android' ? undefined : FadeOut /* https://mattermost.atlassian.net/browse/MM-63814?focusedCommentId=178584 */}
entering={FadeIn}
>
<Animated.View style={[styles.container, opacityStyle]}>

View file

@ -4,7 +4,7 @@
import {debounce, type DebouncedFunc} from 'lodash';
import React, {useCallback, useEffect, useMemo, useRef, useState} from 'react';
import {useIntl} from 'react-intl';
import {Alert, FlatList, type ListRenderItemInfo, StyleSheet, View} from 'react-native';
import {Alert, FlatList, type ListRenderItemInfo, Platform, StyleSheet, View} from 'react-native';
import Animated, {FadeInDown, FadeOutUp} from 'react-native-reanimated';
import {switchToGlobalThreads} from '@actions/local/thread';
@ -336,7 +336,7 @@ const FilteredList = ({
return (
<Animated.View
entering={FadeInDown.duration(100)}
exiting={FadeOutUp.duration(100)}
exiting={Platform.select({ios: FadeOutUp.duration(100)}) /* https://mattermost.atlassian.net/browse/MM-63814?focusedCommentId=178584 */}
style={style.flex}
>
<FlatList

View file

@ -3,7 +3,7 @@
import React, {useCallback} from 'react';
import {useIntl} from 'react-intl';
import {StyleSheet, View} from 'react-native';
import {Platform, StyleSheet, View} from 'react-native';
import Animated, {FadeInDown, FadeOutUp} from 'react-native-reanimated';
import CompassIcon from '@components/compass_icon';
@ -66,7 +66,7 @@ const QuickOptions = ({canCreateChannels, canJoinChannels, close}: Props) => {
return (
<Animated.View
entering={FadeInDown.duration(200)}
exiting={FadeOutUp.duration(100)}
exiting={Platform.select({ios: FadeOutUp.duration(100)}) /* https://mattermost.atlassian.net/browse/MM-63814?focusedCommentId=178584 */}
style={styles.container}
>
<Animated.View style={styles.wrapper}>

View file

@ -3,7 +3,7 @@
import React, {useCallback, useEffect, useMemo, useState} from 'react';
import {useIntl} from 'react-intl';
import {SectionList, type SectionListRenderItemInfo, StyleSheet} from 'react-native';
import {Platform, SectionList, type SectionListRenderItemInfo, StyleSheet} from 'react-native';
import Animated, {FadeInDown, FadeOutUp} from 'react-native-reanimated';
import {switchToChannelById} from '@actions/remote/channel';
@ -81,7 +81,7 @@ const UnfilteredList = ({close, keyboardOverlap, recentChannels, showTeamName, t
return (
<Animated.View
entering={FadeInDown.duration(200)}
exiting={FadeOutUp.duration(100)}
exiting={Platform.select({ios: FadeOutUp.duration(100)}) /* https://mattermost.atlassian.net/browse/MM-63814?focusedCommentId=178584 */}
style={style.flex}
>
<SectionList

View file

@ -25,7 +25,7 @@ import {
LoginScreen,
ServerScreen,
} from '@support/ui/screen';
import {isIos, timeouts, wait} from '@support/utils';
import {timeouts, wait} from '@support/utils';
import {expect} from 'detox';
describe('Channels - Find Channels', () => {
@ -68,8 +68,7 @@ describe('Channels - Find Channels', () => {
await FindChannelsScreen.close();
});
// TODO: Uncomment this test when the issue is fixed https://mattermost.atlassian.net/browse/MM-63814
(device.getPlatform() === 'ios' ? it : it.skip)('MM-T4907_2 - should be able to find and navigate to a public channel', async () => {
it('MM-T4907_2 - should be able to find and navigate to a public channel', async () => {
// # Open find channels screen and search for a public channel to navigate to
await FindChannelsScreen.open();
await FindChannelsScreen.searchInput.replaceText(testChannel.display_name);
@ -99,7 +98,7 @@ describe('Channels - Find Channels', () => {
await FindChannelsScreen.close();
});
(isIos() ? it : it.skip)('MM-T4907_4 - should be able to find direct and group message channels', async () => {
it('MM-T4907_4 - should be able to find direct and group message channels', async () => {
// # Create direct and group message channels, open find channels screen, and search for the direct message channel
const {user: testOtherUser1} = await User.apiCreateUser(siteOneUrl, {prefix: 'a'});
await Team.apiAddUserToTeam(siteOneUrl, testOtherUser1.id, testTeam.id);
@ -128,7 +127,7 @@ describe('Channels - Find Channels', () => {
await ChannelScreen.back();
});
(device.getPlatform() === 'ios' ? it : it.skip)('MM-T4907_5 - should be able to find an archived channel', async () => {
it('MM-T4907_5 - should be able to find an archived channel', async () => {
// # Archive a channel, open find channels screen, and search for the archived channel
const {channel: archivedChannel} = await Channel.apiCreateChannel(siteOneUrl, {teamId: testTeam.id});
await Channel.apiAddUserToChannel(siteOneUrl, testUser.id, archivedChannel.id);

View file

@ -139,8 +139,7 @@ describe('Smoke Test - Channels', () => {
await ChannelScreen.back();
});
// TODO: Uncomment the test when the issue is fixed https://mattermost.atlassian.net/browse/MM-63814
it.skip('MM-T4774_4 - should be able to find and edit a channel', async () => {
it('MM-T4774_4 - should be able to find and edit a channel', async () => {
// # Open find channels screen, search for the channel to navigate to, and tap on the target channel item
await FindChannelsScreen.open();
await FindChannelsScreen.searchInput.replaceText(testChannel.name);

View file

@ -4,7 +4,7 @@
import {useNavigation} from '@react-navigation/native';
import React, {useCallback, useMemo} from 'react';
import {useIntl} from 'react-intl';
import {FlatList, type ListRenderItemInfo, StyleSheet, View} from 'react-native';
import {FlatList, type ListRenderItemInfo, Platform, StyleSheet, View} from 'react-native';
import Animated, {FadeInDown, FadeOutUp} from 'react-native-reanimated';
import NoResultsWithTerm from '@components/no_results_with_term';
@ -94,7 +94,7 @@ const SearchChannels = ({
return (
<Animated.View
entering={FadeInDown.duration(100)}
exiting={FadeOutUp.duration(100)}
exiting={Platform.select({ios: FadeOutUp.duration(100)}) /* https://mattermost.atlassian.net/browse/MM-63814?focusedCommentId=178584 */}
style={style.flex}
>
<FlatList