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

Maintain scroll position after fetching gap #8025

Merged
merged 1 commit into from
Apr 25, 2019
Merged

Conversation

rasom
Copy link
Contributor

@rasom rasom commented Apr 24, 2019

  1. previously the gap was shown before the first message which has timestamp higher than gap's from; in this PR the gap is shown after all messages which timestamp is lower than gap, also after messages which are inside the gap and before the first message which timestamp is higher than gap's to.
    before:

    message A (T=10)
    gap (20-30)
    message B (25)
    message C (35)
    

    after:

    message A (T=10)
    message B (25)
    gap (20-30)
    message C (35)
    

    This minimizes chances that requested messages will be rendered between messages B and C instead of rendering between gap and C. In result, we can scroll to message C before loading and bottom side of the chat will maintain the same position after fetching messages (no guaranty but higher chances).

  2. Before fetching the gap, the list is scrolled so that the next message after the gap (message C in the example above) is placed in the center of the screen. In this case, after rendering of the newly fetched messages, the user will still be able to see older, already seen messages along with new rendered messages which will replace gap above that "message C"

In some cases the app will behave properly without these changes, it depends on a number of referenced messages which are fetched and have to be rendered in responses. Also, messages like B might not be present in the chat's history.

status: ready

@rasom rasom changed the title Maintain scroll postion after fetching gap [WIP] Maintain scroll position after fetching gap Apr 24, 2019
@status-im-auto
Copy link
Member

status-im-auto commented Apr 24, 2019

Jenkins Builds

Click to see older builds (13)
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ 89cbdba #1 2019-04-24 09:12:56 ~15 min macos 📦 dmg
✔️ 89cbdba #1 2019-04-24 09:14:50 ~17 min android 📦 apk
✔️ 89cbdba #1 2019-04-24 09:17:55 ~20 min android-e2e 📦 apk
✔️ 89cbdba #1 2019-04-24 09:19:50 ~22 min linux 📦 App
✔️ 89cbdba #1 2019-04-24 09:21:02 ~23 min windows 📦 exe
✔️ 89cbdba #1 2019-04-24 09:23:33 ~25 min ios 📦 ipa
1750c5a #2 2019-04-24 15:51:22 ~5 min ios 📄 log
1750c5a #2 2019-04-24 15:51:25 ~5 min macos 📄 log
1750c5a #2 2019-04-24 15:51:43 ~6 min linux 📄 log
1750c5a #2 2019-04-24 15:51:55 ~6 min windows 📄 log
1750c5a #2 2019-04-24 15:54:30 ~8 min android-e2e 📄 log
1750c5a #2 2019-04-24 15:58:58 ~13 min android 📄 log
54fb59a #3 2019-04-24 19:41:27 ~5 min macos 📄 log
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ 3ed3c3b #4 2019-04-24 20:00:38 ~21 min macos 📦 dmg
✔️ 3ed3c3b #4 2019-04-24 20:05:41 ~26 min android-e2e 📦 apk
✔️ 3ed3c3b #4 2019-04-24 20:07:08 ~28 min ios 📦 ipa
✔️ 3ed3c3b #4 2019-04-24 20:07:42 ~28 min windows 📦 exe
✔️ 3ed3c3b #4 2019-04-24 20:12:48 ~33 min linux 📦 App
✔️ 3ed3c3b #4 2019-04-24 20:13:26 ~34 min android 📦 apk
✔️ cefe634 #5 2019-04-25 06:04:16 ~16 min linux 📦 App
✔️ cefe634 #5 2019-04-25 06:04:29 ~16 min macos 📦 dmg
✔️ cefe634 #5 2019-04-25 06:05:21 ~17 min android-e2e 📦 apk
✔️ cefe634 #5 2019-04-25 06:07:29 ~19 min windows 📦 exe
✔️ cefe634 #5 2019-04-25 06:14:21 ~26 min ios 📦 ipa
✔️ cefe634 #6 2019-04-25 08:08:43 ~20 min android 📦 apk

@rasom rasom force-pushed the gap-maintain-position branch 3 times, most recently from 54fb59a to 3ed3c3b Compare April 24, 2019 19:38
@rasom rasom self-assigned this Apr 24, 2019
@rasom rasom changed the title [WIP] Maintain scroll position after fetching gap Maintain scroll position after fetching gap Apr 25, 2019
(defview gap [{:keys [ids]}]
(defview gap
[ids idx list-ref in-progress? connected?]
[react/view {:align-self :stretch
Copy link
Member

Choose a reason for hiding this comment

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

move to styles?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ehm, let me finish with desktop first, and other related PRs. I'm sure it will be changed 2-3 times during next PRs. It's just simplier to keep everything in one place for now

@rasom
Copy link
Contributor Author

rasom commented Apr 25, 2019

@hesterbruikman that's the best I can propose without spending too much time on this task

@churik
Copy link
Member

churik commented Apr 25, 2019

Tested when "Fetching messages" (IOS 11.4.1, IPhone 7, Android 8, LG V20) is close to the top and to the bottom of the screen, and somewhere in the middle.
Looks much reliable with this small automatic scroll next message after the gap is always visible to me, so when fetching messages always can see the last message after a gap on the middle of the screen.

Ready to merge from my after e2e

@statustestbot
Copy link

98% of end-end tests have passed

Total executed tests: 48
Failed tests: 1
Passed tests: 47

Failed tests (1)

Click to expand
1. test_backup_recovery_phrase_warning_from_wallet

Device 1: Wait for PlusButton
Device 1: Wait for PlusButton

Donation was not received during 300 seconds!

Device sessions

Passed tests (47)

Click to expand
1. test_block_user_from_public_chat
Device sessions

2. test_filters_from_daap
Device sessions

3. test_copy_and_paste_messages
Device sessions

4. test_send_transaction_from_daap
Device sessions

5. test_request_and_receive_tokens_in_1_1_chat
Device sessions

6. test_deploy_contract_from_daap
Device sessions

7. test_public_chat_messaging
Device sessions

8. test_password_in_logcat_sign_in
Device sessions

9. test_text_message_1_1_chat
Device sessions

10. test_add_to_contacts
Device sessions

11. test_sign_typed_message (TestRail link is not found)
Device sessions

12. test_unread_messages_counter_1_1_chat
Device sessions

13. test_logcat_send_transaction_from_daap
Device sessions

14. test_send_message_in_group_chat
Device sessions

15. test_logcat_send_transaction_from_wallet
Device sessions

16. test_send_token_with_7_decimals
Device sessions

17. test_modify_transaction_fee_values
Device sessions

18. test_send_eth_from_wallet_to_address
Device sessions

19. test_manage_assets
Device sessions

20. test_logcat_send_transaction_in_1_1_chat
Device sessions

21. test_request_and_receive_eth_in_1_1_chat
Device sessions

22. test_swipe_to_delete_public_chat
Device sessions

23. test_send_emoji
Device sessions

24. test_search_chat_on_home
Device sessions

25. test_logcat_recovering_account
Device sessions

26. test_messaging_in_different_networks
Device sessions

27. test_send_tokens_in_1_1_chat
Device sessions

28. test_network_mismatch_for_send_request_commands
Device sessions

29. test_logcat_sign_message_from_daap
Device sessions

30. test_swipe_to_delete_1_1_chat
Device sessions

31. test_switch_users_and_add_new_account
Device sessions

32. test_send_stt_from_wallet
Device sessions

33. test_send_eth_in_1_1_chat
Device sessions

34. test_login_with_new_account
Device sessions

35. test_send_eth_from_wallet_to_contact
Device sessions

36. test_add_contact_from_public_chat
Device sessions

37. test_send_two_transactions_one_after_another_in_dapp
Device sessions

38. test_password_in_logcat_creating_account
Device sessions

39. test_backup_recovery_phrase
Device sessions

40. test_offline_status
Device sessions

41. test_open_google_com_via_open_dapp
Device sessions

42. test_unread_messages_counter_public_chat
Device sessions

43. test_sign_message_from_daap
Device sessions

44. test_user_can_remove_profile_picture
Device sessions

45. test_share_contact_code_and_wallet_address
Device sessions

46. test_request_eth_in_wallet
Device sessions

47. test_refresh_button_browsing_app_webview
Device sessions

@churik
Copy link
Member

churik commented Apr 25, 2019

failed e2e is due to an infrastructure issue, not related to PR

Signed-off-by: Igor Mandrigin <i@mandrigin.ru>
@mandrigin mandrigin merged commit 3a2d702 into develop Apr 25, 2019
@status-github-bot
Copy link

Pull Request Checklist

  • Have you updated the documentation, if impacted (e.g. docs.status.im)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Archived in project
Development

Successfully merging this pull request may close these issues.

8 participants