Fix spacings in message annotations#1403
Conversation
|
No actionable comments were generated in the recent review. π βΉοΈ Recent review infoβοΈ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: π Files selected for processing (1)
β Files skipped from review due to trivial changes (1)
π WalkthroughWalkthroughLayout and spacing for message annotations were adjusted across MessageAnnotationView, MessageContainerView, MessageListConfig, and MessageTopView; snapshot tests were added/updated to use parameterized sizes; a Fastlane lane for local snapshot recording was added and CHANGELOG updated. Changes
Estimated code review effortπ― 3 (Moderate) | β±οΈ ~20 minutes Poem
π₯ Pre-merge checks | β 2 | β 1β Failed checks (1 warning)
β Passed checks (2 passed)
βοΈ Tip: You can configure your own custom pre-merge checks in the settings. β¨ Finishing Touchesπ§ͺ Generate unit tests (beta)
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 |
| desc 'Record UI Snapshots locally' | ||
| lane :record_snapshots_locally do |
There was a problem hiding this comment.
Convenience for me since quite often I just wanna run them all
|
|
||
| public static var defaultReactionsTopPadding: (ChatMessage) -> CGFloat { | ||
| { _ in 20 } | ||
| { _ in 19 } |
There was a problem hiding this comment.
Fine tuning to get the same spacing what Figma uses between reactions and annotations
There was a problem hiding this comment.
Icons were updated in StreamChatCommonUI so this got updated
There was a problem hiding this comment.
That would be updated when this one is merged: #1402. I think there might be a conflict, but nothing scary to fix.
There was a problem hiding this comment.
π§Ή Nitpick comments (2)
Sources/StreamChatSwiftUI/ChatMessageList/MessageListConfig.swift (1)
295-297: Consider using a design token instead of a hardcoded value.The value
19is a magic number. Per coding guidelines, design values should come from tokens inInjectedValuesExtensions.swiftrather than being hardcoded. If no appropriate token exists, this might be an opportunity to define one for reaction padding.π€ Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@Sources/StreamChatSwiftUI/ChatMessageList/MessageListConfig.swift` around lines 295 - 297, The closure defaultReactionsTopPadding in MessageListConfig uses a hardcoded magic number 19; replace that literal with a design token from InjectedValuesExtensions (or add a new token there if none exists) and return that token value (for example reference a new injected value like injectedValues.reactionTopPadding or similar) so the padding comes from the shared design system rather than a hardcoded constant.fastlane/Fastfile (1)
397-410: Consider adding caching options for consistency with other test lanes.The new lane is missing
derived_data_pathandcloned_source_packages_pathoptions that are used in thetest_uilane (lines 201-202). This could lead to longer build times and inconsistent behavior when running locally.π‘ Suggested improvement
lane :record_snapshots_locally do remove_snapshots scan( project: xcode_project, scheme: 'StreamChatSwiftUI', testplan: 'StreamChatSwiftUI', configuration: 'Debug', + derived_data_path: derived_data_path, + cloned_source_packages_path: source_packages_path, devices: ['iPhone 17 Pro (26.2)'], fail_build: false, suppress_xcode_output: true ) endπ€ Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@fastlane/Fastfile` around lines 397 - 410, The new Fastlane lane record_snapshots_locally is missing the derived_data_path and cloned_source_packages_path scan options used in the test_ui lane; update the scan(...) call inside record_snapshots_locally to include derived_data_path and cloned_source_packages_path with the same values/variables used by test_ui so builds share the same derived data and package cache, reducing build time and ensuring consistent behavior.
π€ Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@fastlane/Fastfile`:
- Around line 397-410: The new Fastlane lane record_snapshots_locally is missing
the derived_data_path and cloned_source_packages_path scan options used in the
test_ui lane; update the scan(...) call inside record_snapshots_locally to
include derived_data_path and cloned_source_packages_path with the same
values/variables used by test_ui so builds share the same derived data and
package cache, reducing build time and ensuring consistent behavior.
In `@Sources/StreamChatSwiftUI/ChatMessageList/MessageListConfig.swift`:
- Around line 295-297: The closure defaultReactionsTopPadding in
MessageListConfig uses a hardcoded magic number 19; replace that literal with a
design token from InjectedValuesExtensions (or add a new token there if none
exists) and return that token value (for example reference a new injected value
like injectedValues.reactionTopPadding or similar) so the padding comes from the
shared design system rather than a hardcoded constant.
βΉοΈ Review info
βοΈ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: bf7ededb-e8b4-496a-8455-eebd29054e28
β Files ignored due to path filters (79)
StreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/MediaViewer_Tests/test_mediaViewerHeader_withMessageCreatedToday_snapshot.1.pngis excluded by!**/*.pngStreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/MediaViewer_Tests/test_mediaViewerHeader_withMessageExactDate_snapshot.1.pngis excluded by!**/*.pngStreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/MediaViewer_Tests/test_mediaViewer_snapshotLoading.1.pngis excluded by!**/*.pngStreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/MessageItemView_Tests/test_messageContainerViewPinned_snapshot.1.pngis excluded by!**/*.pngStreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/MessageItemView_Tests/test_messageContainerView_topReactionsWithPinnedAnnotation_snapshot.default-light.pngis excluded by!**/*.pngStreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/MessageItemView_Tests/test_messageContainerView_topReactionsWithPinnedAnnotation_snapshot.extraExtraExtraLarge-light.pngis excluded by!**/*.pngStreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/MessageItemView_Tests/test_messageContainerView_topReactionsWithPinnedAnnotation_snapshot.rightToLeftLayout-default.pngis excluded by!**/*.pngStreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/MessageItemView_Tests/test_messageContainerView_topReactionsWithPinnedAnnotation_snapshot.small-dark.pngis excluded by!**/*.pngStreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/MessageItemView_Tests/test_messageContainerView_topReactionsWithReminderAnnotation_snapshot.default-light.pngis excluded by!**/*.pngStreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/MessageItemView_Tests/test_messageContainerView_topReactionsWithReminderAnnotation_snapshot.extraExtraExtraLarge-light.pngis excluded by!**/*.pngStreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/MessageItemView_Tests/test_messageContainerView_topReactionsWithReminderAnnotation_snapshot.rightToLeftLayout-default.pngis excluded by!**/*.pngStreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/MessageItemView_Tests/test_messageContainerView_topReactionsWithReminderAnnotation_snapshot.small-dark.pngis excluded by!**/*.pngStreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/MessageItemView_Tests/test_messageContainerView_topReactionsWithThreadReplyAnnotation_snapshot.default-light.pngis excluded by!**/*.pngStreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/MessageItemView_Tests/test_messageContainerView_topReactionsWithThreadReplyAnnotation_snapshot.extraExtraExtraLarge-light.pngis excluded by!**/*.pngStreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/MessageItemView_Tests/test_messageContainerView_topReactionsWithThreadReplyAnnotation_snapshot.rightToLeftLayout-default.pngis excluded by!**/*.pngStreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/MessageItemView_Tests/test_messageContainerView_topReactionsWithThreadReplyAnnotation_snapshot.small-dark.pngis excluded by!**/*.pngStreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/MessageItemView_Tests/test_messagePreview_translatedText_snapshot.default-light.pngis excluded by!**/*.pngStreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/MessageItemView_Tests/test_messagePreview_translatedText_snapshot.extraExtraExtraLarge-light.pngis excluded by!**/*.pngStreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/MessageItemView_Tests/test_messagePreview_translatedText_snapshot.rightToLeftLayout-default.pngis excluded by!**/*.pngStreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/MessageItemView_Tests/test_messagePreview_translatedText_snapshot.small-dark.pngis excluded by!**/*.pngStreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/MessageItemView_Tests/test_portraitImageWithOneReaction_snapshot.extraExtraExtraLarge-light.pngis excluded by!**/*.pngStreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/MessageItemView_Tests/test_portraitImageWithOneReaction_snapshot.small-dark.pngis excluded by!**/*.pngStreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/MessageItemView_Tests/test_translatedText_showOriginalTranslatedButtonDisabled_translatedTextShown_snapshot.1.pngis excluded by!**/*.pngStreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/MessageItemView_Tests/test_translatedText_showOriginalTranslatedButtonEnabled_originalTextShown_snapshot.1.pngis excluded by!**/*.pngStreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/MessageItemView_Tests/test_translatedText_showOriginalTranslatedButtonEnabled_translatedTextShown_snapshot.1.pngis excluded by!**/*.pngStreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/MessageListView_Tests/test_messageListView_groupChannel_withReactions.1.pngis excluded by!**/*.pngStreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/MessageListView_Tests/test_messageListView_groupedMessages_withAllAnnotations.1.pngis excluded by!**/*.pngStreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/MessageListView_Tests/test_messageListView_groupedMessages_withThreadReplyAnnotation.1.pngis excluded by!**/*.pngStreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/MessageListView_Tests/test_messageListView_jumpToUnreadButton.1.pngis excluded by!**/*.pngStreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/MessageListView_Tests/test_messageListView_typingIndicator.1.pngis excluded by!**/*.pngStreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/MessageListView_Tests/test_messageListView_viewModelInit_withReactions.1.pngis excluded by!**/*.pngStreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/MessageListView_Tests/test_messageListView_withReactions.1.pngis excluded by!**/*.pngStreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/MessageListView_Tests/test_scrollToBottomButton_snapshotEmptyCount.default-light.pngis excluded by!**/*.pngStreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/MessageListView_Tests/test_scrollToBottomButton_snapshotEmptyCount.extraExtraExtraLarge-light.pngis excluded by!**/*.pngStreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/MessageListView_Tests/test_scrollToBottomButton_snapshotEmptyCount.rightToLeftLayout-default.pngis excluded by!**/*.pngStreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/MessageListView_Tests/test_scrollToBottomButton_snapshotEmptyCount.small-dark.pngis excluded by!**/*.pngStreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/MessageListView_Tests/test_scrollToBottomButton_snapshotHighUnreadCount.default-light.pngis excluded by!**/*.pngStreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/MessageListView_Tests/test_scrollToBottomButton_snapshotHighUnreadCount.extraExtraExtraLarge-light.pngis excluded by!**/*.pngStreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/MessageListView_Tests/test_scrollToBottomButton_snapshotHighUnreadCount.rightToLeftLayout-default.pngis excluded by!**/*.pngStreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/MessageListView_Tests/test_scrollToBottomButton_snapshotHighUnreadCount.small-dark.pngis excluded by!**/*.pngStreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/MessageListView_Tests/test_scrollToBottomButton_snapshotUnreadCount.default-light.pngis excluded by!**/*.pngStreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/MessageListView_Tests/test_scrollToBottomButton_snapshotUnreadCount.extraExtraExtraLarge-light.pngis excluded by!**/*.pngStreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/MessageListView_Tests/test_scrollToBottomButton_snapshotUnreadCount.rightToLeftLayout-default.pngis excluded by!**/*.pngStreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/MessageListView_Tests/test_scrollToBottomButton_snapshotUnreadCount.small-dark.pngis excluded by!**/*.pngStreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/MessageTopView_Tests/test_allAnnotations_inThread_snapshot.default-light.pngis excluded by!**/*.pngStreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/MessageTopView_Tests/test_allAnnotations_inThread_snapshot.extraExtraExtraLarge-light.pngis excluded by!**/*.pngStreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/MessageTopView_Tests/test_allAnnotations_inThread_snapshot.rightToLeftLayout-default.pngis excluded by!**/*.pngStreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/MessageTopView_Tests/test_allAnnotations_inThread_snapshot.small-dark.pngis excluded by!**/*.pngStreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/MessageTopView_Tests/test_allAnnotations_snapshot.default-light.pngis excluded by!**/*.pngStreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/MessageTopView_Tests/test_allAnnotations_snapshot.extraExtraExtraLarge-light.pngis excluded by!**/*.pngStreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/MessageTopView_Tests/test_allAnnotations_snapshot.rightToLeftLayout-default.pngis excluded by!**/*.pngStreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/MessageTopView_Tests/test_allAnnotations_snapshot.small-dark.pngis excluded by!**/*.pngStreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/MessageTopView_Tests/test_pinnedAnnotation_snapshot.default-light.pngis excluded by!**/*.pngStreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/MessageTopView_Tests/test_pinnedAnnotation_snapshot.extraExtraExtraLarge-light.pngis excluded by!**/*.pngStreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/MessageTopView_Tests/test_pinnedAnnotation_snapshot.rightToLeftLayout-default.pngis excluded by!**/*.pngStreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/MessageTopView_Tests/test_pinnedAnnotation_snapshot.small-dark.pngis excluded by!**/*.pngStreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/MessageTopView_Tests/test_pinnedByYouAnnotation_snapshot.default-light.pngis excluded by!**/*.pngStreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/MessageTopView_Tests/test_pinnedByYouAnnotation_snapshot.extraExtraExtraLarge-light.pngis excluded by!**/*.pngStreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/MessageTopView_Tests/test_pinnedByYouAnnotation_snapshot.rightToLeftLayout-default.pngis excluded by!**/*.pngStreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/MessageTopView_Tests/test_pinnedByYouAnnotation_snapshot.small-dark.pngis excluded by!**/*.pngStreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/MessageTopView_Tests/test_reminderAnnotation_snapshot.default-light.pngis excluded by!**/*.pngStreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/MessageTopView_Tests/test_reminderAnnotation_snapshot.extraExtraExtraLarge-light.pngis excluded by!**/*.pngStreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/MessageTopView_Tests/test_reminderAnnotation_snapshot.rightToLeftLayout-default.pngis excluded by!**/*.pngStreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/MessageTopView_Tests/test_reminderAnnotation_snapshot.small-dark.pngis excluded by!**/*.pngStreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/MessageTopView_Tests/test_repliedToThreadAnnotation_snapshot.default-light.pngis excluded by!**/*.pngStreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/MessageTopView_Tests/test_repliedToThreadAnnotation_snapshot.extraExtraExtraLarge-light.pngis excluded by!**/*.pngStreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/MessageTopView_Tests/test_repliedToThreadAnnotation_snapshot.rightToLeftLayout-default.pngis excluded by!**/*.pngStreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/MessageTopView_Tests/test_repliedToThreadAnnotation_snapshot.small-dark.pngis excluded by!**/*.pngStreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/MessageTopView_Tests/test_sentInChannelAnnotation_snapshot.default-light.pngis excluded by!**/*.pngStreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/MessageTopView_Tests/test_sentInChannelAnnotation_snapshot.extraExtraExtraLarge-light.pngis excluded by!**/*.pngStreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/MessageTopView_Tests/test_sentInChannelAnnotation_snapshot.rightToLeftLayout-default.pngis excluded by!**/*.pngStreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/MessageTopView_Tests/test_sentInChannelAnnotation_snapshot.small-dark.pngis excluded by!**/*.pngStreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/MessageTopView_Tests/test_translatedAnnotation_snapshot.default-light.pngis excluded by!**/*.pngStreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/MessageTopView_Tests/test_translatedAnnotation_snapshot.extraExtraExtraLarge-light.pngis excluded by!**/*.pngStreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/MessageTopView_Tests/test_translatedAnnotation_snapshot.rightToLeftLayout-default.pngis excluded by!**/*.pngStreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/MessageTopView_Tests/test_translatedAnnotation_snapshot.small-dark.pngis excluded by!**/*.pngStreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/ReactionsOverlayView_Tests/test_reactionsOverlayView_allAnnotations.default-dark.pngis excluded by!**/*.pngStreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/ReactionsOverlayView_Tests/test_reactionsOverlayView_allAnnotations.default-light.pngis excluded by!**/*.pngStreamChatSwiftUITests/Tests/ChatChannel/__Snapshots__/ReactionsOverlayView_Tests/test_reactionsOverlayView_translated.1.pngis excluded by!**/*.png
π Files selected for processing (7)
Sources/StreamChatSwiftUI/ChatMessageList/MessageAnnotationView.swiftSources/StreamChatSwiftUI/ChatMessageList/MessageContainerView.swiftSources/StreamChatSwiftUI/ChatMessageList/MessageListConfig.swiftSources/StreamChatSwiftUI/ChatMessageList/MessageTopView.swiftStreamChatSwiftUITests/Tests/ChatChannel/MessageListView_Tests.swiftStreamChatSwiftUITests/Tests/ChatChannel/MessageTopView_Tests.swiftfastlane/Fastfile
Co-authored-by: Stream Bot <ci@getstream.io>
There was a problem hiding this comment.
That would be updated when this one is merged: #1402. I think there might be a conflict, but nothing scary to fix.
SDK Size
|
Public Interfaceπ No changes affecting the public interface. |
StreamChatSwiftUI XCSize
|
|



π Issue Links
Fixes IOS-1559
π― Goal
Fix inconsistent spacings in message annotation views (pinned, reminder, thread reply, translated) and ensure the
reminder annotation renders correctly in snapshot tests.
π Summary
MessageTopView(spacingXxsβspacingXs)scaledToFit()and horizontal padding to annotation icons inMessageAnnotationViewMessageContainerViewto useannotationsShowninstead ofisPinnedfor reactionspadding, and added inter-item spacing for grouped messages with annotations
test_reminderAnnotation_snapshotto enablemessageRemindersEnabledin channel configMessageListView_Testsrecord_snapshots_locallyFastlane lane withsuppress_xcode_outputπ Implementation
The annotation icons had inconsistent sizing because they weren't using
scaledToFit(), causing layout issues. TheMessageContainerViewwas only checkingisPinnedto decide reactions top padding, but it should checkannotationsShownto handle all annotation types. Grouped messages with annotations also lacked top spacing betweenthem, fixed by applying
groupMessageInterItemSpacingwhen annotations are shown.The reminder snapshot test was rendering an empty view because
ChannelConfig.mock()defaultsmessageRemindersEnabledtofalse. The fix passes a channel with reminders enabled.π¨ Showcase
Snapshots re-recorded for all affected annotation views.
π§ͺ Manual Testing Notes
Verify message annotations (pinned, reminder, thread reply, translated) have consistent spacing in the message
list. Check grouped messages where one has an annotation.
βοΈ Contributor Checklist
docs-contentrepoSummary by CodeRabbit
Style
Tests
Chores