Commit Graph

715 Commits

Author SHA1 Message Date
Alex Jbanca 106988d534 fix(WC): Refactor dapps service to work with multiple SDKs
This PR is refactoring the dapps service to avoid code duplication between SDKs and also to avoid overlapping requests/responses.
It brings Browser Connect inline with Wallet Connect in terms of session management and sign transactions.

New architecture:

WalletConnectService becomes DAppsService. Its responsibility is to provide dapp access to the app. This is the component currently used by the UI
What does it do:
1. Provide dapp APIs line connect, disconnect, session requests etc
2. Spawn app notifications on dapp events
3. Timeout requests if the dapp does not respons

DAppsRequestHandler becomes DAppsModule. This component is consumed by the DAppService. Its responsibility is to aggregate all the building blocks for the dapps, but does not control any of the dapp features or consume the SDKs requests.
What does it do:
1. Aggregate all the building blocks for dapps (currently known as plugins)

DAppConnectionsPlugin - This component provides the session management features line connect, disconnect and provide a model with the connected dapps.
SignRequestPlugin - This component provides the sign request management. It receives the sign request from the dapp, translates it to what Status understands and manages the lifecycle of the request.
2024-11-20 18:10:29 +02:00
Alex Jbanca 7e1e827148 feat(WC): Enable Wallet Connect feature by default
+ Update the dialog where the user choses the connection to enable or disable the connection option based on flags
+ Separating the walletConnect flag and browserConnect flag usage so that either one can be disabled without affecting the other feature
+ Update qml test
2024-11-20 18:10:29 +02:00
Alex Jbanca cb772dc6b5 feat(WC): Handle unavailable chains or internet connection
This commits implements the `connect` `disconnect` session events for WC and also disables primary buttons for WC whenever there is no connection to internet or chains.

+ update tests
2024-11-20 18:10:29 +02:00
Alex Jbanca 7e1dd3dd55 fix(WC): Update storybook mocked store to respond to sign requests 2024-11-20 18:10:29 +02:00
Lukáš Tinkl 1c255175ab feat(ProfileContextMenu): Add "Mark as Trusted" and "Remove trusted mark"
- enhance and fix the SB page to be able to show all the permutations,
including profile image, emoji hash and ring

Fixes #16586
2024-11-19 15:51:55 +01:00
Alex Jbanca 9352c2ad44 fix: Wrap login error message in login view 2024-11-18 16:49:27 +02:00
Michał Cieślak 32c1d174ad UserListPanel made store-independent, Storybook page fully operable
Closes: #16717
2024-11-13 09:49:07 +01:00
Michał Cieślak 9bf02aa6ac ProfileContextMenu Storybook page made fully functional 2024-11-13 09:49:07 +01:00
Dario Gabriel Lipicar 3e9e8bfe07 chore: remove unused components 2024-11-08 17:09:14 -03:00
Dario Gabriel Lipicar a53eb6001f feat(activity): remove activity details screen 2024-11-08 17:09:14 -03:00
Michał Cieślak ba80ba97f7 compressedPubKey exposed via backend models, usages of Utils.getCompressedPk removed, SB pages simplified 2024-10-31 11:11:30 +01:00
Michał Cieślak 28f6bee90e Utils.getCompressedPk removed from multiple components 2024-10-31 11:11:30 +01:00
Michał Cieślak 0f98244e1f UserListPanel simplified, dependency on utilsStore removed 2024-10-31 11:11:30 +01:00
Michał Cieślak 0db6fe2701 Invite flow: compressedKey added to the model, api simplified 2024-10-31 11:11:30 +01:00
Michał Cieślak 143cf63dc0 Community invite flow: dependency on stores reduced 2024-10-31 11:11:30 +01:00
Michał Cieślak 0c86fbf7b6 Storybook: added ability to mark pages with their status
Closes: #16606
2024-10-30 18:23:11 +01:00
Lukáš Tinkl 0b67555ee1 fix(AddAccount): Derivation path drop down is empty
- use `StatusListView` for the popup/menu contentItem
- add the menu to SB too

