Commit Graph

7681 Commits

Author SHA1 Message Date
Icaro Motta 1806cb792a
Allow users to swipe to delete or swipe to toggle unread notification status (#15106)
Adds support for swiping left/right on some types of notifications. Swiping left
(from left to right) shows a blue button allowing the user to mark the
notification as read/unread. Swiping right (from right to left) shows a red
button, allowing the user to delete the notification for good.

Related PR in status-go https://github.com/status-im/status-go/pull/3201.

Fixes https://github.com/status-im/status-mobile/issues/14901
Fixes https://github.com/status-im/status-mobile/issues/14900

Technical notes
===============

How's the performance? It feels near native performance in a production release
in a mid-range smartphone. So I'd say it's pretty good, but let me know if you
find any issue.

- I refrained from trying to eliminate all code duplication in this PR. Some
  notifications will behave differently, especially the ones with call to
  action, so I ask you to please take that in consideration when reviewing. See
  https://github.com/status-im/status-mobile/issues/15118
- React Native Gesture Handler has a component named
  [Swipeable](https://docs.swmansion.com/react-native-gesture-handler/docs/api/components/swipeable/).
  I used it instead of writing a monstrosity 👹 of code in
  Reanimated to achieve the same results.
- RN Gesture Handler touchables are the only ones that work with the Swipeable
  component, so I used them and added vars to `react-native.gesture`.
- I had to manually interpolate the translation X of the buttons behind
  notifications because notifications are transparent. To make interpolation
  work with `Swipeable` it's mandatory to use RN `Animated.View` and not
  `Reanimated.View` (see next point).
- `Swipeable` expects us to pass functions that will receive RN
  `AnimatedInterpolation` instances and the rendering lifecycle does not work as
  usual. Hooks didn't trigger as expected, functional Reagent components didn't
  behave as expected, etc. This means `Reanimated.View` and its interpolation
  function is out of question. I did try for almost two days, nothing works.

Testing notes
=============

These are some of the manual tests I ran. There are more scenarios to cover
obviously. Assuming no unread notifications before each flow:

Contact request notification
============================

From the perspective of an user A:

1. Receive a contact request from a non-mutual contact B.
2. Verify the unread count is displayed over the bell icon.
3. Verify the unread count is displayed on the `Messages > Contacts` tab, as
   well as on the AC `Contact requests` tab.
4. Open the AC and before accepting/declining the contact request, check that
   you CAN'T swipe left or right.
5. Accept or decline the contact request.
6. Check the unread indicator disappears in all necessary places.
7. Press on the notification and see if you're redirected to the chat.
8. Go back to the AC and swipe left to mark as `Unread`. Notice that opening the
   chat marks the notification as `Read`. Also very important, notice that the
   `Messages > Contacts` tab will NOT show the *pending contact requests*
   section at the top. This is on purpose, given the notification is unread, but
   the user has already accepted/declined the contact request, hence it's not
   pending.
9. Swipe left againg to mark as `Read`. Check all unread indicators are updated.
10. Swipe right to delete the notification (it won't be displayed ever again).

Admin notification
==================

1. Generate an admin notification, e.g. a community owner receiving a request
   notification to join.
2. Verify the unread count is displayed over the bell icon, as well as the AC
   Admin tab.
3. Verify the community unread indicator is correctly displayed.
4. As an admin, open the AC and before accepting/declining the request, check
   that you CAN'T swipe left or right.
5. Accept or decline the membership request.
6. Check the unread indicator disappears accordingly.
7. Swipe left to mark as `Read`.
8. Swipe left to mark as `Unread`.
9. Swipe right to delete the notification (it won't be displayed ever again).

Mentions & replies
==================

Similar steps outlined for `Admin` notifications, but there's one important
difference. Mention and reply notifications don't require a call to action from
the user, so the user can swipe left/right **without** first having to do
anything on the notification (such as pressing on it). See issue
https://github.com/status-im/status-mobile/issues/15118

What about other types of notifications?
========================================

Swipe gestures for other notification types will be implemented in a separate
PR.
2023-02-24 21:22:31 -03:00
Churikova Tetiana 432f7bcd8c
e2e: 1-1 chat, communities 2023-02-24 20:05:30 +01:00
Jakub Sokołowski 26d618e305
ios: use sh in shellPath instead of absolute path
Otherwise Xcode uses system Node.js version which is different from Nix
version and can result in weird failures like:
```
admin@macm1-01.he-eu-fsn1.ci.devel:~/status-mobile % node --version
v16.19.0

admin@macm1-01.he-eu-fsn1.ci.devel:~/status-mobile % node --openssl-legacy-provider
node: bad option: --openssl-legacy-provider

admin@macm1-01.he-eu-fsn1.ci.devel:~/status-mobile % make shell
Configuring Nix shell for target 'default'...

[nix-shell:~/status-mobile]$ node --version
v16.17.1

[nix-shell:~/status-mobile]$ node --openssl-legacy-provider
Welcome to Node.js v16.17.1.
Type ".help" for more information.
>
```

Signed-off-by: Jakub Sokołowski <jakub@status.im>
2023-02-24 13:30:28 +01:00
John Ngei fac2f952d0
Fix: scroll-page component sticky header height 2023-02-23 18:31:21 +03:00
yqrashawn e830f633d8
fix: toast style (#15170) 2023-02-23 20:18:44 +08:00
Michele Balistreri 6a58f9552d
update keycard native module
Signed-off-by: Michele Balistreri <michele@bitgamma.com>
2023-02-23 11:11:20 +01:00
Omar Basem 00db44ab0d
Zoomable Image (#15078)
* feat: zoomable image
2023-02-23 07:46:42 +04:00
Ajay Sivan 6ffed4ad47
quo2 profile-select component
Signed-off-by: Parvesh Monu <parvesh.dhullmonu@gmail.com>
2023-02-23 01:41:56 +05:30
Jakub Sokołowski e2169cbbd4
ios: use --openssl-legacy-provider with iOS builds
Fixes issue with following failure:
```
Failed to construct transformer:  Error: error:0308010C:digital envelope routines::unsupported
    at new Hash (node:internal/crypto/hash:71:19)
    at Object.createHash (node:crypto:130:10)
    at stableHash (/Users/jenkins/workspace/status-mobile/platforms/ios/node_modules/metro-cache/src/stableHash.js:19:8)
    at JsTransformer.getCacheKey (/Users/jenkins/workspace/status-mobile/platforms/ios/node_modules/metro/src/JSTransformer/worker.js:471:7)
    at getTransformCacheKey (/Users/jenkins/workspace/status-mobile/platforms/ios/node_modules/metro/src/DeltaBundler/Transformer/getTransformCacheKey.js:39:29)
    at new Transformer (/Users/jenkins/workspace/status-mobile/platforms/ios/node_modules/metro/src/DeltaBundler/Transformer.js:147:28)
    at /Users/jenkins/workspace/status-mobile/platforms/ios/node_modules/metro/src/Bundler.js:54:29
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (node:internal/process/task_queues:96:5) {
  opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
  library: 'digital envelope routines',
  reason: 'unsupported',
  code: 'ERR_OSSL_EVP_UNSUPPORTED'
```
https://roytuts.com/how-to-fix-err_ossl_evp_unsupported-in-react-js-application/

Signed-off-by: Jakub Sokołowski <jakub@status.im>
2023-02-22 18:48:03 +01:00
Ajay Sivan c8fd7121d3
quo2 password-tips component (#15157) 2023-02-22 14:50:56 +01:00
frank 0c96661583
use random tcp port for listen address for node (#15143) 2023-02-22 21:38:27 +08:00
Ajay Sivan d6c09d289c
quo2 color-picker component (#15105) 2023-02-22 12:05:40 +01:00
Jakub Sokołowski d5cc24fecf
ci: add Xcode cleanup Jenkinsfile
Too often Xcode derived data and archives are clogging up hosts.

Signed-off-by: Jakub Sokołowski <jakub@status.im>
2023-02-22 09:21:59 +01:00
Ajay Sivan 20e16e2f42
fix: Community display image & cover image rendering fixes (#15047) 2023-02-22 07:11:15 +01:00
yqrashawn 3fc4c36ac6
fix: toast style (#15144) 2023-02-22 09:55:21 +08:00
Alexander 1b33aa4988
Outgoing contact requests (#14853)
* First thoughts/ideas

* Showing "Cancel contact request" button

* Fixes

* Restructuring, `retractContactRequest`

* Pending label

* Proper buttons for activity notifications

* New updates

* Returning back `activity-log` `items`

* Last changes in code

* Lint fix

* Lint fix (2)

* Style fixes

* Style fixes

* Code fixes

* Style fixes

* Fixes

1d9d7343...0082f7e9

* Footer update

* Toasts done

* Formatting fix

* Go version update

* Fixes for deletion

* status-go-version.json

* Lint fix

* Fixes

* Lint fix

* status-go version

* status-go version
2023-02-21 22:45:54 +01:00
Alexander 888bf12856
Paste button (#15002)
* Paste button

* Lint fix

* str -> string

* Removing of redundant stuff

* Style fixes

* Style fixes

* Style fixes (android)

* Style fixes (android)

* The last style fix

* Styles

* Lint fix
2023-02-21 13:42:22 +01:00
Andrea Maria Piana c4aef97a6d
[Fixes: #15093] Add support for mention @everyone
This commit adds support for displaying @everyone mention.
2023-02-21 12:19:02 +00:00
yqrashawn 46896ff7f4
ci: add component test (#15071) 2023-02-21 13:42:33 +08:00
Mohamed Javid 8ed64f810f
Introduce marking all notifications as read in Activity Center (#14952)
* [Feature][#14902][#14917] Added marking all notifications as read

* [Fix] Lint Fix
2023-02-20 23:54:17 +05:30
Omar Basem 3fbb7cb0a7
feat: new text message (1) (#15005)
* feat: new text message
2023-02-20 19:14:03 +04:00
Andrea Maria Piana 58013db24c
Add display name/ens to activity center 2023-02-20 10:33:35 +00:00
Andrea Maria Piana 172bf66436
Revert "Prevent #links to work except in community chats and allow redirection from channel to another when clicked (#15069)"
This reverts commit bc5f0ccda6.
2023-02-20 10:10:40 +00:00
Ibrahem Khalil bc5f0ccda6
Prevent #links to work except in community chats and allow redirection from channel to another when clicked (#15069) 2023-02-20 11:47:26 +02:00
Vitaliy Vlasov bea93f4a7a
Fix for empty display-name (#15122) 2023-02-20 10:07:38 +01:00
Parvesh Monu fb155ea4bd
fix new chat selected contact (#15124) 2023-02-20 14:25:06 +05:30
frank 900688dc15
feat: pass node config/kdf to status-go when local pairing (#15072)
4cc53630...8ff91ba0
2023-02-17 21:40:27 +08:00
Jakub Sokołowski 0f8ad69319
Nix/upgrade zprint 1.2.5 (#15113)
* nix: upgrade zprint from 1.2.4 to 1.2.5

To address issue described in:
https://github.com/kkinnear/zprint/issues/273

Signed-off-by: Jakub Sokołowski <jakub@status.im>

* chore: use zprint :multi-lhs-hang

* refactor: re-format clojure using zprint 1.2.5

---------

Signed-off-by: Jakub Sokołowski <jakub@status.im>
Co-authored-by: yqrashawn <namy.19@gmail.com>
2023-02-17 20:10:00 +08:00
Yevheniia Berdnyk ad9b712bff
Fix for connection error 2023-02-17 12:34:21 +01:00
Yevheniia Berdnyk f2277371f0
Updated pytest and pytest-xdist versions 2023-02-17 12:28:43 +01:00
yqrashawn 866ba63ab7
fix: delete message action logic (#14977) 2023-02-17 19:21:19 +08:00
Andrea Maria Piana ee5dcb3683
Fix contact request state 2023-02-17 10:22:17 +00:00
Vitaliy Vlasov 995d120d94
Use display-name in profile view
Signed-off-by: Vitaliy Vlasov <siphiuel@protonmail.com>
2023-02-17 11:33:16 +02:00
Jamie Caprani cbad7f4c87
feat: add drawer buttons to quo2 (#15062)
feat: add drawer buttons to quo2
2023-02-16 06:29:44 -08:00
Mohamed Javid 488db615c0
Get community-id from notification data for mentions and replies (#15100)
* [Chore] Get community-id from notification data

* [Chore] Updated name for community chat
2023-02-16 16:10:23 +05:30
Parvesh Monu 5cea66647e
fix deep links to user profiles don't do anything on tap (#15089) 2023-02-15 23:27:34 +05:30
Andrea Maria Piana ab750c1829
Upgrade status-go to 0.131.4
dea21f44...0b2f0ef2
2023-02-15 12:16:59 +00:00
Siddarth Kumar bbb07ff595
we should explicitly mention testing status-go in our docs (#15091)
* we should explicitly mention testing status-go
2023-02-15 17:06:55 +05:30
Alexander 1753ea0de0
Allow user to add contact by scanning their QR code (with a fake QR code reader) (#15076)
* Allow user to add contact by scanning their QR code

* Newline

* Small fix

* Fix
2023-02-15 10:41:48 +01:00
Ulises Manuel Cárdenas 8ff7a1630c
[#15019] small option card component (#15077)
* Create small-option-card component

* Add preview screen

* Add mock-fn to test helpers

* Add component tests

* Move namespaces

* Change new section name

* Refactor tests

* Change test-ids by accessibility labels
2023-02-14 16:06:13 -06:00
Parvesh Monu 5e87d7eefd
fix new chat button is not visible in small screen devices (#15079) 2023-02-14 16:57:30 +05:30
Jakub Sokołowski cdada3fa23
ci: update ITSEncryptionExportComplianceCode
We were using old ID for the encryption compliance from old Org.
Because of this the iOS release builds failed at TestFlight upload:
```
Error: Asset validation failed Invalid Export Compliance Code.
The export compliance key value [1aa92c4d-6194-4d7d-b70a-16b48256b87e]
in the app's Info.plist doesn’t match the key value of the app’s export
compliance documentation.
To find the correct value, go to My Apps on App Store Connect. (90592)
```
Related:
- https://stackoverflow.com/questions/53326492/
- https://help.apple.com/app-store-connect/#/dev38f592ac9

Signed-off-by: Jakub Sokołowski <jakub@status.im>
2023-02-14 10:33:58 +01:00
Ibrahem Khalil 4020b4fdef
Fix pinned messages (#14787) 2023-02-14 10:50:09 +02:00
Jakub Sokołowski ba89ac3fcf
ci: fix Jenkins lib function for reading version
Otherwise we just get `UNKNOWN` in release filenames.

Depends on: https://github.com/status-im/status-jenkins-lib/pull/56

Signed-off-by: Jakub Sokołowski <jakub@status.im>
2023-02-13 18:05:11 +01:00
John Ngei a5571eae92
Fix: Communities home header flickering when user scrolls (#15060) 2023-02-10 17:06:49 +03:00
Alexander c12cab27f4
The [Cancel] and [Join] buttons are hidden within 'Join Community' overlay (#14971)
* The [Cancel] and [Join] buttons are hidden within 'Join Community' overlay

* Lint

* Fixes

* Lint fix
2023-02-10 13:59:36 +01:00
Siddarth Kumar d1514ec52d
fetch emoji hash for profile (#14987)
* add emoji-hash to app-db post login
2023-02-10 16:32:46 +05:30
Churikova Tetiana c4264462b1
ci/e2e: make copying of nightly artifacts work
Signed-off-by: Jakub Sokołowski <jakub@status.im>
2023-02-09 20:32:18 +01:00
flexsurfer b1d4368154
[#15046] Contacts in contact list are sorted by 3-random name (#15051) 2023-02-09 17:40:59 +01:00
Omar Basem 95380175a6
fix: image actions (#14996)
* fix: image actions and reactions
2023-02-09 07:18:49 +04:00