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

[CIS-969] Date overlay jumps when loading more messages #1235

Merged
merged 4 commits into from
Jul 1, 2021

Conversation

evsaev
Copy link
Contributor

@evsaev evsaev commented Jun 30, 2021

This PR fixed the issue when date overlay jumps when loading more but moving an overlay outside the list view.

Tried the following first:

  • preserveSuperviewLayoutMargins = true and keep pinning to self.layoutMargins
  • pin to superview.layoutMargins directly
  • create a top constraint with a constant calculated based on contentOffset.y

and none of it works 🚫. It seems layoutMargins follow the content size of table view when it changes and only after margins are updated to fit visible content area. Trying to follow the contentOffset.y would also involve following the contentSize.height which makes the logic of calculating the constraint too complicated.

fixed-date-indicator.mp4

@evsaev evsaev added the 🎨 SDK: StreamChatUI Tasks related to the StreamChatUI SDK label Jun 30, 2021
@evsaev evsaev self-assigned this Jun 30, 2021
@codecov-commenter
Copy link

codecov-commenter commented Jun 30, 2021

Codecov Report

Merging #1235 (8a160ee) into main (0de339f) will decrease coverage by 0.02%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1235      +/-   ##
==========================================
- Coverage   91.30%   91.28%   -0.03%     
==========================================
  Files         218      218              
  Lines        9353     9353              
==========================================
- Hits         8540     8538       -2     
- Misses        813      815       +2     
Flag Coverage Δ
llc-tests 91.28% <ø> (-0.03%) ⬇️
llc-tests-ios12 ?

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
Sources/StreamChat/Utils/Logger/Logger.swift 79.74% <0.00%> (-2.54%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0de339f...8a160ee. Read the comment docs.

@evsaev evsaev force-pushed the CIS-969-date-overlay-jumps-when-loading-more-messages branch from c76b753 to 8a160ee Compare June 30, 2021 11:58
CHANGELOG.md Outdated
@@ -44,6 +44,7 @@ _June 23, 2021_
### 🔄 Changed
- `scrollToLatestMessageButton` is now visible every time the last message is not visible. Not only when there is unread message. [#1208](https://github.com/GetStream/stream-chat-swift/pull/1208)
- `mediaPickerVC` in `ComposerVC` updated to show both photos and videos [#1194](https://github.com/GetStream/stream-chat-swift/pull/1194)
- `ChatMessageListScrollOverlayView` moved outside the `ChatMessageListView`. Now it's managed by `ChatMessageListVC` [#1235](https://github.com/GetStream/stream-chat-swift/pull/1235)
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we include it to the thread view, too?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

let me add it 👍

Copy link
Contributor Author

@evsaev evsaev Jun 30, 2021

Choose a reason for hiding this comment

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

✅ done. Please have a look

@evsaev evsaev force-pushed the CIS-969-date-overlay-jumps-when-loading-more-messages branch from 8a160ee to 40ad59c Compare June 30, 2021 16:15
@evsaev evsaev requested a review from VojtaStavik June 30, 2021 16:32
@evsaev evsaev force-pushed the CIS-969-date-overlay-jumps-when-loading-more-messages branch from 40ad59c to 0d163c5 Compare June 30, 2021 17:07
@evsaev evsaev force-pushed the CIS-969-date-overlay-jumps-when-loading-more-messages branch from 0d163c5 to 5d023d5 Compare July 1, 2021 09:22
@evsaev evsaev merged commit 25cd277 into main Jul 1, 2021
@evsaev evsaev deleted the CIS-969-date-overlay-jumps-when-loading-more-messages branch July 1, 2021 09:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🎨 SDK: StreamChatUI Tasks related to the StreamChatUI SDK
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants