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/cancel-pr-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ permissions:
jobs:
cancel:
name: Cancel
runs-on: ubuntu-latest
runs-on: { group: github-public-amd64 }
steps:
# Match on the head repository too: a fork's branch can share its name with another PR's branch.
# Not on the PR number: GitHub leaves `pull_requests` empty on runs from forks and once the PR is closed.
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/changelog-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
permissions:
contents: write
pull-requests: write
runs-on: ubuntu-latest
runs-on: { group: github-public-amd64 }
strategy:
matrix:
node-version: [ 24.x ]
Expand Down
18 changes: 9 additions & 9 deletions .github/workflows/e2e-test-cron.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,14 @@ jobs:
ios:
name: Test iOS ${{ matrix.ios }}
if: (github.event_name == 'schedule' || inputs.ios) && (inputs.mock_server_branch || 'main') == 'main'
runs-on: macos-15
runs-on: xcode-27
timeout-minutes: 360
strategy:
fail-fast: false
matrix:
include:
- ios: "26.2"
device: "iPhone 17 Pro"
- ios: "27.2"
device: "iPhone 18 Pro"
setup_runtime: false
# The oldest runtime the Flutter nightly covers; the runner image doesn't ship it.
- ios: "17.5"
Expand All @@ -62,7 +62,7 @@ jobs:
DETOX_IOS_DEVICE: ${{ matrix.device }}
IOS_VERSION: ${{ matrix.ios }}
# Pinned to match the simulator runtimes this job selects.
XCODE_VERSION: "26.2"
XCODE_VERSION: "27.2"
APP_PATH: examples/E2ETestApp/ios/build/detox/Build/Products/Release-iphonesimulator/E2ETestApp.app
MOCK_SERVER_BUNDLE_PATH: ${{ github.workspace }}/../mock-server-gems
steps:
Expand Down Expand Up @@ -226,7 +226,7 @@ jobs:
# saved by a pull request is visible to that pull request alone, and one saved on develop to all.
android-avd:
name: Android emulator snapshot
runs-on: ubuntu-latest
runs-on: { group: github-public-amd64 }
timeout-minutes: 30
steps:
- uses: actions/checkout@v6
Expand Down Expand Up @@ -279,7 +279,7 @@ jobs:
android-build:
name: Build Android (${{ matrix.coverage && 'coverage' || 'plain' }})
if: github.event_name == 'schedule' || inputs.android || (inputs.mock_server_branch || 'main') != 'main'
runs-on: ubuntu-latest
runs-on: { group: github-public-amd64 }
timeout-minutes: 60
strategy:
fail-fast: false
Expand Down Expand Up @@ -337,7 +337,7 @@ jobs:
android:
name: Test Android API ${{ matrix.api-level }}${{ matrix.coverage && format(' coverage ({0})', matrix.batch) || '' }}
needs: android-build
runs-on: ubuntu-latest
runs-on: { group: github-public-amd64 }
timeout-minutes: 180
strategy:
fail-fast: false
Expand Down Expand Up @@ -485,7 +485,7 @@ jobs:
needs: android
# Failed tests keep their previous coverage; only a batch that never finished blocks the map.
if: ${{ !cancelled() && (github.event_name == 'schedule' || inputs.android) && (inputs.mock_server_branch || 'main') == 'main' }}
runs-on: ubuntu-latest
runs-on: { group: github-public-amd64 }
timeout-minutes: 15
steps:
- uses: actions/checkout@v6
Expand All @@ -511,7 +511,7 @@ jobs:

slack:
name: Slack Report
runs-on: ubuntu-latest
runs-on: { group: github-public-amd64 }
timeout-minutes: 10
needs: [ios, android-build, android, coverage_map]
# always(): a job that hit its timeout is `cancelled`, which failure() alone doesn't see.
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/e2e-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ env:
jobs:
check:
name: Check E2E Required
runs-on: ubuntu-latest
runs-on: { group: github-public-amd64 }
timeout-minutes: 10
outputs:
required: ${{ steps.check.outputs.required }}
Expand Down Expand Up @@ -234,7 +234,7 @@ jobs:
name: Build Android
needs: check
if: needs.check.outputs.required == 'true' && (github.event_name != 'workflow_dispatch' || inputs.android)
runs-on: ubuntu-latest
runs-on: { group: github-public-amd64 }
timeout-minutes: 60
env:
APK_PATHS: |
Expand Down Expand Up @@ -302,7 +302,7 @@ jobs:
android-allure-launch:
name: Launch Allure TestOps (Android)
needs: android-build
runs-on: ubuntu-latest
runs-on: { group: github-public-amd64 }
timeout-minutes: 10
outputs:
launch_id: ${{ steps.launch.outputs.launch_id }}
Expand All @@ -327,7 +327,7 @@ jobs:
name: Test Android
needs: [check, android-build, android-allure-launch]
if: ${{ !cancelled() && needs.android-build.result == 'success' }}
runs-on: ubuntu-latest
runs-on: { group: github-public-amd64 }
timeout-minutes: 60
strategy:
matrix:
Expand Down Expand Up @@ -437,7 +437,7 @@ jobs:

