Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: hints in modals for Beacon and WC #2338

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

feat: hints in modals for Beacon and WC #2338

wants to merge 1 commit into from

Conversation

dianasavvatina
Copy link
Contributor

@dianasavvatina dianasavvatina commented Jan 24, 2025

Proposed changes

Umami modals for both Beacon and WalletConnect should be more helpful.
A user can easily make a mistake or hesitate confirming a transaction without understanding of the consequences of the operation.

Task: UMA-1034

Types of changes

  • Bugfix
  • New feature
  • Refactor
  • Breaking change
  • UI fix

Steps to reproduce

  1. Connect https://taquito-test-dapp.pages.dev/
  2. run operations:
  • delegate
  • undelegate
  • stake
  • unstake
  • finalize
  1. see the hint and the details description

Other operations are covered in #2340

Screenshots

Add the screenshots of how the app used to look like and how it looks now

Operation Before Now
DelegationRequest image image
accordion opened image
Undelegation Request image image
accordion opened image
Stake image image
accordion opened image
Unstake image image
accordion opened image
Finalize Unstake Request image image
accordion opened image

Checklist

  • Tests that prove my fix is effective or that my feature works have been added
  • Documentation has been added (if appropriate)
  • Screenshots are added (if any UI changes have been made)
  • All TODOs have a corresponding task created (and the link is attached to it)

Copy link

vercel bot commented Jan 24, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
umami-embed-iframe ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 29, 2025 11:09am
umami-embed-iframe-ghostnet ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 29, 2025 11:09am
umami-v2-web ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 29, 2025 11:09am
umami-v2-web-storybook ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 29, 2025 11:09am

@germanD
Copy link

germanD commented Jan 24, 2025

@dianasavvatina made a first pass with several nits/suggestions. Will make another after these are addressed.

Also, opened #2339 which would complement this (great) effort to improve UX!

Copy link

@germanD germanD left a comment

Choose a reason for hiding this comment

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

Made some suggestions.

@dianasavvatina I asked the L1 team to answer some of the doubts regarding unstaked tez. That should help clarify the information for tooltips, and will take that into account for a second round!

This is much welcome UX progress 🚀

export const Hints: Record<SignPage, HintData> = {
TezSignPage: {
header:
"A confirmation takes 1 block (10 seconds). The transaction becomes final and irreversible after 2 blocks (20 seconds).",
Copy link

Choose a reason for hiding this comment

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

Suggested change
"A confirmation takes 1 block (10 seconds). The transaction becomes final and irreversible after 2 blocks (20 seconds).",
"A confirmation takes 1 block (8 seconds). The transaction becomes final and irreversible after 2 blocks (16 seconds).",

header:
"A confirmation takes 1 block (10 seconds). The transaction becomes final and irreversible after 2 blocks (20 seconds).",
description:
"A confirmation means that the block is confirmed by the network but the operation can still be canceled in the unlikely case of a crypto attack. Finality means that the operation is irreversible.",
Copy link

Choose a reason for hiding this comment

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

Suggested change
"A confirmation means that the block is confirmed by the network but the operation can still be canceled in the unlikely case of a crypto attack. Finality means that the operation is irreversible.",
"A confirmation means that the block is confirmed by the network but the operation can still be cancelled due to chain reorganizations. Finality means that the operation is irreversible.",

Attack is incorrect here. With Tenderbake, you can have a alternative heads scenario, where a block payload proposal generated on (levl n, round k+1) is not confirmed and the chosen chain is a block on (level n+1, usually round 0) which is a succesor of (level n, round k (or earlier)).

This might just happen out of slow consensus/ degraded health / network congestion scenarios -- which they don't necessarily entail an attack.

Comment on lines 27 to 30
"A confirmation takes 1 block (10 seconds). The transaction becomes final and irreversible after 2 blocks (20 seconds).",
description:
"A confirmation means that the block is confirmed by the network but the operation can still be canceled in the unlikely case of a crypto attack. Finality means that the operation is irreversible.",
},
Copy link

Choose a reason for hiding this comment

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

Same remarks above

DelegationSignPage: {
header: "It takes 4 cycles (~6 days) to start receiving delegation rewards.",
description:
"Delegation rewards are distributed every 2 cycles (~3 days). Ensure that the delegation fee offered by the baker is less than 100%; otherwise, you will not receive rewards. Delegation means that all your funds are delegated to one baker. The funds are still spendable, and you can cancel or change the delegation at any time.",
Copy link

Choose a reason for hiding this comment

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

Suggested change
"Delegation rewards are distributed every 2 cycles (~3 days). Ensure that the delegation fee offered by the baker is less than 100%; otherwise, you will not receive rewards. Delegation means that all your funds are delegated to one baker. The funds are still spendable, and you can cancel or change the delegation at any time.",
"Bakers usually distribute delegation rewards every cycle (~2.8 days). Ensure that the delegation fee offered by the baker is less than 100%; otherwise, you might not receive rewards. Delegation means that all your funds are delegated to one baker. The funds are still spendable, and you can cancel or change the delegation at any time.",

Delegation rewards are allocated to the baker during the cycle, they usually pay them a number of cycles in delay. This is not mandated by the protocol. Bakers might pool rewards and pay them each k cycles, for instance

},
UndelegationSignPage: {
header:
"Immediately stops delegation and initiates unstaking. Restoring delegation rewards takes 4 cycles (~6 days). Unstaking takes 4 cycles (~10 days).",
Copy link

Choose a reason for hiding this comment

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

Suggested change
"Immediately stops delegation and initiates unstaking. Restoring delegation rewards takes 4 cycles (~6 days). Unstaking takes 4 cycles (~10 days).",
"Immediately stops delegation and initiates unstaking. Restoring delegation rewards takes 4 cycles (~10 days). After 4 cycles (~10 days), unstaked tez can be finalized and made avaialable",

I need to confirm the math for the unstakes and delegation.

Also notice that in the case of a change of baker, any current liquid balance will be delegated to the new baker, but unstaked tez will keep being delegated to the old one. This is a bit of a corner case where funds end. delegated to two bakers on an overlap of a few cycles . Which is a headache. And not something you want to add to hint :)

Copy link
Contributor Author

@dianasavvatina dianasavvatina Jan 24, 2025

Choose a reason for hiding this comment

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

we can create a web page (maybe it already exists) and link it from the hint. Then we can explain all in details including corner cases

Comment on lines 44 to 47
"A confirmation takes 1 block (10 seconds). The transaction becomes final and irreversible after 2 blocks (20 seconds).",
description:
"A confirmation means that the block is confirmed by the network but the operation can still be canceled in the unlikely case of a crypto attack. Finality means that the operation is irreversible.",
},
Copy link

