mattermost-mobile/app/utils
Miguel Alatzar f79f9dc697
[MM-23761] [MM-25766] Add "More Messages" button (#4526)
* Add more messages button

* Update existing tests

* Various fixes:

* Use viewAreaCoveragePercentThreshold over itemVisiblePercentThreshold
* Remove currentUserId check when adding New Message line to postIds and
  instead update the channel last viewed time when an own post is received

* Update snapshots

* Add showMoreMessagesButton prop and default to false

* Android fixes

* Add tests

* Localize more messages text

* Use FormattedText

* i18 extract

* Style fixes

* Account for network indicator

* Fix for failing tests

* Various fixes:

* Set the unreadMessageCount when POST_UNREAD_SUCCESS is dispatched
  with a positive deltaMsgs
* Hide the more messages button when the unread count decreases or
  when the new message line is removed shortly after loading the
  channel

* No need for POST_UNREAD_SUCCESS if we manually call onViewableItemsChanged

* Reset unread count if current channel on channel mount

* Animate text opacity

* Compare indeces to determine when scrolling has ended

* Fix opacity animation trigger

* try with scrolling to the last rendered item

* Add onScrollEndIndex

* Improve animations

* Don't track moreCount in state

* Use moreText over prevNewMessageLineIndex to determine firstPage

* Update intl message format and call cancel in componentDidUpdate when needed

* Fix intl format

* Remove opacity animation and countText

* Fix pressed not being reset

* No need to separate intl func

* Return after resetting

* Fix accidental removal of setState call

* Reset pressed when newLineMessageIndex changes

* Use default windowSize and lower POST_CHUNK_SIZE and delays

* Queue a cancel timer that gets cleared only when the newMessageLineIndex changes

* Define uncancel func

* Increase cancelTimer delay

* Subtract read posts from unread count and account for retry indicator

* Add retry bar indicator tests

* Use props.unreadCount

* Fix handling of newMessageLineIndex change

* Fix handling of newMessageLineIndex change take 2

* Fix handling of newMessageLineIndex change take 3

* Use 'native' TouchableWithFeedback with dark overlay

* Fix handling of manually unread

* Update chunk and window sizes

* Fix hsl

* Update text only when newMessageLineIndex/endIndex is reached

* Don't delay cancel if when no more unreads

* Fixes for when opening the app

* No need to process viewableItems when unreadCount is 0

* Remove line

* Don't show if unreadCount is 0

Co-authored-by: Elias Nahum <nahumhbl@gmail.com>
2020-07-09 13:30:30 -07:00
..
bottom_sheet [MM-17560] Await dismissAllModals and popToRoot prior to calling showSearchModal (#3298) 2019-09-25 15:23:45 -07:00
sentry MM-23570 Migrate from Segment to Rudder (#4293) 2020-05-13 16:54:07 -04:00
avoid_native_bridge.js add eslint-plugin-header, and --fix all (#1726) 2018-06-19 19:14:50 -04:00
channels.js [MM-22671] [MM-22935] Fetch posts for unread channels on loadChannelsForTeam (#4078) 2020-03-31 18:41:11 -03:00
client_upgrade.js MM-23570 Migrate from Segment to Rudder (#4293) 2020-05-13 16:54:07 -04:00
emoji_utils.js [MM-22078] [MM-22083] Sort emojis in EmojiPicker (#3865) 2020-01-28 15:04:59 -07:00
emoji_utils.test.js [MM-22078] [MM-22083] Sort emojis in EmojiPicker (#3865) 2020-01-28 15:04:59 -07:00
emojis.js MM-24115 Use Native + BuiltIn emojis instead of systemEmojis (#4274) 2020-05-13 18:23:47 -04:00
error_handling.js Various fixes: (#4474) 2020-06-23 16:39:49 -07:00
file.js MM-22155 ESLint configuration updates part 1 (#4311) 2020-05-20 08:27:27 -07:00
file.test.js MM-20778 Remove caption as part of the file path (#3646) 2019-12-03 08:12:53 +08:00
general.js Various fixes: (#4465) 2020-06-22 15:24:54 -07:00
i18n.js Add t() translation mark to i18nable strings and update translations (#2026) 2018-09-21 11:25:38 -03:00
image_cache_manager.js [MM-23520] Port mattermost-redux (#4088) 2020-03-31 11:09:26 -07:00
image_cache_manager.test.js MM-15758 Update dependencies including Fastlane (#4272) 2020-05-18 11:24:47 -07:00
images.js MM-24285 Use FastImage instead of Image (#4218) 2020-04-28 23:23:39 +08:00
images.test.js MM-14030 Don't show large gifs in posts (#2750) 2019-05-01 09:34:45 -04:00
latinise.js Port WebSocket from mm-redux and batch actions (#4060) 2020-03-26 21:23:50 -03:00
list_view.js add eslint-plugin-header, and --fix all (#1726) 2018-06-19 19:14:50 -04:00
markdown.js MM-26722 check for switchKeyboardForCodeBlocks only on iOS 12+ (#4537) 2020-07-07 13:01:48 -04:00
markdown.test.js MM-26722 check for switchKeyboardForCodeBlocks only on iOS 12+ (#4537) 2020-07-07 13:01:48 -04:00
member_list.js Refactor CustomList to use Section and Flat Lists (#2332) 2018-11-13 18:16:57 -05:00
message_attachment_colors.js Fix Message attachment actions colors on dark themes (#4061) 2020-03-23 22:05:42 -03:00
network.js [MM-23520] Port mattermost-redux (#4088) 2020-03-31 11:09:26 -07:00
notify_props.js add eslint-plugin-header, and --fix all (#1726) 2018-06-19 19:14:50 -04:00
opengraph.js add eslint-plugin-header, and --fix all (#1726) 2018-06-19 19:14:50 -04:00
preferences.js Performance improvements (#3911) 2020-02-17 21:18:09 -07:00
reaction.js [MM-13433] Fix unnecessary rendering for reactions component and reaction list screen (#2464) 2018-12-18 23:07:42 +08:00
reaction.test.js [MM-13433] Fix unnecessary rendering for reactions component and reaction list screen (#2464) 2018-12-18 23:07:42 +08:00
security.js Revert updated dependecies for SSO (#4499) 2020-06-26 21:50:53 -04:00
status.js MM-13846 Alert boxes to follow UX Guidelines (#2525) 2019-01-28 12:48:07 -03:00
tap.js MM-13151 Increase double tap delay for post action buttons (#2406) 2019-04-02 10:22:31 -04:00
tap.test.js MM-22089 set default prevent double tap to 1s for ChannelInfo modal (#4133) 2020-04-27 10:04:58 -04:00
teams.js Fix infinite skeleton in different use cases and do not scroll to messages already seen (#4304) 2020-05-19 18:54:34 -04:00
teams.test.js MM-22155 ESLint configuration updates part 1 (#4311) 2020-05-20 08:27:27 -07:00
theme.js [MM-23761] [MM-25766] Add "More Messages" button (#4526) 2020-07-09 13:30:30 -07:00
theme.test.js [MM-16593] Upgrade to RN 0.61.2 (#3455) 2019-10-28 15:04:24 -07:00
time_tracker.js add eslint-plugin-header, and --fix all (#1726) 2018-06-19 19:14:50 -04:00
timezone.js MM-15758 Update dependencies including Fastlane (#4272) 2020-05-18 11:24:47 -07:00
tooltip.js add eslint-plugin-header, and --fix all (#1726) 2018-06-19 19:14:50 -04:00
url.js [MM-23520] Port mattermost-redux (#4088) 2020-03-31 11:09:26 -07:00
url.test.js Handle links with no server URL provided (#3862) 2020-01-28 09:14:57 -03:00
users.js Port WebSocket from mm-redux and batch actions (#4060) 2020-03-26 21:23:50 -03:00
why_did_you_update.js Fix Posts cutoff (#2071) 2018-09-04 11:53:15 -03:00
wrap_context_provider.js [MM-16139] [MM-16140] [MM-16141] Update the remaining screens/components (#2920) 2019-07-08 10:03:31 -07:00