compose: Align Channel List feedback states with Figma (loading error, action failure, deletion)#6492
compose: Align Channel List feedback states with Figma (loading error, action failure, deletion)#6492andremion wants to merge 4 commits into
Conversation
Surface a "Tap to retry" banner pinned below the Channel List header when loading channels fails, aligning with the Figma "Loading Error" state. Previously a pagination failure produced no visible feedback. - Add ChannelsState.loadingError, set on load-more failure and cleared on a successful load - Add ChannelListBanner composable with a ChatComponentFactory slot and params holder for customisation - Render the banner above the list and wire onLoadingErrorClick to retry the failed load - Add the stream_compose_channel_list_banner_error string
The content-state preview listed two items backed by the same channelWithOnlineUser, producing identical LazyColumn keys (ItemState.ChannelItemState.key = channel.cid) and crashing the preview. Use channelWithOneUser for the draft-message item so each item has a unique key.
Surface transient feedback on the Channel List when a user-triggered action completes, aligning with the Figma "User-triggered Action Fail" and "Channel Deleted" states. Previously channel actions failed silently. - Add an internal ChannelListViewModel.events flow emitting ChannelListEvent (ActionError per failed action, ChannelDeleted on a successful delete) - Route the 12 channel/user action handlers through the events flow - Host a StreamSnackbarHost on ChannelsScreen and map events to snackbars (error pill for failures, confirmation pill for "Chat deleted") - Add per-action error strings and "Chat deleted", with translations for all supported locales
PR checklist ✅All required conditions are satisfied:
🎉 Great job! This PR is ready for review. |
|
@CodeRabbit review |
✅ Action performedReview finished.
|
SDK Size Comparison 📏
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (19)
WalkthroughThis PR adds end-to-end error recovery for channel list loading failures. It introduces a ChangesChannel List Error Recovery
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Suggested labels
Suggested reviewers
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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 |
|


Goal
The Channel List in the Compose SDK had no feedback for failed or completed actions. This aligns it with the three Locked Figma states on Chat SDK Design System → Android → Channel List (AND-1215):
Implementation
ChannelsState.loadingError, set on a load-more failure and cleared on the next successful load. The statelessChannelListrenders a newChannelListBanner("Couldn't load new chats. Tap to retry") pinned below the header; tapping it retries vialoadMore(). Exposed through aChatComponentFactory.ChannelListBannerslot + params for customization. Mirrors the Thread List "Tap to retry" pattern.ChannelListViewModelnow exposes an internalevents: SharedFlow<ChannelListEvent>. The 12 channel/user action handlers emitActionError(action)on failure; delete emitsChannelDeletedon success.ChannelsScreenhosts aStreamSnackbarHostand maps events to snackbars — an error pill ("Error muting channel.", etc.) and a "Chat deleted." confirmation — reusing the existingStreamSnackbar.loadingErrorfield/handler (the events API is internal).🎨 UI Changes
Before: a pagination failure and failed/succeeded actions produced no visible feedback.
Testing
Unit tests cover the new behavior (
ChannelListViewModelTest:loadingErrorset on failure / cleared on successful retry / kept on failed retry; action failure emitsActionError; delete emitsChannelDeleted). A Paparazzi snapshot coversChannelListBanner; the snackbar variants are covered byStreamSnackbarTest.Manual steps (compose sample):
Provide a patch below if it is necessary for testing
Force the loading-error banner and an action-failure snackbar on open
Summary by CodeRabbit
Release Notes
New Features
Tests