Choose a reason for hiding this comment

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

Same remarks above

},
StakeSignPage: {
header:
"Your balance will be reduced by the staked amount. You will start receiving rewards within 1 cycle (~3 days) max.",
Copy link

Choose a reason for hiding this comment

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

Suggested change
"Your balance will be reduced by the staked amount. You will start receiving rewards within 1 cycle (~3 days) max.",
"Your available balance will be reduced by the amount staked. You will start accruing staking rewards within 1 cycle (~3 days) max. Note that staking rewards are compounded on your staked balance",

header:
"Your balance will be reduced by the staked amount. You will start receiving rewards within 1 cycle (~3 days) max.",
description:
"By staking, your balance will be automatically reduced by the staked amount. Rewards are calculated and sent to your balance automatically every time your delegated baker produces a new block and at the end of each cycle (~3 days). If you decide to cancel staking, it will take approximately 4 cycles (~10 days) to unlock your funds and return them to your balance.",
Copy link

Choose a reason for hiding this comment

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

Suggested change
"By staking, your balance will be automatically reduced by the staked amount. Rewards are calculated and sent to your balance automatically every time your delegated baker produces a new block and at the end of each cycle (~3 days). If you decide to cancel staking, it will take approximately 4 cycles (~10 days) to unlock your funds and return them to your balance.",
"By staking, the chosen amount will automatically deducted from your available balance. Rewards are allocated to your staked balance automatically every time your chosen baker produces a new block and at the end of each cycle (~3 days). If you decide to cancel staking, it will take approximately 4 cycles (~10 days) to unlock your funds before you can make them available.",

Comment on lines 60 to 63
header: "Finalizing unstake takes 1 block (10 seconds).",
description:
"Finalizing unstake is a process that takes 1 block (10 seconds) to complete. After finalizing unstake, your funds will be returned to your balance. You can then stake them again or spend them.",
},
Copy link

Choose a reason for hiding this comment

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

This should match above!

Comment on lines 55 to 57
header: "Unstaking takes 4 cycles (~10 days) to complete.",
description:
"Unstaking is a process that takes approximately 4 cycles (~10 days) to complete. During this time, your funds are locked, and you will not receive rewards. After the unstaking process is complete, you need to finalize unstaking, after which your funds will be returned to your balance.",
Copy link

Choose a reason for hiding this comment

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

Suggested change
header: "Unstaking takes 4 cycles (~10 days) to complete.",
description:
"Unstaking is a process that takes approximately 4 cycles (~10 days) to complete. During this time, your funds are locked, and you will not receive rewards. After the unstaking process is complete, you need to finalize unstaking, after which your funds will be returned to your balance.",
header: "Unstaking takes 4 cycles (~10 days) to complete.",
description:
"Unstaking is a process that takes at least 4 cycles (~10 days) to complete. During this time, your funds are locked, and you will not receive staking rewards. After 4 cycles, you need to finalize unstaked tez in order to make these funds available.",

Copy link
Collaborator

Choose a reason for hiding this comment

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

This file should be part of packages, as the contents (hints) will be common among web/desktop and other platforms.

@dianasavvatina
Copy link
Contributor Author

Updated based on this example:

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants