stream-chat-flutter icon indicating copy to clipboard operation
stream-chat-flutter copied to clipboard

feat(ui, core): add additional scroll behavior customization

Open HayesGordon opened this issue 3 years ago • 1 comments

There are a few things to review/consider:

  • I exposed a few more attributes for scroll customisation. We should consider exposing alignment as well for further customisation - used in scrollTo. At least for jumping to a reply.
  • Wether scrolling can break under certain situations. From my testing it improves things drastically, but there are certain occasions on iOS if you continuously drag down while loading that it will push all the new content down, resulting in a jump.
  • Android needs to be tested more.
  • I'm not too happy with artificialDelayBeforePaginate (and it's naming). It seems like the only way to introduce a delay without doing a lot of code refactoring. We can remove this entirely, but it is nice to have the loading indicator visible for a bit before new data is loaded in. If this is removed then we need to play around with the scrollOffset.
  • We can consider completely clamping the scroll at the top for iOS (meaning you cannot do the drag down bounce). This could prevent any weird behaviour.
  • Test jumping to a message at the top of the list and ensuring it doesn't overshoot on iOS and bounce back. I've tested this quite a bit and seems to work great with the custom scroll physics.
  • Need to consider when the list is not in reverse. I have not tested this.
  • Will add to the Changelog once everything is finalised

HayesGordon avatar Jan 17 '22 09:01 HayesGordon

Codecov Report

Merging #862 (0557648) into develop (e5f7707) will increase coverage by 8.13%. The diff coverage is 44.44%.

:exclamation: Current head 0557648 differs from pull request most recent head c0c1af8. Consider uploading reports for the commit c0c1af8 to get more accurate results

@@             Coverage Diff             @@
##           develop     #862      +/-   ##
===========================================
+ Coverage    67.87%   76.01%   +8.13%     
===========================================
  Files          228      192      -36     
  Lines        23561    20694    -2867     
===========================================
- Hits         15992    15730     -262     
+ Misses        7569     4964    -2605     
Impacted Files Coverage Δ
...ream_chat_flutter_core/lib/src/stream_channel.dart 64.74% <25.00%> (+2.07%) :arrow_up:
...stream_chat_flutter/lib/src/message_list_view.dart 43.22% <44.62%> (-1.36%) :arrow_down:
...m_chat_flutter_core/lib/src/message_list_core.dart 83.09% <100.00%> (+0.48%) :arrow_up:
...ream_chat/lib/src/core/models/attachment_file.dart 38.23% <0.00%> (-13.38%) :arrow_down:
...ages/stream_chat_flutter/lib/src/message_text.dart 66.66% <0.00%> (-9.81%) :arrow_down:
packages/stream_chat/lib/src/core/http/token.dart 95.65% <0.00%> (-4.35%) :arrow_down:
...ckages/stream_chat/lib/src/core/models/filter.dart 96.15% <0.00%> (-3.85%) :arrow_down:
...stream_chat_flutter/lib/src/full_screen_media.dart 47.82% <0.00%> (-3.21%) :arrow_down:
...tream_chat/lib/src/db/chat_persistence_client.dart 91.01% <0.00%> (-2.93%) :arrow_down:
... and 171 more

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 e5f7707...c0c1af8. Read the comment docs.

codecov[bot] avatar Mar 09 '22 12:03 codecov[bot]