Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PinnedMessageList Compose #5420

Merged
merged 15 commits into from
Oct 7, 2024

Conversation

VelikovPetar
Copy link
Contributor

@VelikovPetar VelikovPetar commented Oct 1, 2024

🎯 Goal

The goal of the PR is to introduce a compose implementation of the PinnedMessageList component (which already exists in the XML SDK)

🛠 Implementation details

  1. Extracted the business logic from the already existing PinnedMessageListViewModel into a PinnedMessageListController.
  2. Use the PinnedMessageListController in the already existing PinnedMessageListViewModel(xml) and in the new PinnedMessageListViewModel(compose).
  3. Implement new PinnedMessageList composable component which accepts the PinnedMessageListViewModel.
  4. Create new MessagePreviewItem which serves as a base for the PinnedMessageItem composable -> similar to how this is done in the XML (MessagePreviewView used for: SearchResults, PinnedMessages and Mentions). In the future, we can use the same item to also handle the Mentions when we implement them in compose.
  5. Extend the MessagePreviewFormatter interface with a new method: formatMessageTitle - this formatter can now be used to format both the title and the body of the MessagePreviewItem

Additional: Implement basic ChannelInfoActivity, GroupChannelInfoActivity and PinnedMessagesActivity in the compose sample so that the 'pinned messages' composable can be easily tested. (used the XML sample as a UI reference)

🎨 UI Changes

PinnedMessageList

XML Compose
showcase-empty-xml-4.mp4
showcase-empty-compose.mp4
showcase-error-xml.mp4
showcase-error-compose.mp4
showcase-pagination-xml.mp4
showcase-pagination-compose.mp4

Compose sample app

ChannelInfoActivity GroupChannelInfoActivity
showcase-channel-details showcase-group-channel-details

🧪 Testing

  1. Open the compose sample app
  2. Open a conversation with pinned messages
  3. Click on the header title to open the channel info
  4. Click on the "Pinned messages" item

☑️Contributor Checklist

General

  • I have signed the Stream CLA (required)
  • Assigned a person / code owner group (required)
  • Thread with the PR link started in a respective Slack channel (#android-chat-core or #android-chat-ui) (required)
  • PR targets the develop branch
  • PR is linked to the GitHub issue it resolves

Code & documentation

  • Changelog is updated with client-facing changes
  • New code is covered by unit tests
  • Comparison screenshots added for visual changes
  • Affected documentation updated (KDocs, docusaurus, tutorial)

☑️Reviewer Checklist

  • UI Components sample runs & works
  • Compose sample runs & works
  • UI Changes correct (before & after images)
  • Bugs validated (bugfixes)
  • New feature tested and works
  • Release notes and docs clearly describe changes
  • All code we touched has new or updated KDocs

🎉 GIF

Please provide a suitable gif that describes your work on this pull request

@VelikovPetar VelikovPetar requested a review from a team October 1, 2024 09:31
@aleksandar-apostolov aleksandar-apostolov merged commit 11e0f62 into develop Oct 7, 2024
7 checks passed
@aleksandar-apostolov aleksandar-apostolov deleted the feature/compose-pinned-messages branch October 7, 2024 09:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants