Skip to content

Conversation

maznnwell
Copy link
Contributor

With this PR I did some changes on how some cards work. The reasoning was: less code and widgets is better for maintaining the code base, I preferred to use Material components as they should be used, making their behavior predictable and consistent.

What was achieved with this PR, besides refactoring the code:

  • I created only one version of send and receive cards; I considered that the large cards are the only cards that the user actually needs; especially for the send cards
  • I created a separated token dropdown; before it was used as a suffix icon in a text field and for that reason it wasn't aligning properly
  • I enabled the search feature in every dropdown menu
  • I changed how the QR receive code is being generated, and this propose I fixed a bug that was stopping the QR code to be recognized by some iPhone devices
  • I improved the latest and pending transactions tables: before the users had to select a row to be able to copy the content from a cell; I added more according icons and colors to represent the transaction type

I also upgraded Flutter to 3.27.

maznnwell and others added 30 commits October 10, 2024 13:32
@KingGorrin
Copy link
Collaborator

I found an issue with this build in particulairy. The error HiveError: Box has already been closed. appears when you reset an existing wallet and try to create or import a new one.

@KingGorrin
Copy link
Collaborator

@maznnwell after some back and forth discussions with the community, we have come to the following changes:

  1. ZNN must be above QSR and always on top for both the Send and Receive dropdown list.
  2. Only for tokens: place the short ZTS address between parentheses: TOKEN (zts1td...9qrkce)
  3. All tokens use the ZTS color.
  4. Use the following colors for improved contrast and readability.
static const Color znnColor = Color(0xFF4FD166);
static const Color qsrColor = Color(0xFF006AFF);
static const Color ztsColor = Color(0xFFFC54AE);
static const Color errorColor = Color(0xFFF40442);

@maznnwell
Copy link
Contributor Author

I found an issue with this build in particulairy. The error HiveError: Box has already been closed. appears when you reset an existing wallet and try to create or import a new one.

Done.

As well as the UI fixes. I added an icon after the coins, this way the label will be harder to be replicated.

@KingGorrin
Copy link
Collaborator

@maznnwell the receive dropdown list is not populated with a newly created token. Based on the commits, this was fixed, but it doesn’t appear to be working as expected. It’s not a game breaker—let me know if this is easy to fix; otherwise, we can drop it for now.

@KingGorrin
Copy link
Collaborator

I found an issue with this build in particulairy. The error HiveError: Box has already been closed. appears when you reset an existing wallet and try to create or import a new one.

While resetting the wallet and creating or importing a new one seems to work now, navigating to the Transfer tab triggers a PendingTransactionBloc exception: "Bad state: Cannot add new events after calling close.". This error causes a red error page in the widget and seems unrecoverable.

@maznnwell
Copy link
Contributor Author

@maznnwell the receive dropdown list is not populated with a newly created token. Based on the commits, this was fixed, but it doesn’t appear to be working as expected. It’s not a game breaker—let me know if this is easy to fix; otherwise, we can drop it for now.

It seems that a newly registered token only appears in the list after 1-2 momentums. I do refresh the list after sending the block for the new token, but it takes time for the network to be updated. The user can manually refresh the list from the refresh icon inside the 'Receive' card.

I fixed the other issue as well.

@KingGorrin
Copy link
Collaborator

There is an issue when selecting a token which has the same name as one of the coin symbols. For example: QSR or ZNN. When selecting such a token, the coin is selected in the dropdown list.

@KingGorrin
Copy link
Collaborator

For now, we would like to drop the icons, "coin" suffix, and use parentheses for tokens.

This means only tokens have the following suffix: TOKEN (zts1td...9qrkce)

The concept of icons can be revisited and further developed in the future, allowing us to integrate the idea throughout the entire application, rather than limiting it to these two dropdown lists.

@maznnwell
Copy link
Contributor Author

There is an issue when selecting a token which has the same name as one of the coin symbols. For example: QSR or ZNN. When selecting such a token, the coin is selected in the dropdown list.

On production, I can't find any token with the symbol QSR or ZNN. Did you create such tokens on testnet?

@KingGorrin
Copy link
Collaborator

KingGorrin commented Jan 8, 2025

There is an issue when selecting a token which has the same name as one of the coin symbols. For example: QSR or ZNN. When selecting such a token, the coin is selected in the dropdown list.

On production, I can't find any token with the symbol QSR or ZNN. Did you create such tokens on testnet?

Yes, I test on testnet. You can use:
node: wss://syrius-testnet.zenon.community:443
chainId: 3

Nevermind this issue. I cannot seem to reproduce it anymore. Might be because of some changes I made locally.

@maznnwell
Copy link
Contributor Author

For now, we would like to drop the icons, "coin" suffix, and use parentheses for tokens.

This means only tokens have the following suffix: TOKEN (zts1td...9qrkce)

The concept of icons can be revisited and further developed in the future, allowing us to integrate the idea throughout the entire application, rather than limiting it to these two dropdown lists.

Ok. Done.

Copy link
Collaborator

@KingGorrin KingGorrin left a comment

Choose a reason for hiding this comment

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

Well done. Although it probably took longer than expected, we have achieved a good balance between the existing functionalities and the refactored code. The overall consistency has improved through the use of the token symbol. In the future, we can consider further expansions, such as token names, a token selection dialog, and token icons. However, these require a more extensive approach that falls outside the scope of the current revision.

@KingGorrin KingGorrin merged commit ffaa90c into zenon-network:develop Jan 20, 2025
@KingGorrin KingGorrin added the enhancement New feature or request label Jan 20, 2025
@maznnwell maznnwell deleted the rearchitecture-transfer branch January 31, 2025 12:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants