Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

### 🐞 Fixed
- Use bright color for typing indicator animation in dark mode [#702](https://github.com/GetStream/stream-chat-swiftui/pull/702)
- Quoted message preview did not update when the quoted message was deleted [#705](https://github.com/GetStream/stream-chat-swiftui/pull/705)

# [4.69.0](https://github.com/GetStream/stream-chat-swiftui/releases/tag/4.69.0)
_December 18, 2024_
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,9 @@ extension View {
public func textColor(for message: ChatMessage) -> Color {
@Injected(\.colors) var colors

if message.isDeleted {
return Color(colors.textLowEmphasis)
}
if message.isSentByCurrentUser {
return Color(colors.messageCurrentUserTextColor)
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,9 @@ public struct QuotedMessageView<Factory: ViewFactory>: View {
}

private var textForMessage: String {
if !quotedMessage.text.isEmpty {
return quotedMessage.adjustedText
let textContent = quotedMessage.textContent ?? ""
if !textContent.isEmpty {
return textContent
}

if !quotedMessage.imageAttachments.isEmpty {
Expand Down
4 changes: 2 additions & 2 deletions StreamChatSwiftUI.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3835,8 +3835,8 @@
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/GetStream/stream-chat-swift.git";
requirement = {
kind = upToNextMajorVersion;
minimumVersion = 4.69.0;
branch = "fix/quoted-message-refresh";
kind = branch;
};
};
E3A1C01A282BAC66002D1E26 /* XCRemoteSwiftPackageReference "sentry-cocoa" */ = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,8 @@ extension View {
height: defaultScreenSize.height
)
}

func applySize(_ size: CGSize) -> some View {
frame(width: size.width, height: size.height)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,21 @@ class QuotedMessageView_Tests: StreamChatTestCase {
assertSnapshot(matching: view, as: .image(perceptualPrecision: precision))
}

func test_quotedMessageView_deletedSnapshot() {
// Given
let viewSize = CGSize(width: 200, height: 50)
let message = ChatMessage.mock(text: "Hello", deletedAt: .unique)
let view = QuotedMessageView(
factory: DefaultViewFactory.shared,
quotedMessage: message,
fillAvailableSpace: true,
forceLeftToRight: true
)
.applySize(viewSize)

AssertSnapshot(view, variants: .onlyUserInterfaceStyles, size: viewSize)
}

func test_quotedMessageView_voiceAttachmentSnapshot() {
// Given
let payload = VoiceRecordingAttachmentPayload(
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading