-
Notifications
You must be signed in to change notification settings - Fork 117
V5: message list attachments redesign #1264
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
Merged
Changes from all commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
42c025c
Add new ChatMediaAttachmentContainerView to manage media layout handling
laevandus d872297
Merge branch 'v5' into v5-media-attachment-refresh
laevandus 68b164c
Add shared loading spinner
laevandus 88810ec
Implement stacked attachments for different types
laevandus 580e573
Update snapshots
laevandus 3db03d8
Cleanup unused types
laevandus b78ed39
Fix snapshots
laevandus bcfc15a
Update image loading in snapshots
laevandus e53cb1a
Use mocked video loader
laevandus b7c1d35
Update file and voice views
laevandus 90f756f
Add VideoPlayIndicatorView
laevandus a1f4338
Merge branch 'v5' into v5-media-attachment-refresh
laevandus 5c5cbc8
Move loading spinner to each of the thumbnail view
laevandus cd98c27
Fix attachment alignment
laevandus 4712642
Fix e2e tests
laevandus 39ebde7
Unify accessibility identifiers for message view
laevandus 67f80eb
Clean text view factories
laevandus e7460b7
Merge branch 'v5' into v5-media-attachment-refresh
laevandus f4ab851
Tidy orientation
laevandus c58fa00
Tidy text view
laevandus ba86cb7
Merge branch 'v5' into v5-media-attachment-refresh
laevandus ad2c95e
Adjust voice recording for the stacked attachment list
laevandus 0e21e24
Revert makeLoadingView changes
laevandus f3584b8
Tidy bubble styling logic
laevandus 2e76d1f
Update snapshots
laevandus 5a1c10e
Fix foreach
laevandus 0237de7
Fix e2e tests
laevandus c7845e2
Fix image gallery layout for landscape
laevandus be8510e
Revert view factory naming
laevandus c1f07af
[CI] Snapshots (#1271)
Stream-SDK-Bot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
40 changes: 40 additions & 0 deletions
40
Sources/StreamChatSwiftUI/ChatMessageList/AttachmentTextView.swift
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| // | ||
| // Copyright Β© 2026 Stream.io Inc. All rights reserved. | ||
| // | ||
|
|
||
| import StreamChat | ||
| import SwiftUI | ||
|
|
||
| public struct AttachmentTextView<Factory: ViewFactory>: View { | ||
| @Injected(\.colors) private var colors | ||
| @Injected(\.fonts) private var fonts | ||
| @Injected(\.tokens) private var tokens | ||
|
|
||
| var factory: Factory | ||
| var message: ChatMessage | ||
| let injectedBackgroundColor: UIColor? | ||
|
|
||
| public init(factory: Factory = DefaultViewFactory.shared, message: ChatMessage, injectedBackgroundColor: UIColor? = nil) { | ||
| self.factory = factory | ||
| self.message = message | ||
| self.injectedBackgroundColor = injectedBackgroundColor | ||
| } | ||
|
|
||
| public var body: some View { | ||
| HStack { | ||
| factory.makeStreamTextView(options: .init(message: message)) | ||
| .padding(.horizontal, tokens.spacingXxs) | ||
| .fixedSize(horizontal: false, vertical: true) | ||
| Spacer() | ||
| } | ||
| .background(Color(backgroundColor)) | ||
| .accessibilityIdentifier("MessageTextView") | ||
| } | ||
|
|
||
| private var backgroundColor: UIColor { | ||
| if let injectedBackgroundColor { | ||
| return injectedBackgroundColor | ||
| } | ||
| return message.isSentByCurrentUser ? colors.chatBackgroundOutgoing : colors.chatBackgroundIncoming | ||
| } | ||
| } | ||
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.