result:
name: Test E2E Result
runs-on: ubuntu-latest
runs-on: { group: github-public-amd64 }
if: always()
needs:
- check
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint-pr-title.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:

jobs:
lint_pr_title:
runs-on: ubuntu-latest
runs-on: { group: github-public-amd64 }
permissions:
pull-requests: read
steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
# Every run waits for a reviewer's approval, only the release branches may use this environment,
# and the npm trusted publisher requires it.
environment: npm-release
runs-on: ubuntu-latest
runs-on: { group: github-public-amd64 }
strategy:
matrix:
node-version: [24.x]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/sdk-size-metrics.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ permissions:
jobs:
sdk_size:
name: Metrics
runs-on: ubuntu-latest
runs-on: { group: github-public-amd64 }
steps:
# Short-lived token for pushing the size benchmark to stream-internal-metrics.
- name: Create metrics token
Expand Down
8 changes: 8 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,14 @@ Three-tier token architecture: **primitives** (raw colors) → **semantics** (e.

Platform-specific tokens are **generated**: `package/src/theme/generated/{light,dark}/StreamTokens.{ios,android,web}.ts`. Regenerate via `package/sync-theme.sh` when design tokens change — never hand-edit them.

The source is the React Native build of `GetStream/design-system-tokens` (`build/reactnative`). `sync-theme.sh` reads a sibling checkout at `../../design-system-tokens` from `package/`, or the path passed as its first argument.

**Legacy semantic names are adapters.** `theme.semantics` is public API, and the token repo has renamed or removed semantics the SDK shipped (`chat*` → `messageBubble*`, `presence*` → `avatarPresence*`, the `avatarPalette*` set, ...). The React Native build keeps every old name, mapped to its current token. The map and its rules live in the token repo, in `config/formatting/react-native/legacy-names.js` and the `AGENTS.md` next to it.

- They exist only to avoid a breaking change and are removed in the next major. Do not add deprecation markers.
- New SDK code reads the current names. Existing reads of old names stay until the next major, so integrator overrides of the old names keep applying.
- When the token repo renames or removes a semantic the SDK already ships, add the mapping there. Never alias tokens in this repo.

Custom themes are passed as the `style` prop to `<Chat>`. `mergeThemes()` deep-merges the custom style over the base theme (deep-cloned via `JSON.parse(JSON.stringify())`). Light/dark mode is auto-detected via `useColorScheme()`.

## i18n
Expand Down
2 changes: 1 addition & 1 deletion examples/E2ETestApp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"react-native-teleport": "^1.2.2",
"react-native-video": "^6.19.3",
"react-native-worklets": "^0.13.0",
"stream-chat": "^10.2.0",
"stream-chat": "^10.3.1",
"stream-chat-react-native": "workspace:^"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion examples/ExpoMessaging/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"react-native-teleport": "^1.2.5",
"react-native-web": "~0.21.4",
"react-native-worklets": "0.13.0",
"stream-chat": "^10.2.0",
"stream-chat": "^10.3.1",
"stream-chat-expo": "workspace:^",
"stream-chat-react-native-core": "workspace:^"
},
Expand Down
1 change: 1 addition & 0 deletions examples/SampleApp/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,7 @@ const App = () => {
<WithComponents overrides={componentOverrides}>
<OverlayProvider
accessibility={accessibilityConfig}
autoPlayVideo
value={{ style: streamChatTheme }}
i18nInstance={streami18n}
>
Expand Down
2 changes: 1 addition & 1 deletion examples/SampleApp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
"react-native-teleport": "^1.2.5",
"react-native-video": "^6.19.3",
"react-native-worklets": "^0.13.0",
"stream-chat": "^10.2.0",
"stream-chat": "^10.3.1",
"stream-chat-react-native": "workspace:^",
"stream-chat-react-native-core": "workspace:^"
},
Expand Down
27 changes: 16 additions & 11 deletions examples/SampleApp/src/hooks/useChannelMembersStatus.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
import { useMemo } from 'react';

