Skip to content

Conversation

gpunto
Copy link
Contributor

@gpunto gpunto commented Sep 5, 2025

Goal

At the moment, when posting a comment in the demo app we just close the "create content" bottom sheet and post it. However, the operation can take long, especially when uploading attachments without any feedback until done. So we should show a loading indicator instead.

Implementation

Move the visibility state of the "create content" sheet to the VM and, while posting, we now disable input and show a loading indicator.

Testing

Try posting something in the demo app and verify that the loading indicator is shown instead of the submit button.

Screenshot_20250905_093210

Checklist

  • Issue linked (if any)
  • Tests/docs updated
  • I have signed the Stream CLA (required for external contributors)

@gpunto gpunto requested a review from Copilot September 5, 2025 07:33
@gpunto gpunto added the pr:demo-app Changes specific to demo app label Sep 5, 2025
Copy link
Contributor

github-actions bot commented Sep 5, 2025

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.

Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR implements a progress indicator for content posting operations in the demo app. Instead of immediately closing the create content bottom sheet when posting, the UI now shows a loading state with disabled input fields and a progress indicator while the posting operation is in progress.

Key changes:

  • Moved create content bottom sheet visibility management to ViewModels with state flow tracking
  • Added loading states that disable input fields and show progress indicators during posting
  • Updated both feed posts and comments to use the new state-based approach

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
FeedsScreen.kt Replaced local state management with ViewModel-based create content state
FeedViewModel.kt Added CreateContentState management and posting state transitions
CreatePollButton.kt Updated to accept enabled parameter for input control
CreateContentBottomSheet.kt Added CreateContentState enum and loading UI with input disabling
CommentsSheetViewModel.kt Implemented create content state management for comments
CommentsBottomSheet.kt Removed local comment creation state in favor of ViewModel state
Comments suppressed due to low confidence (1)

stream-feeds-android-sample/src/main/java/io/getstream/feeds/android/sample/feed/FeedViewModel.kt:1

  • The onCreatePoll method doesn't implement the same loading state management as onCreatePost. It should set _createContentState to Posting at the start and update it based on the result to provide consistent UX feedback.
/*

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copy link
Contributor

github-actions bot commented Sep 5, 2025

SDK Size Comparison 📏

SDK Before After Difference Status
stream-feeds-android-client 2.41 MB 2.41 MB 0.00 MB 🟢

@gpunto gpunto marked this pull request as ready for review September 8, 2025 15:23
@VelikovPetar VelikovPetar merged commit 6e41f61 into develop Sep 9, 2025
7 checks passed
@VelikovPetar VelikovPetar deleted the sample/upload-progress branch September 9, 2025 07:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr:demo-app Changes specific to demo app
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants