Skip to content

fix: image gallery animation and wrong indexing - #3241

Merged
khushal87 merged 2 commits into
developfrom
fix/image-gallery-animations
Oct 8, 2025
Merged

khushal87 merged 2 commits into
developfrom
fix/image-gallery-animations

Conversation

@khushal87

Copy link
Copy Markdown
Contributor

The PR fixes the following issues:

  • Improper indexing of the attachment items in the image gallery on the footer.
  • Reversed/incorrect scrolling even though you open the first item of the gallery in the image gallery overlay. Please refer to the video to see.
  • Reduced motion setting disabled for couple of withTiming functions that will help in consistent pan down gesture even when the setting is enabled/disabled. This is the most sensible solution I could found that also avoid hacks of adding any inconsistent values.
  • Slight optimization by using the precomputed photoSelectedIndex in the useEffect rather than recalculating it.

New

Simulator.Screen.Recording.-.iPhone.17.Pro.-.2025-10-07.at.23.17.06.mov

Prev

Simulator.Screen.Recording.-.iPhone.17.Pro.-.2025-10-07.at.23.17.48.mov

@Stream-SDK-Bot

Copy link
Copy Markdown
Contributor

SDK Size

title develop branch diff status
js_bundle_size 289 KB 289 KB 0 B 🟢

@khushal87
khushal87 merged commit 8e74e6f into develop Oct 8, 2025
@khushal87
khushal87 deleted the fix/image-gallery-animations branch October 8, 2025 11:57
@github-actions github-actions Bot mentioned this pull request Oct 8, 2025
isekovanic added a commit that referenced this pull request Oct 21, 2026
## 🎯 Goal

Fix the code issues and wrong strings found while tidying the comments
in #3884, which deliberately left them alone (comment-only change).
**Stacked on #3884**: merge that first, then retarget this PR to `V10`.

## 🛠 Implementation details

Every item was verified against the code first; the behavior fixes each
come with a test that failed before the fix.

**Bugs fixed**
- **Markdown links** (`generateMarkdownText`): the conversion loop
restarted from the untrimmed text on every link, so only the last link
became a markdown link and the trim was lost. Links are now converted in
one pass, longest first, so `getstream.io` inside `getstream.io/chat` is
not wrapped twice.
- **Offline drafts** (`upsertDraft`): the result of
`queries.concat(...)` was discarded, so a draft's quoted and parent
messages were never stored, although `getDraft` reads the quoted message
back from `messages`.
- **AI markdown `onLink`**: a rejected `onLink` was logged and rethrown
inside a fire-and-forget `.catch`, causing an unhandled rejection. Now
only logged.
- **`parseJsonChart`**: invalid JSON threw a `SyntaxError` instead of
the documented "Unknown type" error.
- **`MessageActionList`**: destructive actions were given `length:
standardActions.length` (visible to custom `MessageActionListItem`
overrides).
- **Emoji middleware**: an emoji with no `native` and empty `skins`
threw a `TypeError`; such entries are now skipped (there is nothing to
insert).
- **`FileIcon`**: `.xlsb` used the `.xlam` MIME type and so showed the
generic icon; removed duplicate `.odt/.ott/.fodt`, `application/gzip`
and `video/webm` entries.
- Removed an unreachable `null` branch in `getReactionsForFilterSort`
and a dead `?? 0` in `hashStringToNumber`.

**Strings**
- **Permission alerts**: the shared `common.cameraPermission.text` /
`common.galleryPermission.text` copy was ungrammatical ("Device gallery
permissions is used to take photos or videos") and is fixed. The
image-only channel image flow gets its own keys,
`channelDetails.editImageSheet.cameraPermission.text` /
`.galleryPermission.text`, instead of saying "photos or videos".
- **`useMessagesContext` error**: named `MessageList` (the context comes
from `<Channel>` / `<Thread>`) and linked a docs page that now returns
404. It now names `Channel` and links the live Channel page (the other
context errors are fixed in #3884).
- Clearer warning when the attachment picker cannot open (it reports the
missing `snapToIndex`), an accurate label for the gallery's video
placeholder, and fixed docs for `previewVoiceRecording`, the
`useIsMountedRef` example and an `eslint-disable` description.
- `keys.ts` regenerated; the SampleApp German and Italian dictionaries
updated for the new and changed keys.

**⚠️ Breaking: removed props that were never read** (v10 is a breaking
release; listed in `ai-docs/v10-breaking-changes.md`)
- `ProgressControl`: `width` (the control measures its own width).
- `MessageActionList`: `dismissOverlay` (each item closes the overlay
itself). A custom list that needs it can read
`useMessageContext().dismissOverlay`.
- `MessageFlashList`: `inverted` (the FlashList is never inverted).

**Checked and left unchanged**
- **Live locations in `upsertChannels`**: the `forEach(async)` really
does drop the queries (they are never written today). A naive fix would
make it worse: `locations.messageId` has a foreign key to `messages`, so
a live location whose message is outside the stored window fails the
whole channel batch. This needs a decision (drop the foreign key with a
`dbVersion` bump, or write only locations whose message is stored).
- **Gallery gestures**: the pan `finalXPosition` sign (velocity-gated
paging, chosen in #3241) and the double-tap zoom-in `translateX` stay as
they are.
- Not bugs: `useRAFCoalescedValue` (a test now guards the re-enable
case), the duration units (the gallery and media items both pass
milliseconds), the pinch `scale < 1` branches (reachable on iOS) and the
read of `translateY.value` right after starting an animation (Reanimated
still returns the release position at that point).
- `asyncMessagesMinimumPressDuration` is read by `AudioRecordingButton`,
so it stays.

## 🎨 UI Changes

Only the permission alert copy.

## 🧪 Testing

- New or extended tests for every behavior fix: `upsertDraft` (real
SQLite), `generateMarkdownText`, `Markdown` (`onLink` rejection),
`charts`, `FileIcon`, `emojiControl`, `getTrimmedAttachmentTitle`,
`useRAFCoalescedValue`, `ImageGallery`, `ImageGalleryVideoControl`,
`MessageActionList`, `useEditChannelImage`, `filePickers`,
`useAttachmentPickerBottomSheet` and the context error messages.
- `yarn lint`, `yarn typecheck` (all workspaces), `yarn test:unit` and
`yarn build` pass.

## ☑️ Checklist

- [ ] I have signed the [Stream
CLA](https://docs.google.com/forms/d/e/1FAIpQLScFKsKkAJI7mhCr7K9rEIOpqIDThrWxuvxnwUq2XkHyG154vQ/viewform)
(required)
- [ ] PR targets the `develop` branch (stacked on #3884, then `V10`)
- [x] Documentation is updated
- [ ] New code is tested in main example apps, including all possible
scenarios
  - [ ] SampleApp iOS and Android
  - [ ] Expo iOS and Android

---------

Co-authored-by: Ivan Sekovanikj <ivan.sekovanikj@getstream.io>
@github-actions github-actions Bot mentioned this pull request Nov 6, 2026
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants