-
Notifications
You must be signed in to change notification settings - Fork 10
306 rework attachments in interaction for better dev #308
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
Merged
PandaGuerrier
merged 9 commits into
main
from
306-rework-attachments-in-interaction-for-better-dev
Nov 10, 2025
Merged
306 rework attachments in interaction for better dev #308
PandaGuerrier
merged 9 commits into
main
from
306-rework-attachments-in-interaction-for-better-dev
Nov 10, 2025
Conversation
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
DCodeProg
reviewed
Nov 7, 2025
DCodeProg
reviewed
Nov 7, 2025
DCodeProg
reviewed
Nov 7, 2025
LeadcodeDev
approved these changes
Nov 8, 2025
DCodeProg
approved these changes
Nov 8, 2025
Contributor
|
Nice 👍 |
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.
This pull request refactors and simplifies the handling of media assets and file attachments throughout the codebase. The main focus is on introducing a new
Assetclass to unify the representation of media files, replacing older classes and patterns, and updating related components and utilities to use this new abstraction.Key changes include:
Media Asset Abstraction and Refactoring:
Assetclass inasset.dartto represent media assets, supporting construction from files and providing a consistenttoJsoninterface. ([lib/src/api/common/components/asset.dartR1-R53](https://github.com/mineral-dart/core/pull/308/files#diff-3fbbfd1a71c21b0da772f58f73fc1b0182a879136d2daa58247dad63b495895cR1-R53))MessageGalleryandMessageThumbnailto use the newAssetclass instead of customGalleryItemandMessageMediaclasses, and removed those now-obsolete classes. ([[1]](https://github.com/mineral-dart/core/pull/308/files#diff-0fdf1ae2b9b8e602b0b3f0891e59f4816b3d55d643beb10bf3fddd73f6929b97L1-R8),[[2]](https://github.com/mineral-dart/core/pull/308/files#diff-0fdf1ae2b9b8e602b0b3f0891e59f4816b3d55d643beb10bf3fddd73f6929b97L19-L81),[[3]](https://github.com/mineral-dart/core/pull/308/files#diff-b525cb54063745dbe2f6788352f43c9739fd84c1d8ac0b2373691ca4da3f42ddL1-L15),[[4]](https://github.com/mineral-dart/core/pull/308/files#diff-8f28f0b16ea988f78630dfe810fd3531d01a5566c3452dd52f22b4ae9fb9586fR5-R13))File Attachment Handling:
AttachmenttoMessageFile, simplifying its API and removing caching logic. Updated thefilemethod inMessageBuilderto useMessageFile. ([[1]](https://github.com/mineral-dart/core/pull/308/files#diff-51664875c1f9dfced04f6ef0abd776771dedd208d062aaeaafa2198925f52cdcL7-R27),[[2]](https://github.com/mineral-dart/core/pull/308/files#diff-c826a76b7e732d8d76753211299eb15d5083b70a77bc3f8b2e1395d9ef2b7977L79-R79))api.dartto reflect the new and removed classes, ensuring the public API is consistent with these changes. ([lib/api.dartR30-L37](https://github.com/mineral-dart/core/pull/308/files#diff-af9ff7cdb71adcd379123b2b2de8b383941c39b54a0cb1a07dc784ccb0aae6c1R30-L37))Attachment Utilities Update:
attachment.dartto handle the newAssetstructure, updating how multipart files are prepared and attached for both files and gallery/media assets. ([[1]](https://github.com/mineral-dart/core/pull/308/files#diff-1737ee8ca6e3b58944c539226c2955ec393db6d878b4388d752a58542d4ffea2L4-R4),[[2]](https://github.com/mineral-dart/core/pull/308/files#diff-1737ee8ca6e3b58944c539226c2955ec393db6d878b4388d752a58542d4ffea2L17-R73))Overall, these changes modernize and streamline the way media and files are handled in messages, making the codebase easier to maintain and extend.