import type { Channel } from 'stream-chat';
import { useTranslationContext } from 'stream-chat-react-native';
import {
useChannelMemberCount,
useChannelMembersState,
useChannelOnlineMemberCount,
useDisplayedChannelMemberCount,
useTranslationContext,
} from 'stream-chat-react-native';

import { useAppContext } from '../context/AppContext';
import { getUserActivityStatus } from '../utils/getUserActivityStatus';
Expand All @@ -16,29 +22,28 @@ export const useChannelMembersStatus = (channel: Channel) => {
const { t } = useTranslationContext();
const { chatClient } = useAppContext();

const watchersCount = channel.state.watcher_count;
const memberCount = channel?.data?.member_count ?? 0;
const members = useChannelMembersState(channel);
const memberCount = useChannelMemberCount(channel);
const displayedMemberCount = useDisplayedChannelMemberCount(channel);
const onlineCount = useChannelOnlineMemberCount(channel);

return useMemo(() => {
const isOneOnOneConversation = memberCount === 2 && channel.id?.indexOf('!members-') === 0;

if (isOneOnOneConversation) {
const other = Object.values({ ...channel.state.members }).find(
const other = Object.values(members).find(
(member) => member.user?.id !== chatClient?.user?.id,
);

return getUserActivityStatus(t, other?.user);
}

return t('channelDetails.presence.membersOnline.label', {
count: memberCount,
memberCount: memberCount > 9 ? '9+' : `${memberCount}`,
onlineCount: watchersCount > 9 ? '9+' : `${watchersCount}`,
count: displayedMemberCount,
memberCount: displayedMemberCount > 9 ? '9+' : `${displayedMemberCount}`,
onlineCount: onlineCount > 9 ? '9+' : `${onlineCount}`,
defaultValue_one: '{{memberCount}} member, {{onlineCount}} online',
defaultValue_other: '{{memberCount}} members, {{onlineCount}} online',
});
// `channel.state` is intentionally not a dependency — it is mutated in place, so it never
// changes identity. The counts below are what actually move.
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [channel.id, chatClient, memberCount, watchersCount, t]);
}, [channel.id, chatClient, displayedMemberCount, memberCount, members, onlineCount, t]);
};
2 changes: 1 addition & 1 deletion package/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
"react-native-url-polyfill": "^2.0.0",
"react-syntax-highlighter": "^16.1.0",
"simple-markdown": "^0.7.3",
"stream-chat": "^10.2.0",
"stream-chat": "^10.3.1",
"use-sync-external-store": "^1.7.0",
"zod": "^4.1.12"
},
Expand Down
19 changes: 18 additions & 1 deletion package/src/components/Attachment/Audio/AudioAttachment.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {

import { PlayPauseButton } from './PlayPauseButton';

import { useTheme } from '../../../contexts';
import { useChannelContext, useChatConfigContext, useTheme } from '../../../contexts';
import { useStableCallback } from '../../../hooks';
import { useStateStore } from '../../../hooks';
import { useAudioPlayer } from '../../../hooks/useAudioPlayer';
Expand All @@ -29,6 +29,7 @@ import {
import { AudioPlayerState } from '../../../state-store/audio-player';
import { primitives } from '../../../theme';
import { AudioConfig } from '../../../types/types';
import { defaultHandlePlaybackStarted, markPlayedMessage } from '../../../utils/markPlayedMessage';
import { ProgressControl } from '../../ProgressControl/ProgressControl';
import { StableDurationLabel } from '../../ProgressControl/StableDurationLabel';
import { WaveProgressBar } from '../../ProgressControl/WaveProgressBar';
Expand Down Expand Up @@ -103,10 +104,26 @@ export const AudioAttachment = (props: AudioAttachmentProps) => {
} = props;
const isVoiceRecording = isVoiceRecordingAttachment(item);
const waveformData = item.custom?.waveform_data;
const { channel } = useChannelContext();
const { handlePlaybackStarted = defaultHandlePlaybackStarted } = useChatConfigContext();

const onPlaybackStarted = useStableCallback(() => {
if (!message) {
return true;
}
return handlePlaybackStarted({
attachment: item,
markPlayed: () => markPlayedMessage(channel, message.id),
message,
player: audioPlayer,
});
});

const audioPlayer = useAudioPlayer({
duration: item.duration ?? item.custom?.duration ?? 0,
mimeType: item.custom?.mime_type ?? '',
// A preview belongs to no message, so playing it marks nothing.
onPlaybackStarted: isPreview ? undefined : onPlaybackStarted,
requester: isPreview
? 'preview'
: message?.id && `${message?.parent_id ?? message?.id}${message?.id}`,
Expand Down
Loading
Loading