Skip to content
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

Quoted message preview did not update when the quoted message was deleted #3553

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from

Conversation

laevandus
Copy link
Contributor

@laevandus laevandus commented Jan 8, 2025

🔗 Issue Links

Resolves IOS-478

🎯 Goal

When quoted message was deleted, then it did not refresh

📝 Summary

  • Trigger FRC refresh for quoted by messages
  • Update the text of the quoted message to use the "Message deleted" text
  • Change the text color in the quoted message (snapshot overrides the light grey, works ok in the demo app)

🛠 Implementation

Manually trigger refreshes for quoted by messages (messages showing the quoted message view)

🎨 Showcase

Before After
Before After

🧪 Manual Testing Notes

  1. Send a message
  2. Use the reply action and send a reply
  3. Delete the message in the step 1 > message in the step 2 updates

☑️ Contributor Checklist

  • I have signed the Stream CLA (required)
  • This change should be manually QAed
  • Changelog is updated with client-facing changes
  • Changelog is updated with new localization keys
  • New code is covered by unit tests
  • Documentation has been updated in the docs-content repo

@laevandus laevandus added 🐞 Bug An issue or PR related to a bug 🌐 SDK: StreamChat (LLC) Tasks related to the StreamChat LLC SDK 🎨 SDK: StreamChatUI Tasks related to the StreamChatUI SDK labels Jan 8, 2025
@laevandus laevandus requested a review from a team as a code owner January 8, 2025 11:04
@@ -170,7 +170,7 @@ open class QuotedChatMessageView: _View, ThemeProvider, SwiftUIRepresentable {
? appearance.colorPalette.popoverBackground
: appearance.colorPalette.highlightedAccentBackground1

setText(message.text)
setText(message.textContent ?? "")
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

textContent internally checks for the deleted state

isSentByCurrentUser: true
)
view.content = QuotedChatMessageView.Content(message: message, avatarAlignment: .leading)
AssertSnapshot(view)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure how to force the snapshot test to capture the grey text color. This works OK in the demo app, but snapshot test uses whatever textView.textColor is. I did not want to overcomplicate this so I left it as is. Seems to be related to order of things when view is rendered.

@Stream-SDK-Bot
Copy link
Collaborator

SDK Size

title develop branch diff status
StreamChat 6.98 MB 6.98 MB 0 KB 🟢
StreamChatUI 4.77 MB 4.77 MB 0 KB 🟢

@Stream-SDK-Bot
Copy link
Collaborator

SDK Performance

target metric benchmark branch performance status
MessageList Hitches total duration 10 ms 3.34 ms 66.6% 🔼 🟢
Duration 2.6 s 2.55 s 1.92% 🔼 🟢
Hitch time ratio 4 ms per s 1.31 ms per s 67.25% 🔼 🟢
Frame rate 75 fps 78.1 fps 4.13% 🔼 🟢
Number of hitches 1 0.4 60.0% 🔼 🟢

@laevandus laevandus force-pushed the fix/quoted-message-refresh branch from a7edef7 to cc67896 Compare January 8, 2025 11:25
@Stream-SDK-Bot
Copy link
Collaborator

Stream-SDK-Bot commented Jan 8, 2025

SDK Size

title develop branch diff status
StreamChat 6.98 MB 6.98 MB 0 KB 🟢
StreamChatUI 4.77 MB 4.77 MB 0 KB 🟢

@laevandus laevandus changed the title Refresh quoted by messages when quoted message changes Quoted message preview did not update when the quoted message was deleted Jan 8, 2025
Copy link
Member

@nuno-vieira nuno-vieira left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! ✅ Just added suggestion improvement to the changelog

CHANGELOG.md Outdated Show resolved Hide resolved
@laevandus laevandus added the 🤞 Ready For QA A PR that is Ready for QA label Jan 9, 2025
@testableapple testableapple added 🟢 QAed A PR that was QAed and removed 🤞 Ready For QA A PR that is Ready for QA labels Jan 9, 2025
@laevandus laevandus enabled auto-merge (squash) January 9, 2025 13:45
@laevandus laevandus force-pushed the fix/quoted-message-refresh branch from 0f271ea to c62daad Compare January 9, 2025 14:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 Bug An issue or PR related to a bug 🟢 QAed A PR that was QAed 🌐 SDK: StreamChat (LLC) Tasks related to the StreamChat LLC SDK 🎨 SDK: StreamChatUI Tasks related to the StreamChatUI SDK
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants