Conversation
PR checklist ✅All required conditions are satisfied:
🎉 Great job! This PR is ready for review. |
4c28c89 to
2ae8304
Compare
SDK Size Comparison 📏
|
2ae8304 to
a3d20f6
Compare
WalkthroughThe 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
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Tip Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs). 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. Comment |
There was a problem hiding this comment.
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 | 🟠 MajorAdd checkable semantics to the row and use
allowMultipleSelectionto define the accessibility role.
RadioCheckis 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, theallowMultipleSelectionparameter 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
⛔ 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.pngis excluded by!**/*.pngstream-chat-android-compose/src/test/snapshots/images/io.getstream.chat.android.compose.ui.components.attachments.files_FilesPickerTest_single_selection.pngis excluded by!**/*.pngstream-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.pngis excluded by!**/*.pngstream-chat-android-compose/src/test/snapshots/images/io.getstream.chat.android.compose.ui.components.messages_ToggleableTranslatedLabelTest_show_translation_label_when_showOriginalText_is_true.pngis excluded by!**/*.pngstream-chat-android-compose/src/test/snapshots/images/io.getstream.chat.android.compose.ui.components_TranslatedLabelTest_translated_label_for_English.pngis excluded by!**/*.pngstream-chat-android-compose/src/test/snapshots/images/io.getstream.chat.android.compose.ui.messages.attachments_AttachmentFilePickerTest_multiple_selection.pngis excluded by!**/*.pngstream-chat-android-compose/src/test/snapshots/images/io.getstream.chat.android.compose.ui.messages.attachments_AttachmentFilePickerTest_single_selection.pngis 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
...c/main/java/io/getstream/chat/android/compose/ui/components/attachments/files/FilesPicker.kt
Show resolved
Hide resolved
|



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
RadioCheckcomponent,StreamTokensspacing, and updated text styles.🎨 UI Changes
Please check the updated snapshot files
Testing
Summary by CodeRabbit