Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build-ios-spm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ permissions:
jobs:
build_ios_spm:
name: Build SampleApp iOS (Swift Package Manager)
runs-on: [macos-15]
runs-on: { group: scaleway-macos }
env:
STREAM_CHAT_SPM_ONLY: '1'
# `pod deintegrate`, run by `react-native spm add --deintegrate`, needs a UTF-8 locale.
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/e2e-test-cron.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
ios:
name: Test iOS ${{ matrix.ios }}
if: (github.event_name == 'schedule' || inputs.ios) && (inputs.mock_server_branch || 'main') == 'main'
runs-on: xcode-27
runs-on: { group: scaleway-macos }
timeout-minutes: 360
strategy:
fail-fast: false
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/e2e-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ jobs:
ios:
needs: check
if: needs.check.outputs.required == 'true' && github.event_name == 'workflow_dispatch' && inputs.ios
runs-on: macos-15
runs-on: { group: scaleway-macos }
timeout-minutes: 60
env:
DETOX_IOS_DEVICE: "iPhone 17 Pro"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/sample-distribution.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ env:
jobs:
build_and_deploy_ios_testflight_qa:
name: Build SampleApp iOS and Deploy-${{ github.ref_name == 'develop' || github.ref_name == vars.RC_BRANCH }}
runs-on: [xcode-27]
runs-on: { group: scaleway-macos }
strategy:
matrix:
node-version: [24.x]
Expand Down
15 changes: 15 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,21 @@ export default tsEslint.config(
'react-hooks/rules-of-hooks': 'error',
'react-native/no-inline-styles': 'off',
'react/no-unstable-nested-components': 'warn',
// Reanimated ignores hook dependencies on native and warns when they're passed.
'no-restricted-syntax': [
'error',
{
message:
'Reanimated ignores dependencies on native and warns about them. Drop the argument.',
selector:
'CallExpression[callee.name=/^(useAnimatedStyle|useDerivedValue|useAnimatedProps|useAnimatedScrollHandler)$/][arguments.length>1]:not([arguments.1.value=null])',
},
{
message:
'Reanimated ignores dependencies on native and warns about them. Drop the argument.',
selector: "CallExpression[callee.name='useAnimatedReaction'][arguments.length>2]",
},
],

// -- Hygiene rules previously enabled via @react-native/eslint-config that we
// kept after dropping the package -- they catch real footguns.
Expand Down
2 changes: 1 addition & 1 deletion examples/SampleApp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"@react-navigation/native": "^7.5.0",
"@react-navigation/native-stack": "^7.20.0",
"@shopify/flash-list": "^2.3.3",
"@stream-io/state-store": "^1.2.0",
"@stream-io/state-store": "^1.3.1",
"dayjs": "^1.11.23",
"emoji-mart": "^5.6.0",
"lodash.mergewith": "^4.6.2",
Expand Down
15 changes: 6 additions & 9 deletions examples/SampleApp/src/components/SecretMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,16 +89,13 @@ export const SlideInView = ({
animatedHeight.value = height;
};

const animatedStyle = useAnimatedStyle(
() => ({
height: withSpring(visible ? animatedHeight.value : 0, {
damping: 20,
overshootClamping: true,
}),
opacity: withTiming(visible ? 1 : 0, { duration: 500 }),
const animatedStyle = useAnimatedStyle(() => ({
height: withSpring(visible ? animatedHeight.value : 0, {
damping: 20,
overshootClamping: true,
}),
[visible],
);
opacity: withTiming(visible ? 1 : 0, { duration: 500 }),
}));

return (
<Animated.View style={animatedStyle}>
Expand Down
2 changes: 1 addition & 1 deletion package/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
"@gorhom/bottom-sheet": "^5.2.14",
"@legendapp/list": "^3.7.1",
"@stream-io/i18n": "^1.1.0",
"@stream-io/state-store": "^1.2.0",
"@stream-io/state-store": "^1.3.1",
"@ungap/structured-clone": "^1.3.0",
"dayjs": "^1.11.23",
"emoji-regex": "^10.4.0",
Expand Down
2 changes: 1 addition & 1 deletion package/src/ai-components/generative-ui/AIUIEntrance.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ const useEntrance = (
// Back in focus as it settles: a blur this small draws nothing.
...(CAN_BLUR ? { filter: [{ blur: Math.max(0, 1 - shown) * START_BLUR }] } : {}),
};
}, [reduceMotion]);
});
return { hasShown, style };
};

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { useStateStore } from '@stream-io/state-store/react-bindings';
import { AIState, AIStates, Channel } from 'stream-chat';

