-
Notifications
You must be signed in to change notification settings - Fork 302
Deprecate AttachmentType.LINK
and fix link styling not applied in MessageReplyView
.
#5848
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
Conversation
SDK Size Comparison 📏
|
...n/kotlin/io/getstream/chat/android/ui/feature/messages/list/adapter/view/MessageReplyView.kt
Show resolved
Hide resolved
|
There was a problem hiding this 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 deprecates AttachmentType.LINK and its related utility, and fixes a bug where link styling in MessageReplyView was not applied. Key changes include:
- Deprecating AttachmentType.LINK and Attachment.isLink() in core, client, and documentation.
- Fixing link detection in MessageReplyView by updating the check logic.
- Introducing a createIntent method in AttachmentActivity to avoid hard-coded extras.
Reviewed Changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
stream-chat-android-ui-components/src/main/kotlin/io/getstream/chat/android/ui/navigation/destinations/AttachmentDestination.kt | Replaced hard-coded intent creation with AttachmentActivity.createIntent. |
stream-chat-android-ui-components/src/main/kotlin/io/getstream/chat/android/ui/feature/messages/list/adapter/viewholder/attachment/UnsupportedAttachmentFactory.kt | Removed deprecated AttachmentType.LINK from the supported attachment types. |
stream-chat-android-ui-components/src/main/kotlin/io/getstream/chat/android/ui/feature/messages/list/adapter/view/MessageReplyView.kt | Updated link detection logic to correctly identify link attachments and apply styling. |
stream-chat-android-ui-components/src/main/kotlin/io/getstream/chat/android/ui/feature/gallery/AttachmentActivity.kt | Added a companion object with createIntent, replacing the use of hard-coded string keys. |
stream-chat-android-components/api/stream-chat-android-ui-components.api | Updated API definitions to include the new createIntent method. |
stream-chat-android-core/src/main/java/io/getstream/chat/android/models/AttachmentType.kt | Marked AttachmentType.LINK as deprecated with updated documentation. |
stream-chat-android-client/src/main/java/io/getstream/chat/android/client/utils/attachment/AttachmentUtils.kt | Deprecated isLink(), with a note about its returning false. |
DEPRECATIONS.md | Documented the deprecation of AttachmentType.LINK and Attachment.isLink(). |
CHANGELOG.md | Updated changelog with deprecation and link styling fix information. |
...n/kotlin/io/getstream/chat/android/ui/feature/messages/list/adapter/view/MessageReplyView.kt
Outdated
Show resolved
Hide resolved
...n/kotlin/io/getstream/chat/android/ui/feature/messages/list/adapter/view/MessageReplyView.kt
Outdated
Show resolved
Hide resolved
|
🎯 Goal
Resolves: https://linear.app/stream/issue/AND-605/remove-deprecate-attachmenttypelink-from-android-sdk
The attachment type
link
is not an officially supported (see: https://getstream.io/chat/docs/android/message_format/#attachment-format and https://getstream.io/chat/docs/android/message_format/#open-graph-scraper). Exposing theAttachmentType.LINK
as a public type can be confusing for customers, because it gives a false impression that links are a separate type of attachment. Because we cannot delete this directly, it is just deprecated for the moment, and to be removed in an upcoming release.Additionally, this PR fixes a bug where the link styling (
MessageReplyStyle.linkBackgroundColorMine
/MessageReplyStyle.linkBackgroundColorTheirs
/MessageReplyStyle.linkStyleMine
/MessageReplyStyle.linkStyleTheirs
) is not applied (because the current checks for isLink() were always returning false).🛠 Implementation details
AttachmentType.LINK
(Note: currently there is only one usage remaining ofAttachmentType.LINK
in theAttachmentDestination
- but its internal and not directly linked to theAttachment
class)Attachment.isLink()
isLink()
check inMessageReplyView
to correctly check if the message has a link (currently it always returnsfalse
)createIntent
method for theAttachmentActivity
to avoid using hard-coded argument keys.🎨 UI Changes
🧪 Testing