Skip to content

Fix attachments picker findings#6232

Draft
andremion wants to merge 9 commits intov7from
redesign/camera-picker-issue
Draft

Fix attachments picker findings#6232
andremion wants to merge 9 commits intov7from
redesign/camera-picker-issue

Conversation

@andremion
Copy link
Contributor

Goal

Describe why we are making this change

Implementation

Describe the implementation

🎨 UI Changes

Add relevant screenshots

Before After
img img

Add relevant videos

Before After

Testing

Explain how this change can be tested (or why it can't be tested)

Provide a patch below if it is necessary for testing

Provide the patch summary here
Provide the patch code here

…e across process death and synchronize external attachments.

- Implement `SavedStateHandle` persistence for selected URIs, grid attachments, and external attachments (camera/system picker).
- Add `addExternalAttachments` and `removeExternalAttachment` to manage one-shot attachment sources.
- Update `getSelectedAttachments` to serve as the single source of truth for the message composer.
- Ensure `clearSelection` resets all persisted picker state.
- Change default `GalleryPickerMode` and `FilePickerMode` to single selection.
…ckerViewModel` and `MessageComposerViewModel`.

- Shift responsibility for the master list of staged attachments from `AttachmentsPickerViewModel` to `MessageComposerViewModel`, making the latter the single source of truth for message attachments.
- Implement state persistence for selected attachments in `MessageComposerViewModel` using `SavedStateHandle` to survive Activity recreation.
- Update `AttachmentsPickerViewModel` to only manage grid selection state (URI-based checkmarks) and storage browsing.
- Refactor `AttachmentPickerActions` to coordinate selection between the picker (grid UI) and the composer (staged list).
- Rename attachment manipulation methods in `MessageComposerViewModel` to `addAttachments`, `removeAttachment`, and `clearAttachments`.
- Update `MessagesViewModelFactory` to provide `SavedStateHandle` to the composer and picker ViewModels.
@andremion andremion added the pr:improvement Improvement label Mar 9, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Mar 9, 2026

PR checklist ❌

The following issues were detected:

  • Title should be 5–18 words for release notes. Current: 4 word(s). (Add pr:ignore-for-release to bypass.)

What we check

  1. Title is concise (5–18 words) unless labeled pr:ignore-for-release.
  2. At least one pr: label exists (e.g., pr:bug, pr:new-feature).
  3. Sections ### Goal, ### Implementation, and ### Testing contain content.

@andremion andremion changed the title Attachments picker issue Fix attachments picker findings Mar 9, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Mar 9, 2026

SDK Size Comparison 📏

SDK Before After Difference Status
stream-chat-android-client 5.25 MB 5.69 MB 0.44 MB 🟡
stream-chat-android-ui-components 10.60 MB 11.00 MB 0.40 MB 🟡
stream-chat-android-compose 12.81 MB 12.03 MB -0.78 MB 🚀

@sonarqubecloud
Copy link

sonarqubecloud bot commented Mar 9, 2026

Quality Gate Failed Quality Gate failed

Failed conditions
56.3% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr:improvement Improvement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant