Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
92685e6
fix(MessageComposer): lift the composer above bottomInset while the a…
isekovanic Nov 26, 2026
ebfab9f
feat: scheduled messages foundation
isekovanic Nov 26, 2026
3bcb60b
feat(MessageComposer): schedule a message
isekovanic Nov 26, 2026
79f2a0a
feat(MessageList): scheduled messages banner
isekovanic Nov 27, 2026
645056d
feat(MessageComposer): edit a scheduled message
isekovanic Nov 27, 2026
ad603d3
fix(ScheduledMessages): slide the reschedule sheet closed after resch…
isekovanic Nov 27, 2026
c008a57
feat(ScheduledMessages): scheduled messages list
isekovanic Nov 27, 2026
79ca93f
refactor(ScheduledMessages): plain StyleSheet.create for styles that …
isekovanic Nov 27, 2026
f3caead
fix(ScheduledMessages): follow the Figma tokens and bindings
isekovanic Nov 27, 2026
6039bf4
feat(ChannelDetails): scheduled messages row
isekovanic Nov 27, 2026
638c76e
chore(SampleApp): scheduled messages screens
isekovanic Nov 27, 2026
2a6f35d
fix(ScheduledMessages): open the keyboard when a scheduled edit start…
isekovanic Nov 27, 2026
5c8b169
fix(MessageComposer): give the floating attach button a surface and s…
isekovanic Nov 27, 2026
ba0553f
feat(ScheduledMessages): loading skeleton shaped like the list rows
isekovanic Nov 27, 2026
17a9a49
feat(ScheduledMessages): pick the custom time with the native date an…
isekovanic Nov 27, 2026
3dad238
chore(ExpoMessaging): use react-native 0.88.1
isekovanic Nov 27, 2026
4581b80
feat(ScheduledMessages): format scheduled times through timestamp tra…
isekovanic Nov 27, 2026
b7e0ec1
fix(MessageComposer): keep the floating composer height positive whil…
isekovanic Nov 27, 2026
80331ee
feat(ScheduledMessages): show messages still being scheduled as uploa…
isekovanic Nov 30, 2026
18d05bd
test(ScheduledMessages): cover a row the server is sending and find t…
isekovanic Nov 30, 2026
13f7cd0
feat(OfflineDB): store scheduled messages
isekovanic Nov 30, 2026
95f9ac6
feat(ScheduledMessages): act on a scheduled message whose request is …
isekovanic Nov 30, 2026
12161ad
feat(OfflineDB): return the stored scheduled messages with their chan…
isekovanic Dec 1, 2026
1fae4de
refactor(ScheduledMessages): read the client's own fields from localM…
isekovanic Dec 1, 2026
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 examples/ExpoMessaging/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"expo-video": "~58.0.10",
"react": "19.3.0",
"react-dom": "19.3.0",
"react-native": "0.88.0",
"react-native": "0.88.1",
"react-native-gesture-handler": "~3.4.0",
"react-native-keyboard-controller": "1.22.7",
"react-native-maps": "1.29.11",
Expand Down
6 changes: 6 additions & 0 deletions examples/SampleApp/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ import { MapScreen } from './src/screens/MapScreen';
import { NewDirectMessagingScreen } from './src/screens/NewDirectMessagingScreen';
import { NewGroupChannelAddMemberScreen } from './src/screens/NewGroupChannelAddMemberScreen';
import { NewGroupChannelAssignNameScreen } from './src/screens/NewGroupChannelAssignNameScreen';
import { ScheduledMessagesScreen } from './src/screens/ScheduledMessagesScreen';
import { ThreadScreen } from './src/screens/ThreadScreen';
import { UserSelectorScreen } from './src/screens/UserSelectorScreen';

Expand Down Expand Up @@ -462,6 +463,11 @@ const HomeScreen = () => {
name='ChannelPinnedMessagesScreen'
options={{ headerShown: false }}
/>
<Stack.Screen
component={ScheduledMessagesScreen}
name='ScheduledMessagesScreen'
options={{ headerShown: false }}
/>
<Stack.Screen
component={ThreadScreen}
name='ThreadScreen'
Expand Down
59 changes: 42 additions & 17 deletions examples/SampleApp/src/components/BottomTabs.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
import React from 'react';
import { StyleSheet, Text, TouchableOpacity, View } from 'react-native';
import Animated, {
LayoutAnimationConfig,
SlideInDown,
SlideOutDown,
} from 'react-native-reanimated';
import { useSafeAreaInsets } from 'react-native-safe-area-context';

import type { BottomTabBarProps } from '@react-navigation/bottom-tabs';
Expand All @@ -13,9 +18,12 @@ import { DraftsTab } from '../icons/DraftsTab';
import { MentionsTab } from '../icons/MentionsTab';

import { RemindersTab } from '../icons/ReminderTab';
import { ScheduledTab } from '../icons/ScheduledTab';
import { ThreadsTab } from '../icons/ThreadsTab';
import { useLegacyColors } from '../theme/useLegacyColors';

const TAB_BAR_SLIDE_DURATION_MS = 200;

const styles = StyleSheet.create({
notification: {
left: 25, // size of icon
Expand Down Expand Up @@ -72,6 +80,12 @@ const getTab = (key: string) => {
iconActive: <RemindersTab active />,
title: 'Reminders',
};
case 'ScheduledScreen':
return {
icon: <ScheduledTab />,
iconActive: <ScheduledTab active />,
title: 'Scheduled',
};
// Add more cases for other tabs as needed
default:
return null;
Expand Down Expand Up @@ -127,28 +141,39 @@ const Tab = (props: TabProps) => {
};

export const BottomTabs: React.FC<BottomTabBarProps> = (props) => {
const { navigation, state } = props;
const { descriptors, navigation, state } = props;
const {
theme: { semantics },
} = useTheme();
const { bottom, left, right } = useSafeAreaInsets();
const { tabBarStyle } = descriptors[state.routes[state.index].key].options;

// A screen hides the tab bar with `tabBarStyle: { display: 'none' }`, e.g. while editing. It
// slides down out of view, and back up when shown again, but not when the app opens.
const hidden = StyleSheet.flatten(tabBarStyle)?.display === 'none';

return (
<View
style={[
styles.tabListContainer,
{
backgroundColor: semantics.backgroundCoreElevation1,
borderTopColor: semantics.borderCoreSubtle,
paddingBottom: bottom,
paddingLeft: left,
paddingRight: right,
},
]}
>
{state.routes.map((route, index) => (
<Tab key={index} route={route} index={index} navigation={navigation} state={state} />
))}
</View>
<LayoutAnimationConfig skipEntering>
{hidden ? null : (
<Animated.View
entering={SlideInDown.duration(TAB_BAR_SLIDE_DURATION_MS)}
exiting={SlideOutDown.duration(TAB_BAR_SLIDE_DURATION_MS)}
style={[
styles.tabListContainer,
{
backgroundColor: semantics.backgroundCoreElevation1,
borderTopColor: semantics.borderCoreSubtle,
paddingBottom: bottom,
paddingLeft: left,
paddingRight: right,
},
]}
>
{state.routes.map((route, index) => (
<Tab key={index} route={route} index={index} navigation={navigation} state={state} />
))}
</Animated.View>
)}
</LayoutAnimationConfig>
);
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import { useEffect, useMemo } from 'react';

import { ScheduledMessagePaginator, ScheduledMessagesView } from 'stream-chat';
import { useChatContext } from 'stream-chat-react-native';

/**
* Every scheduled message of the user, across channels. Its paginator is registered with the
* client while mounted, so the list follows the scheduled message events.
*/
export const useAllScheduledMessagesView = () => {
const { client } = useChatContext();
const view = useMemo(
() => new ScheduledMessagesView({ paginator: new ScheduledMessagePaginator({ client }) }),
[client],
);

useEffect(() => {
const manager = client.scheduledMessagePaginators;
manager.insertPaginator({ paginator: view.paginator });
return () => {
manager.removePaginator(view.paginator);
};
}, [client, view]);

return view;
};
35 changes: 35 additions & 0 deletions examples/SampleApp/src/icons/ScheduledTab.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import React from 'react';
import Svg, { Path } from 'react-native-svg';

import { useLegacyColors } from '../theme/useLegacyColors';
import { IconProps } from '../utils/base';

/** A filled clock while the tab is active, and the SDK's outlined clock otherwise, as in Figma. */
export const ScheduledTab: React.FC<IconProps> = ({ active, height = 24, width = 24 }) => {
const { black, grey } = useLegacyColors();

if (!active) {
return (
<Svg fill='none' height={height} viewBox='0 0 20 20' width={width}>
<Path
d='M10 5.625V10H14.375M17.5 10C17.5 14.1421 14.1421 17.5 10 17.5C5.85786 17.5 2.5 14.1421 2.5 10C2.5 5.85786 5.85786 2.5 10 2.5C14.1421 2.5 17.5 5.85786 17.5 10Z'
stroke={grey}
strokeLinecap='round'
strokeLinejoin='round'
strokeWidth={1.5}
/>
</Svg>
);
}

return (
<Svg fill='none' height={height} viewBox='0 0 24 24' width={width}>
<Path
clipRule='evenodd'
d='M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10zm1-15a1 1 0 10-2 0v5a1 1 0 00.293.707l3 3a1 1 0 001.414-1.414L13 11.586V7z'
fill={black}
fillRule='evenodd'
/>
</Svg>
);
};
4 changes: 3 additions & 1 deletion examples/SampleApp/src/screens/ChannelDetailsScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,11 @@ const navigationItems: {
[key in ChannelDetailsNavigationSectionType]:
| 'ChannelPinnedMessagesScreen'
| 'ChannelImagesScreen'
| 'ChannelFilesScreen';
| 'ChannelFilesScreen'
| 'ScheduledMessagesScreen';
} = {
'pinned-messages': 'ChannelPinnedMessagesScreen',
'scheduled-messages': 'ScheduledMessagesScreen',
'photos-and-videos': 'ChannelImagesScreen',
files: 'ChannelFilesScreen',
};
Expand Down
7 changes: 7 additions & 0 deletions examples/SampleApp/src/screens/ChannelScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,12 @@ export const ChannelScreen: React.FC<ChannelScreenProps> = ({ navigation, route
[channel, messageId, navigation, setThread],
);

const onScheduledMessagesBannerPress = useCallback(
({ channel: bannerChannel }: { channel: StreamChatChannel }) =>
navigation.navigate('ScheduledMessagesScreen', { channel: bannerChannel }),
[navigation],
);

const handleMessageInfo = useCallback((message: LocalMessage) => {
setSelectedMessage(message);
setModalVisible(true);
Expand Down Expand Up @@ -387,6 +393,7 @@ export const ChannelScreen: React.FC<ChannelScreenProps> = ({ navigation, route
keyboardVerticalOffset={0}
messageActions={messageActions}
onAlsoSentToChannelHeaderPress={onAlsoSentToChannelHeaderPress}
onScheduledMessagesBannerPress={onScheduledMessagesBannerPress}
>
<PortalWhileClosingView portalHostName='overlay-header' portalName='channel-header'>
<ChannelHeader channel={channel} />
Expand Down
6 changes: 6 additions & 0 deletions examples/SampleApp/src/screens/ChatScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { ChannelListScreen } from './ChannelListScreen';
import { DraftsScreen } from './DraftScreen';
import { MentionsScreen } from './MentionsScreen';
import { RemindersScreen } from './RemindersScreen';
import { ScheduledScreen } from './ScheduledScreen';
import { ThreadListScreen } from './ThreadListScreen';

import { BottomTabs } from '../components/BottomTabs';
Expand Down Expand Up @@ -39,6 +40,11 @@ export const ChatScreen: React.FC<Props> = () => (
name='ThreadsScreen'
options={{ headerShown: false }}
/>
<Tab.Screen
component={ScheduledScreen}
name='ScheduledScreen'
options={{ headerShown: false }}
/>
<Tab.Screen component={DraftsScreen} name='DraftsScreen' options={{ headerShown: false }} />
<Tab.Screen
component={RemindersScreen}
Expand Down
49 changes: 49 additions & 0 deletions examples/SampleApp/src/screens/ScheduledMessagesScreen.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
import React from 'react';
import { StyleSheet } from 'react-native';

import { SafeAreaView } from 'react-native-safe-area-context';

import type { RouteProp } from '@react-navigation/native';
import { Channel, ChannelScheduledMessages } from 'stream-chat-react-native';

import { ScreenHeader } from '../components/ScreenHeader';
import { useAppContext } from '../context/AppContext';
import type { StackNavigatorParamList } from '../types';

export type ScheduledMessagesScreenProps = {
route: RouteProp<StackNavigatorParamList, 'ScheduledMessagesScreen'>;
};

/**
* A channel's or a thread's scheduled messages. The `Channel` is set up like the channel screen's,
* so editing uses the same composer, but it neither loads messages nor marks the channel read.
*/
export const ScheduledMessagesScreen: React.FC<ScheduledMessagesScreenProps> = ({
route: {
params: { channel, thread },
},
}) => {
const { messageInputFloating } = useAppContext();

return (
<SafeAreaView edges={['left', 'right']} style={styles.flex}>
<Channel
audioRecordingEnabled={true}
channel={channel}
initializeOnMount={false}
keyboardVerticalOffset={0}
markReadOnMount={false}
messageInputFloating={messageInputFloating}
>
<ScreenHeader titleText='Scheduled messages' />
<ChannelScheduledMessages view={thread?.scheduledMessages} />
</Channel>
</SafeAreaView>
);
};

const styles = StyleSheet.create({
flex: {
flex: 1,
},
});
Loading
Loading