V5: [MessageList] Update bubbles and text colors in messages#1142
V5: [MessageList] Update bubbles and text colors in messages#1142
Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
| let path = UIBezierPath( | ||
| roundedRect: rect, | ||
| byRoundingCorners: corners, | ||
| cornerRadii: CGSize(width: cornerRadius, height: cornerRadius) | ||
| ) |
There was a problem hiding this comment.
Bubble corners started to be drawn using the Apple's continuous style instead of circular which does not give what we want (only when message is super small). Creating the path with circular arcs fixes it. Much longer, but works.
Co-authored-by: Stream Bot <ci@getstream.io>
Generated by π« Danger |
| } else { | ||
| Text(message.adjustedText) | ||
| .font(fonts.emoji) | ||
| .padding(.horizontal, tokens.spacingSm) |
There was a problem hiding this comment.
Yes, emojis have bubbles now
There was a problem hiding this comment.
let's challenge that, it's not really standard. Raised it in figma, but let's keep it for now.
Co-authored-by: Stream Bot <ci@getstream.io>
martinmitrevski
left a comment
There was a problem hiding this comment.
- bottom style reactions don't seem to match any more (they're less rounded)
- there are some missing borders/bubbles, e.g. MessageView_Tests/test_messageViewImage_snapshot.1.png
| } else { | ||
| Text(message.adjustedText) | ||
| .font(fonts.emoji) | ||
| .padding(.horizontal, tokens.spacingSm) |
There was a problem hiding this comment.
let's challenge that, it's not really standard. Raised it in figma, but let's keep it for now.
Co-authored-by: Stream Bot <ci@getstream.io>
# Conflicts: # StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/ChatChannelViewDateOverlay_Tests/test_chatChannelView_snapshot.1.png # StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/ChatChannelView_Tests/test_chatChannelView_snapshot.1.png # StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/ChatChannelView_Tests/test_chatChannelView_themedNavigationBar_snapshot.1.png # StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/MessageComposerView_Tests/test_composerQuotedMessage_translated.default-dark.png # StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/MessageComposerView_Tests/test_composerQuotedMessage_translated.default-light.png # StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/MessageComposerView_Tests/test_composerView_draftWithVoiceRecordingAttachment.default-light.png # StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/MessageComposerView_Tests/test_composerView_editingMessageWithVoiceRecording.default-light.png # StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/MessageComposerView_Tests/test_messageComposerView_addedVoiceRecording.1.png # StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/MessageListViewLastGroupHeader_Tests/test_messageListView_headerOnTop.1.png
β¦tStream/stream-chat-swiftui into v5-message-list-text-messages
Co-authored-by: Stream Bot <ci@getstream.io>
|
# Conflicts: # StreamChatSwiftUI.xcodeproj/project.pbxproj
| } | ||
| ) | ||
| ) : nil, | ||
| alignment: messageViewModel.isRightAligned ? .trailing : .leading |
There was a problem hiding this comment.
It was easier to handle it like this when bubble is really small
Co-authored-by: Stream Bot <ci@getstream.io>
Public Interface+ public enum ReactionsStyle
+
+ case clustered
+ case segmented
public struct MessageModifierInfo
- public var cornerRadius: CGFloat
+ public var cornerRadius: CGFloat?
- public init(message: ChatMessage,isFirst: Bool,injectedBackgroundColor: UIColor? = nil,cornerRadius: CGFloat = 18,forceLeftToRight: Bool = false)
+ public init(message: ChatMessage,isFirst: Bool,injectedBackgroundColor: UIColor? = nil,cornerRadius: CGFloat? = nil,forceLeftToRight: Bool = false)
public struct MessageDisplayOptions
- public let showOriginalTranslatedButton: Bool
+ public let reactionsStyle: ReactionsStyle
- public let messageLinkDisplayResolver: @MainActor (ChatMessage) -> [NSAttributedString.Key: Any]
+ public let showOriginalTranslatedButton: Bool
- public let spacerWidth: (CGFloat) -> CGFloat
+ public let messageLinkDisplayResolver: @MainActor (ChatMessage) -> [NSAttributedString.Key: Any]
- public let reactionsTopPadding: (ChatMessage) -> CGFloat
+ public let spacerWidth: (CGFloat) -> CGFloat
- public let dateSeparator: (ChatMessage, ChatMessage) -> Date?
+ public let reactionsTopPadding: (ChatMessage) -> CGFloat
- public static var defaultLinkDisplay: @MainActor (ChatMessage) -> [NSAttributedString.Key: Any]
+ public let dateSeparator: (ChatMessage, ChatMessage) -> Date?
- public static var defaultSpacerWidth: (CGFloat) -> (CGFloat)
+ public static var defaultLinkDisplay: @MainActor (ChatMessage) -> [NSAttributedString.Key: Any]
- public static var defaultReactionsTopPadding: (ChatMessage) -> CGFloat
+ public static var defaultSpacerWidth: (CGFloat) -> (CGFloat)
-
+ public static var defaultReactionsTopPadding: (ChatMessage) -> CGFloat
-
+
- public init(showAvatars: Bool = true,showAvatarsInGroups: Bool? = nil,showMessageDate: Bool = true,showAuthorName: Bool = true,animateChanges: Bool = true,overlayDateLabelSize: CGFloat = 40,lastInGroupHeaderSize: CGFloat = 0,newMessagesSeparatorSize: CGFloat = 50,minimumSwipeGestureDistance: CGFloat = 20,currentUserMessageTransition: AnyTransition = .identity,otherUserMessageTransition: AnyTransition = .identity,shouldAnimateReactions: Bool = true,reactionsPlacement: ReactionsPlacement = .top,showOriginalTranslatedButton: Bool = false,messageLinkDisplayResolver: @escaping @MainActor (ChatMessage) -> [NSAttributedString.Key: Any] = MessageDisplayOptions
+
- .defaultLinkDisplay,spacerWidth: @escaping (CGFloat) -> CGFloat = MessageDisplayOptions.defaultSpacerWidth,reactionsTopPadding: @escaping (ChatMessage) -> CGFloat = MessageDisplayOptions.defaultReactionsTopPadding,dateSeparator: @escaping (ChatMessage, ChatMessage) -> Date? = MessageDisplayOptions.defaultDateSeparator)
+ public init(showAvatars: Bool = true,showAvatarsInGroups: Bool? = nil,showMessageDate: Bool = true,showAuthorName: Bool = true,animateChanges: Bool = true,overlayDateLabelSize: CGFloat = 40,lastInGroupHeaderSize: CGFloat = 0,newMessagesSeparatorSize: CGFloat = 50,minimumSwipeGestureDistance: CGFloat = 20,currentUserMessageTransition: AnyTransition = .identity,otherUserMessageTransition: AnyTransition = .identity,shouldAnimateReactions: Bool = true,reactionsPlacement: ReactionsPlacement = .top,reactionsStyle: ReactionsStyle = .segmented,showOriginalTranslatedButton: Bool = false,messageLinkDisplayResolver: @escaping @MainActor (ChatMessage) -> [NSAttributedString.Key: Any] = MessageDisplayOptions
-
+ .defaultLinkDisplay,spacerWidth: @escaping (CGFloat) -> CGFloat = MessageDisplayOptions.defaultSpacerWidth,reactionsTopPadding: @escaping (ChatMessage) -> CGFloat = MessageDisplayOptions.defaultReactionsTopPadding,dateSeparator: @escaping (ChatMessage, ChatMessage) -> Date? = MessageDisplayOptions.defaultDateSeparator)
-
+
- public func showAvatars(for channel: ChatChannel)-> Bool
+
- public static func defaultDateSeparator(message: ChatMessage,previous: ChatMessage)-> Date?
+ public func showAvatars(for channel: ChatChannel)-> Bool
+ public static func defaultDateSeparator(message: ChatMessage,previous: ChatMessage)-> Date?
public struct MessageBubbleModifier: ViewModifier
- public var cornerRadius: CGFloat
+ public var cornerRadius: CGFloat?
- public init(message: ChatMessage,isFirst: Bool,injectedBackgroundColor: UIColor? = nil,cornerRadius: CGFloat = 18,forceLeftToRight: Bool = false,topPadding: CGFloat = 0,bottomPadding: CGFloat = 0)
+ public init(message: ChatMessage,isFirst: Bool,injectedBackgroundColor: UIColor? = nil,cornerRadius: CGFloat?,forceLeftToRight: Bool = false,topPadding: CGFloat = 0,bottomPadding: CGFloat = 0)
public struct MessageTextView: View
- public init(factory: Factory,message: ChatMessage,isFirst: Bool,leadingPadding: CGFloat = 16,trailingPadding: CGFloat = 16,topPadding: CGFloat = 8,bottomPadding: CGFloat = 8,scrolledId: Binding<String?>)
+ public init(factory: Factory,message: ChatMessage,isFirst: Bool,scrolledId: Binding<String?>)
+ public init(factory: Factory,message: ChatMessage,isFirst: Bool,leadingPadding: CGFloat,trailingPadding: CGFloat,topPadding: CGFloat,bottomPadding: CGFloat,scrolledId: Binding<String?>) |
SDK Size
|
StreamChatSwiftUI XCSize
Show 39 more objects
|




π Issue Links
Related: IOS-1379
π― Goal
Update bubble colors and message text colors
π Summary
No icon changes nor localizable string changes in this PR.
π Implementation
π¨ Showcase
π§ͺ Manual Testing Notes
βοΈ Contributor Checklist
docs-contentrepo