status-desktop/ui/StatusQ
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
..
doc feat(Communities): changes in import popup for private keys 2023-08-07 15:26:35 +03:00
include/StatusQ StatusQ: ConstantRole - custom SFPM proxy role added (#16405) 2024-09-25 15:13:53 -04:00
sandbox chore(StatusMemberListItem): refactor to use ItemDelegate 2024-09-12 15:04:22 +02:00
sanity_checker fix(StatusQ): StatusQ is QML module (#10207) 2023-04-14 11:18:56 +03:00
scripts fix(StatusQ/Sandbox): move and update build script 2023-02-20 20:36:05 +01:00
src refactor: Remove business logic from WC ui components 2024-10-09 13:32:53 +03:00
tests StatusQ: ConstantRole - custom SFPM proxy role added (#16405) 2024-09-25 15:13:53 -04:00
CHANGELOG.md chore: remove dictionary 2023-06-09 14:50:08 -04:00
CMakeLists.txt StatusQ: ConstantRole - custom SFPM proxy role added (#16405) 2024-09-25 15:13:53 -04:00
README.md fix(StatusQ/Sandbox): move and update build script 2023-02-20 20:36:05 +01:00

README.md

StatusQ

An emerging reusable QML UI component library for Status applications.

Usage

StatusQ introduces a module namespace that semantically groups components so they can be easily imported. These modules are:

Provided components can be viewed and tested in the sandbox application that comes with this repository. Other than that, modules and components can be used as expected.

Example:

import Status.Core 0.1
import Status.Controls 0.1

StatusInput {
  ...
}

Viewing and testing components

To make viewing and testing components easy, we've added a sandbox application to this repository in which StatusQ components are being build. This is the first place where components see the light of the world and can be run in a proper application environment.

Using Qt Creator

The easiest way to run the sandbox application is to simply open the provided CMakeLists.txt file using Qt Creator.

Using command line interface

To run the sandbox from within a command line interface, run the following commands:

$ git clone https://github.com/status-im/StatusQ
$ cd StatusQ
$ git submodule update --init
$ ./scripts/build

Once that is done, the sandbox can be started with the generated executable:

$ ./build/sandbox/Sandbox