Skip to content

Update UI of the files picker#6211

Merged
andremion merged 1 commit intov7from
redesign/attachment-files-tab
Mar 5, 2026
Merged

Update UI of the files picker#6211
andremion merged 1 commit intov7from
redesign/attachment-files-tab

Conversation

@andremion
Copy link
Contributor

@andremion andremion commented Mar 5, 2026

Goal

Update the visual design of the file attachment picker items to match the new v7 design system.

Implementation

Refactor file picker items to use the RadioCheck component, StreamTokens spacing, and updated text styles.

🎨 UI Changes

Please check the updated snapshot files

Testing

  1. Open the message composer.
  2. Tap the attachment picker and navigate to the Files tab.
  3. Verify file items show: file icon on the left, name + size in the center, selection indicator on the right.

Summary by CodeRabbit

  • Style
    • Updated the file picker's visual design with a simplified selection indicator for better consistency.
    • Refined spacing and typography in file listings to improve readability and visual hierarchy.
    • Adjusted file item layout and updated color styling for a cohesive appearance.

@andremion andremion added the pr:new-feature New feature label Mar 5, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Mar 5, 2026

PR checklist ✅

All required conditions are satisfied:

  • Title length is OK (or ignored by label).
  • At least one pr: label exists.
  • Sections ### Goal, ### Implementation, and ### Testing are filled.

🎉 Great job! This PR is ready for review.

@andremion andremion force-pushed the redesign/attachment-files-tab branch from 4c28c89 to 2ae8304 Compare March 5, 2026 14:45
@github-actions
Copy link
Contributor

github-actions bot commented Mar 5, 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 10.97 MB 0.38 MB 🟡
stream-chat-android-compose 12.81 MB 11.97 MB -0.84 MB 🚀

@andremion andremion force-pushed the redesign/attachment-files-tab branch from 2ae8304 to a3d20f6 Compare March 5, 2026 14:57
@andremion andremion marked this pull request as ready for review March 5, 2026 14:57
@andremion andremion requested a review from a team as a code owner March 5, 2026 14:57
Copy link
Contributor

@gpunto gpunto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looking good!

@andremion andremion enabled auto-merge (squash) March 5, 2026 15:04
@andremion andremion added pr:improvement Improvement and removed pr:new-feature New feature labels Mar 5, 2026
@coderabbitai
Copy link

coderabbitai bot commented Mar 5, 2026

Walkthrough

The FilesPicker component's selection UI was refactored to use a unified RadioCheck component instead of individual Checkbox/RadioButton implementations. Typography, spacing, and layout were updated to align with StreamTokens design standards, and preview data was restructured with private constants.

Changes

Cohort / File(s) Summary
FilesPicker Component UI Refactor
stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/components/attachments/files/FilesPicker.kt
Replaced per-item selection indicators with RadioCheck component; updated spacing values to StreamTokens.spacingMd/spacingSm; changed typography from bodyEmphasis to bodyDefault and metadataDefault to captionDefault; converted fixed padding to weight(1f) for metadata layout; added private metadata constants and refactored preview implementations.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐰 Selection widgets, now aligned with grace,
RadioCheck brings consistency to this place,
Typography tokens guide spacing just right,
One file refined with refined design might,
Hopping forward through UI delight!

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Update UI of the files picker' directly and specifically describes the main change in the changeset, which refactors the files picker UI component.
Description check ✅ Passed The description covers Goal, Implementation, and Testing sections from the template, but is missing UI Changes details (screenshots/videos), the contributor checklist, reviewer checklist, and GIF sections.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch redesign/attachment-files-tab

Tip

Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs).
Share your feedback on Discord.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/components/attachments/files/FilesPicker.kt (1)

124-127: ⚠️ Potential issue | 🟠 Major

Add checkable semantics to the row and use allowMultipleSelection to define the accessibility role.

RadioCheck is decorative here (onCheckedChange = null), and the item's Row uses a generic .clickable() handler that provides no semantic information about the control type. This prevents accessibility services from announcing whether this is a checkbox or radio button selection. Additionally, the allowMultipleSelection parameter is documented in the KDoc as controlling the displayed control type but is never used in the function body.

Suggested fix
+import androidx.compose.foundation.selection.selectable
+import androidx compose.ui.semantics.Role
@@
     Row(
         Modifier
             .fillMaxWidth()
-            .clickable { onItemSelected(fileItem) }
+            .selectable(
+                selected = fileItem.isSelected,
+                role = if (allowMultipleSelection) Role.Checkbox else Role.RadioButton,
+                onClick = { onItemSelected(fileItem) },
+            )
             .padding(StreamTokens.spacingSm),
         verticalAlignment = Alignment.CenterVertically,
         horizontalArrangement = Arrangement.spacedBy(StreamTokens.spacingSm),
     ) {
@@
         RadioCheck(
             checked = fileItem.isSelected,
             onCheckedChange = null,
         )
     }

Also applies to: 129-133, 159-162

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/components/attachments/files/FilesPicker.kt`
around lines 124 - 127, The Row in DefaultFilesPickerItem currently uses a
generic .clickable and leaves RadioCheck decorative, so accessibility services
can't announce checkbox vs radio; update DefaultFilesPickerItem to add checkable
semantics on the row using Modifier.semantics: set checked =
fileItem.isSelected, set onClick to call onItemSelected(fileItem), and set role
= Role.Checkbox when allowMultipleSelection is true or Role.RadioButton when
false (keep RadioCheck with onCheckedChange = null so it's purely visual).
Ensure the semantics modifier is applied before clickable so TalkBack exposes
the control type and state.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In
`@stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/components/attachments/files/FilesPicker.kt`:
- Around line 219-233: The two private preview fixtures AttachmentMetaData1 and
AttachmentMetaData2 use undocumented `@Suppress`("MagicNumber") and non-camelCase
names; replace them with well-named camelCase preview constants (e.g.,
attachmentMetaData1, attachmentMetaData2) and extract the numeric sizes into
named constants (e.g., PREVIEW_PDF_SIZE, PREVIEW_DOC_SIZE) so the magic numbers
are explicit; remove the `@Suppress` annotations and update any references
(previous AttachmentMetaData1/AttachmentMetaData2) to the new camelCase
constants in FilesPicker (functions/preview usages).

---

Outside diff comments:
In
`@stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/components/attachments/files/FilesPicker.kt`:
- Around line 124-127: The Row in DefaultFilesPickerItem currently uses a
generic .clickable and leaves RadioCheck decorative, so accessibility services
can't announce checkbox vs radio; update DefaultFilesPickerItem to add checkable
semantics on the row using Modifier.semantics: set checked =
fileItem.isSelected, set onClick to call onItemSelected(fileItem), and set role
= Role.Checkbox when allowMultipleSelection is true or Role.RadioButton when
false (keep RadioCheck with onCheckedChange = null so it's purely visual).
Ensure the semantics modifier is applied before clickable so TalkBack exposes
the control type and state.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: c3054371-ba88-4e7f-a12e-6dd76d6933c5

📥 Commits

Reviewing files that changed from the base of the PR and between dfc1cae and a3d20f6.

⛔ Files ignored due to path filters (7)
  • stream-chat-android-compose/src/test/snapshots/images/io.getstream.chat.android.compose.ui.components.attachments.files_FilesPickerTest_multiple_selection.png is excluded by !**/*.png
  • stream-chat-android-compose/src/test/snapshots/images/io.getstream.chat.android.compose.ui.components.attachments.files_FilesPickerTest_single_selection.png is excluded by !**/*.png
  • stream-chat-android-compose/src/test/snapshots/images/io.getstream.chat.android.compose.ui.components.messages_ToggleableTranslatedLabelTest_show_original_label_and_translated_label_when_showOriginalText_is_false.png is excluded by !**/*.png
  • stream-chat-android-compose/src/test/snapshots/images/io.getstream.chat.android.compose.ui.components.messages_ToggleableTranslatedLabelTest_show_translation_label_when_showOriginalText_is_true.png is excluded by !**/*.png
  • stream-chat-android-compose/src/test/snapshots/images/io.getstream.chat.android.compose.ui.components_TranslatedLabelTest_translated_label_for_English.png is excluded by !**/*.png
  • stream-chat-android-compose/src/test/snapshots/images/io.getstream.chat.android.compose.ui.messages.attachments_AttachmentFilePickerTest_multiple_selection.png is excluded by !**/*.png
  • stream-chat-android-compose/src/test/snapshots/images/io.getstream.chat.android.compose.ui.messages.attachments_AttachmentFilePickerTest_single_selection.png is excluded by !**/*.png
📒 Files selected for processing (1)
  • stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/components/attachments/files/FilesPicker.kt

@sonarqubecloud
Copy link

sonarqubecloud bot commented Mar 5, 2026

@andremion andremion merged commit 8058dff into v7 Mar 5, 2026
18 of 19 checks passed
@andremion andremion deleted the redesign/attachment-files-tab branch March 5, 2026 15:36
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.

2 participants