fix(media): handle app card cover fallback#6440
Open
SeniorZhai wants to merge 3 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR improves media viewing behavior for App Card messages by correctly resolving cover URLs when the cover is provided via the nested cover.url field (instead of only cover_url), and by preventing the media pager from proceeding when the target “media message” can’t be found/doesn’t qualify.
Changes:
- Add
AppCardData.hasCoverand use it to detect whether an App Card should be treated as having media cover. - Update
MessageItem.appCardCoverUrl()to fall back tocover.urlwhencover_urlis blank/empty. - Harden media pager indexing/loading to handle “not found” cases and filter out App Cards without a usable cover.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| app/src/test/java/one/mixin/android/vo/AppCardDataTest.kt | Adds a unit test to ensure nested cover.url is treated as a valid cover source. |
| app/src/main/java/one/mixin/android/vo/MessageItem.kt | Adds isAppCardWithCover() helper for cover-aware App Card filtering. |
| app/src/main/java/one/mixin/android/vo/AppCardData.kt | Introduces hasCover and updates appCardCoverUrl() to ignore blank strings and fall back properly. |
| app/src/main/java/one/mixin/android/ui/media/pager/MediaPagerActivity.kt | Stops media paging flow early when the indexed target can’t be located. |
| app/src/main/java/one/mixin/android/repository/ConversationRepository.kt | Validates media message eligibility (exclude-live constraints + App Card cover presence) before indexing/returning media messages. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
f76e978 to
aa3f6f0
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.