Fixes #16635
2024-10-30 11:43:02 +01:00
Jonathan Rainville d511c25d2e
remove old code about ID verification and fix trustStatus bug (#16548)
* chore: remove old code about ID verification

* refactor(trust): remove untrustowrthy and isVerified from items and use trustStatus

* chore(status-go): up status-go to get fix for trustStatus reseting

Fixes #16392

* chore: remove verified/trusted profile showcase category
2024-10-29 14:08:12 -04:00
Sale Djenic f6055946d4 chore: usage of goerli removed 2024-10-29 15:46:09 +01:00
Michał Cieślak dedaaa5a60 Unused StatusEmojiAndColorComboBox removed
Closes: #16558
2024-10-28 23:16:31 +01:00
Michał Cieślak fe249225a2 Storybook pages - multiple fixes regarding stores 2024-10-28 23:16:31 +01:00
Cuteivist c47f42eb39
fix: Show only selected networks (#16588) 2024-10-28 13:10:30 +01:00
Jonathan Rainville f7823cd0b7
refactor(members): unify members models into one (#16508)
Fixes #16433
2024-10-25 21:25:50 -04:00
Dario Gabriel Lipicar f34050a5bc fix(wallet): debounce send modal route requests and assign new uuid on each fetch 2024-10-24 11:26:53 -03:00
Lukáš Tinkl d9d6d90dc9 [Style] remove legacy Style and its themes
- legacy Style and ThemePalette removed
- moved and deduplicated font definitions into `Theme` (unrelated to a
color palette)
- `Style.current.foo` -> `Theme.foo`
- `Style.current.fooColor` -> `Theme.palette.fooColor`
- upgrade the imports to 5.15
- removed some mode dead components

Fixes #16514
2024-10-22 15:54:31 +02:00
Michał Cieślak 02993196e9 References to Global.userProfile removed from multiple components 2024-10-16 23:02:02 +02:00
Lukáš Tinkl b052416666 fix(PasswordView): Password instructions missing max length requirement
- set the pass max length to 100 (via `Constants`, not with a hardcoded
regexp)
- delay the validation until the user hits the limit
- clear the categories (lower/upper/num/sym) info if the password is
cleared too
- update the error messages according to latest Figma designs

Fixes #16239
2024-10-16 22:24:56 +02:00
Michał Cieślak d5a0589591 Remove unused RecipientSelector and related components 2024-10-14 23:28:05 +02:00
Lukáš Tinkl 26dddcaff9 feat(CreateCommunityPopup): validation and ensuring min. 1 tag added
- enable the Next button, and delay the validation after it's been clicked
- visually display required fields also for logo, banner, and tags (min
1 tag is required now)
- when pasting over limit, chop the text to the maximum length, instead
of just leaving the text field empty
- do not let the popup autoclose on clicking outside or pressing Esc
- add a StoryBook page
- minor cleanups and alignments to the latest Figma designs/flows

Fixes #13966
Fixes #16479
Fixes #14902
2024-10-14 11:39:58 +02:00
Khushboo Mehta 3f55e6c9c5 feat(@desktop/wallet): Remove preferred chains from wallet accounts all over the app 2024-10-11 18:48:37 +02:00
Khushboo Mehta 7003ba73e2 feat(@desktop/wallet): Remove network prefixes in saved addresses and ReceiveModal 2024-10-11 18:48:37 +02:00
Khushboo Mehta 16a403e3e5 feat(@desktop/wallet): Remove network prefixes in Profile, Profile showcase and Profile preview 2024-10-11 18:48:37 +02:00
Khushboo Mehta 60fb566580 feat(@desktop/wallet): remove address prefixes from wallet account settings 2024-10-11 18:48:37 +02:00
Michał Cieślak 206bc79ab4 downloadImageByUrl moved to SystemUtils 2024-10-11 12:14:53 +02:00
Michał Cieślak 3f9f175e07 restartApplication() removed from Utils.qml and nim 2024-10-11 12:14:53 +02:00
Michał Cieślak 9f9dcefcf8 chore: using StringUtils.plainText consistently
There were two version of plainText - one exposed from the backend,
another, backend-independent in StringUtils. The latter one is now
used in all cases.
2024-10-11 12:14:53 +02:00
Alex Jbanca fd99b96cb5 feat(WalletConnect): Handle sign request expiration
Implementing the user-story for sign request expiry and add qml tests
+ other minor fixes

## Acceptance Criteria

```
//Always show the expiration
Given the sign/transaction request dialog is shown
When request has an expiration date
Then the user sees a 1 minute countdown in the dialog
```

```
// Show 1 minute timer
Given the sign/transaction request dialog is shown
When the request has 1 minute or less before expiring
Then the user sees a 1 second countdown in the dialog
```

```
Given the sign/transaction dialog is open
When the request expires
Then the Accept button is removed
And the only option for the user is to close the dialog
```

```
Given the sign/transaction request dialog is open
When the request expired
Then the `Sign` and `Reject` buttons are removed
And the `Close` button is visible
```

```
Given the sign/transaction request expired
Then a toast message is showing
And it contains the "<dapp domain> sign request timed out" message
```

```
Given the sign/transaction request dialog is open
When the request expired
Then the sign/transaction request dialog is still visible
```

```
Given the sign/transaction request expires
Then a console message is shown
And it contains 'WC WalletConnectSDK.onSessionRequestExpire; id: ${id}`'
```
2024-10-10 12:49:15 +03:00
Lukáš Tinkl bf666c20f5 fix(chat): chat input accepts DnD for blocked users
- do not allow DND when the StatusChatInput is disabled
- remove `Global.dragArea` variable from the Global singleton
- move the `DropAreaPanel` into `StatusChatInput` and handle its
enabling from there

Fixes #16451
2024-10-10 10:33:13 +03:00
Alex Jbanca 7603f24372 refactor: Remove business logic from WC ui components
This commit brings a separation of concerns for the UI components involved in dApp interactions.

Issue: The UI components depend on the WalletConnectService and also on its dependencies like DAppsRequestHAndler. As a result the UI components have a hard dependency on the WalletConnect specifics and are incompatible with BC. This results in duplication of logic.
Issue: The UI components operate on WalletConnect specific JSON object. E.g. session objects, session proposal etc. As a result the UI is built around the WalletConnect message format.
Issue: The UI components operate on ListModel items received through functions and stored internally. Any change in the model would result in a crash.
Solution: Remove the WalletConnectService dependency from DAppsWorkflow. The DAppsWorkflow now operates with models, signals and functions. This is the first step in the broader refactoring. Moving the logic into the service itself will allow us to further refactor the WC and BC.

How does it work now:

Dependencies - The UI components have a dependency on models. SessionRequestsModel and DAppsModel.
Pairing - The pairing is initiated in the UI. On user input a pairingValidationRequested signal is emitted and the result is received as a function pairingValidated. If the url is valid the UI requests a pairingRequested. When the WalletConnectService is refactored we can go further and request only pairingRequested and to receive a pairingResult call as a function with the result. In the current implementation on pairingRequested we'll receive a connectDApp request.
Connecting dApps - The flow is initiated with connectDApp function. This call currently contains all the needed info as args. In the next step it could be replaced with a ConnectionRequests model. The connectDApp call triggered a connection popup if we're not currently showing one to the user. If we're currently showing one it will be queued (corner case). The connection can be accepted with connectionAccepted and rejected with connectionDeclined. Once the connection is accepted we're expecting a result connectionSuccessful or connectionFailed. The connectionSuccessful also expects a new id for the established connection.
Signing - The signing flow orbits around the SessionRequestsModel. Each item from the model will generate a popup showing the sign details to the user. Sign can be accepted or rejected using signRequestAccepted or signRequestRejected. No response is currently expected. The model is expected to remove the sign request item.
2024-10-09 13:32:53 +03:00
Lukáš Tinkl 235162dc01 fix(community): Token gating info when permission not met and set to private
- hide the permission from the `PermissionsRow` when it's set to private
and the conditions are not met
- display a tooltip "(Not) eligible to join" over the lock icon
- show the same info in both community portal and profile dialog's
community showcase tab
- speedup searching/filtering in the community portal
- fixup and extend the SB pages to demonstrate the new behavior

Fixes #14747
2024-10-07 12:09:23 +02:00
Michał Cieślak 152fac2e3c chore: adjust storybook pages to address changes in stores 2024-10-03 20:08:32 +02:00
Michał Cieślak dd871c7e34 Storybook: LazyStackLayoutPage added 2024-10-03 20:08:32 +02:00
Lukáš Tinkl 2c46764829 fix(MembersTabPanel): Buttons in the Member tab do not work
- move the MouseArea into `background` so that it doesn't obscure the
potential action buttons
- fixup SB page

Fixes #16426
2024-10-03 14:34:12 +02:00
Lukáš Tinkl e3512938f6 fix(MessageContextMenuView): Message context menu displaying incorrectly
- restore previous context menu item spacing (ColumnLayout has an
implicit spacing of 5)
- don't wrap the MessageReactionsRow into an extra Item container; fixes
the emoji reactions row being garbled
- enhance the SB page so that the above can be seen/tested there and
rename it to match the component name
- some smaller cleanups

Fixes #16409
2024-10-02 15:58:59 +02:00
Jonathan Rainville 252061d8e8
feat(sync): add a fallback mechanism when the pairing does't work (#15820)
Fixes #15750

When the pairing fails, the UI now let's the user use the seed phrase instead.
When they do, a call is send to the original device and both instances will show an AC notif.
When the original device accepts the pairing, the call is made to pair and sync the devices and the AC notifs get deleted
2024-10-02 09:54:35 -04:00
Michał Cieślak 9acf8d8709 stores: remove isWalletEnabled from shared/RootStore
Closes: #16254
2024-10-02 13:38:22 +02:00
Michał Cieślak 502c8df411 shared/RootStore: make the SB stub empty
Closes: #16252
2024-10-02 00:08:20 +02:00
Michał Cieślak 47f75c1ae2 TransactionDetailView: RootStore and CurrenciesStore decoupled 2024-10-02 00:08:20 +02:00
Michał Cieślak 0686552bc3 TransactionDetailView: refactored to take root store as a dependency 2024-10-02 00:08:20 +02:00
Michał Cieślak c3a234908d CurrenciesStore: static model removed from store 2024-10-02 00:08:20 +02:00