import { useStateStore } from '../../../hooks/useStateStore';

// Re-exports `AIStates` from `stream-chat` so it can be imported from this module.
export { AIStates };

Expand Down
3 changes: 2 additions & 1 deletion package/src/components/Accessibility/OverlayA11yShield.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import React, { PropsWithChildren } from 'react';
import { Platform, StyleSheet, View } from 'react-native';

import { useStateStore } from '@stream-io/state-store/react-bindings';

import { useAccessibilityServiceEnabled } from '../../a11y';
import { useAccessibilityContext } from '../../contexts/accessibilityContext/AccessibilityContext';
import { useOverlayContext } from '../../contexts/overlayContext/OverlayContext';
import { useStateStore } from '../../hooks';
import { overlayStore } from '../../state-store/message-overlay-store';

const messageOverlayActiveSelector = (state: { id: string | undefined }) => ({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React, { RefObject, useEffect, useMemo } from 'react';
import { I18nManager, StyleProp, StyleSheet, Text, TextStyle, View, ViewStyle } from 'react-native';

import { useStateStore } from '@stream-io/state-store/react-bindings';
import dayjs from 'dayjs';
import duration from 'dayjs/plugin/duration';

Expand All @@ -17,7 +18,6 @@ import { PlayPauseButton } from './PlayPauseButton';

import { useChannelContext, useChatConfigContext, useTheme } from '../../../contexts';
import { useStableCallback } from '../../../hooks';
import { useStateStore } from '../../../hooks';
import { useAudioPlayer } from '../../../hooks/useAudioPlayer';
import {
NativeHandlers,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React, { useCallback } from 'react';

import { Alert, Image, StyleSheet, Text, View } from 'react-native';

import { useStateStore } from '@stream-io/state-store/react-bindings';
import {
AttachmentManagerState,
FileReference,
Expand All @@ -19,7 +20,6 @@ import { useMessageComposer } from '../../../../contexts/messageInputContext/hoo
import { useMessageInputContext } from '../../../../contexts/messageInputContext/MessageInputContext';
import { useTheme } from '../../../../contexts/themeContext/ThemeContext';
import { useTranslationContext } from '../../../../contexts/translationContext/TranslationContext';
import { useStateStore } from '../../../../hooks/useStateStore';
import { useWindowContentWidth } from '../../../../hooks/useWindowContentWidth';
import { NativeHandlers } from '../../../../native';
import { primitives } from '../../../../theme';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { Linking, Platform, Pressable, StyleSheet, Text } from 'react-native';

import { FlatList } from 'react-native-gesture-handler';

import { useStateStore } from '@stream-io/state-store/react-bindings';
import { CommandSearchSource, CommandSuggestion, notifyCommandDisabled } from 'stream-chat';

import { AttachmentMediaPicker } from './AttachmentMediaPicker/AttachmentMediaPicker';
Expand All @@ -22,7 +23,6 @@ import {
import { useComponentsContext } from '../../../contexts/componentsContext/ComponentsContext';
import { useTheme } from '../../../contexts/themeContext/ThemeContext';
import { useAttachmentPickerState, useStableCallback } from '../../../hooks';
import { useStateStore } from '../../../hooks/useStateStore';
import { primitives } from '../../../theme';
import { CommandSuggestionItem } from '../../AutoCompleteInput/AutoCompleteSuggestionItem';

Expand Down Expand Up @@ -133,10 +133,17 @@ export const AttachmentCommandPicker = () => {
);
const { commands } = useStateStore(channel.configState, commandsSelector);
const styles = useCommandPickerStyle();
const {
theme: {
attachmentPicker: { commandsTitle },
},
} = useTheme();

return (
<>
<Text style={styles.title}>{t('attachmentPicker.commands.title', 'Instant Commands')}</Text>
<Text style={[styles.title, commandsTitle]}>
{t('attachmentPicker.commands.title', 'Instant Commands')}
</Text>
<FlatList
contentContainerStyle={styles.contentContainer}
renderItem={renderItem}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React from 'react';
import { StyleSheet } from 'react-native';

import { act, cleanup, render, screen } from '@testing-library/react-native';
import type { Channel, Command, StreamChat } from 'stream-chat';
Expand Down Expand Up @@ -44,4 +45,21 @@ describe('AttachmentCommandPicker', () => {

expect(screen.getByText('Giphy')).toBeTruthy();
});

it('applies the commandsTitle theme over the default title style', () => {
render(
<Chat
client={chatClient}
style={{ attachmentPicker: { commandsTitle: { fontFamily: 'Inter' } } }}
>
<MessageComposerProvider value={{ channel, thread: undefined }}>
<AttachmentCommandPicker />
</MessageComposerProvider>
</Chat>,
);

const title = StyleSheet.flatten(screen.getByText('Instant Commands').props.style);
expect(title.fontFamily).toBe('Inter');
expect(title.fontWeight).toBeDefined();
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@ import {
TextInputSelectionChangeEvent,
} from 'react-native';

import Animated, { LinearTransition } from 'react-native-reanimated';
import Animated from 'react-native-reanimated';

import { useStateStore } from '@stream-io/state-store/react-bindings';
import { MessageComposerConfig, TextComposerState } from 'stream-chat';

import { useAnimationsContext } from '../../contexts/animationsContext/AnimationsContext';
import {
ChannelContextValue,
useChannelContext,
Expand All @@ -26,7 +28,6 @@ import {
} from '../../contexts/translationContext/TranslationContext';

import { useStableCallback } from '../../hooks';
import { useStateStore } from '../../hooks/useStateStore';
import type { TextInputRef } from '../../types/react-native-compat';
import { useCooldownRemaining } from '../MessageInput/hooks/useCooldownRemaining';

Expand Down Expand Up @@ -92,6 +93,7 @@ const commandPlaceHolders: Record<string, string> = {
};

const AutoCompleteInputWithContext = (props: AutoCompleteInputPropsWithContext) => {
const animations = useAnimationsContext();
const styles = useStyles();
const {
// Unused: destructured only to keep the channel out of `...rest`, which is spread onto the
Expand Down Expand Up @@ -238,7 +240,7 @@ const AutoCompleteInputWithContext = (props: AutoCompleteInputPropsWithContext)
return (
<AnimatedTextInputRenderer
TextInputComponent={TextInputComponent}
layout={LinearTransition.duration(200)}
layout={animations.transitions.composerContent.layout}
autoFocus={!!command}
editable={enabled}
maxLength={maxMessageLength}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,18 @@ import { StyleSheet } from 'react-native';

import { FlatList } from 'react-native-gesture-handler';

import Animated, { LinearTransition, ZoomIn, ZoomOut } from 'react-native-reanimated';
import Animated, { ZoomIn, ZoomOut } from 'react-native-reanimated';

import { useStateStore } from '@stream-io/state-store/react-bindings';
import { SearchSourceState, TextComposerState, TextComposerSuggestion } from 'stream-chat';

import { useA11yLabel } from '../../a11y/hooks/useA11yLabel';
import { useAnnounceOnShow } from '../../a11y/hooks/useAnnounceOnShow';
import { useAnimationsContext } from '../../contexts/animationsContext/AnimationsContext';
import { useComponentsContext } from '../../contexts/componentsContext/ComponentsContext';
import { useMessageComposer } from '../../contexts/messageInputContext/hooks/useMessageComposer';
import { useTheme } from '../../contexts/themeContext/ThemeContext';
import { useStableCallback } from '../../hooks';
import { useStateStore } from '../../hooks/useStateStore';
import { primitives } from '../../theme';
import { ClippingFadeBottom } from '../UIComponents/ClippingFadeBottom';

Expand All @@ -31,6 +32,7 @@ const searchSourceStateSelector = (nextValue: SearchSourceState) => ({
});

export const AutoCompleteSuggestionList = () => {
const animations = useAnimationsContext();
const { AutoCompleteSuggestionHeader, AutoCompleteSuggestionItem } = useComponentsContext();

const messageComposer = useMessageComposer();
Expand Down Expand Up @@ -96,7 +98,7 @@ export const AutoCompleteSuggestionList = () => {
accessibilityRole='menu'
entering={ZoomIn.duration(200)}
exiting={ZoomOut.duration(200)}
layout={LinearTransition.duration(200)}
layout={animations.transitions.suggestionListContent.layout}
style={styles.container}
>
<FlatList
Expand Down
3 changes: 2 additions & 1 deletion package/src/components/Channel/Channel.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import React, { PropsWithChildren, useMemo } from 'react';
import { StyleSheet, Text } from 'react-native';

import { useStateStore } from '@stream-io/state-store/react-bindings';

import { ChannelConfigProps, ChannelShell } from './ChannelShell';

import { useChannelLifecycle } from './hooks/useChannelLifecycle';
Expand All @@ -14,7 +16,6 @@ import {
TranslationContextValue,
useTranslationContext,
} from '../../contexts/translationContext/TranslationContext';
import { useStateStore } from '../../hooks/useStateStore';
import { primitives } from '../../theme';

import { getChannelNotificationHostId } from '../Notifications/notificationTarget';
Expand Down
2 changes: 1 addition & 1 deletion package/src/components/Channel/ChannelShell.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React, { PropsWithChildren, useCallback, useMemo, useState } from 'react';
import { View } from 'react-native';

import { useStateStore } from '@stream-io/state-store/react-bindings';
import type {
Channel,
ChannelConfig,
Expand Down Expand Up @@ -43,7 +44,6 @@ import {
import { useStableCallback } from '../../hooks';
import { useAppStateListener } from '../../hooks/useAppStateListener';
import { useAttachmentPickerBottomSheet } from '../../hooks/useAttachmentPickerBottomSheet';
import { useStateStore } from '../../hooks/useStateStore';
import {
isDocumentPickerAvailable,
isImageMediaLibraryAvailable,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { useMemo } from 'react';

import { useStateStore } from '@stream-io/state-store/react-bindings';
import type { Channel, OwnCapabilitiesState } from 'stream-chat';

import {
allOwnCapabilities,
OwnCapabilitiesContextValue,
OwnCapability,
} from '../../../contexts/ownCapabilitiesContext/OwnCapabilitiesContext';
import { useStateStore } from '../../../hooks/useStateStore';

// TODO: Move own_capabilities as part of channel state rather than having to do
// stuff like this.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { useStateStore } from '@stream-io/state-store/react-bindings';
import type { Channel, ChannelStateData, EditingAuditState } from 'stream-chat';

import { useStateStore } from '../../../hooks/useStateStore';

const supersededBySelector = ({ supersededBy }: ChannelStateData) => ({ supersededBy });
const activeSelector = ({ active }: ChannelStateData) => ({ active });
const editingAuditStateSelector = (state: EditingAuditState) => state;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import React, { useCallback, useEffect, useMemo, useState } from 'react';
import { StyleSheet, View } from 'react-native';

import { useStateStore } from '@stream-io/state-store/react-bindings';

import { useChannelDetailsContext } from '../../../contexts/channelDetailsContext/channelDetailsContext';
import { useChannelEditDetailsContext } from '../../../contexts/channelEditDetailsContext/ChannelEditDetailsContext';
import { useComponentsContext } from '../../../contexts/componentsContext/ComponentsContext';
import { useTheme } from '../../../contexts/themeContext/ThemeContext';
import { useTranslationContext } from '../../../contexts/translationContext/TranslationContext';
import { useStateStore } from '../../../hooks/useStateStore';
import type { EditChannelDetailsState } from '../../../state-store/edit-channel-details-store';
import { primitives } from '../../../theme';
import { ChannelAvatar } from '../../ui/Avatar/ChannelAvatar';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,13 @@ import {
ViewStyle,
} from 'react-native';

import { useStateStore } from '@stream-io/state-store/react-bindings';

import { useBottomSheetContext } from '../../../contexts';
import { useChannelEditDetailsContext } from '../../../contexts/channelEditDetailsContext/ChannelEditDetailsContext';
import { useComponentsContext } from '../../../contexts/componentsContext/ComponentsContext';
import { useTheme } from '../../../contexts/themeContext/ThemeContext';
import { useTranslationContext } from '../../../contexts/translationContext/TranslationContext';
import { useStateStore } from '../../../hooks/useStateStore';
import type { IconProps } from '../../../icons/utils/base';
import type {
EditChannelDetailsState,
Expand Down
Loading
Loading