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(ui): #2053: implement SwapClaim action view #2061

Merged
merged 4 commits into from
Feb 21, 2025

Conversation

VanishMax
Copy link
Contributor

@VanishMax VanishMax commented Feb 18, 2025

Relates to #2053

Implements SwapClaim action view. The old version didn't display the opaque view, this one does.

Live: https://penumbra-ui-preview--pr2061-feat-2053-action-vi-khqajj28.web.app/?path=/docs/ui-library-actionview--docs

Before

Visible Opaque
image image

Now

Visible Opaque
image image

@VanishMax VanishMax requested a review from a team February 18, 2025 14:00
@VanishMax VanishMax self-assigned this Feb 18, 2025
Copy link
Contributor

github-actions bot commented Feb 18, 2025

Visit the preview URL for this PR (updated for commit 59a15d9):

https://penumbra-ui-preview--pr2061-feat-2053-action-vi-khqajj28.web.app

(expires Wed, 26 Feb 2025 15:22:35 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: 709d729610ef7a6369b23f1cb2b820a60cc685b1

Copy link
Contributor

@TalDerei TalDerei left a comment

Choose a reason for hiding this comment

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

requested some changes – the data we current display in our deprecated UI library for visible and opaque swap claims is correct, and the new actions should be modeled accordingly, rather than following the figma design. In this instance, we should only perform a cosmetic change rather than any kind of data modeling for swap claims.

Comment on lines +178 to +184
outputData: {
tradingPair: {
asset1: USDC_METADATA.penumbraAssetId,
asset2: PENUMBRA_METADATA.penumbraAssetId,
},
lambda1: AMOUNT_123_456_789,
lambda2: AMOUNT_999,
Copy link
Contributor

@TalDerei TalDerei Feb 18, 2025

Choose a reason for hiding this comment

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

comment: privacy leak here I think? referencing the fourth bullet point in #889, we should only display the swap claim fee for SwapClaim actions in opaque views. We can also extend this to display in the visible view for consistency, since the swap claim already links to the associated swap in the user's visible view — see the attached example


Screen.Recording.2025-02-18.at.9.02.53.AM.mov

Copy link
Contributor Author

@VanishMax VanishMax Feb 18, 2025

Choose a reason for hiding this comment

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

@TalDerei thanks for the reference to another issue – i understand the context now.

Question: how not displaying the input/output amounts would leak the information having that this data is still in the protobuf message?

Copy link
Contributor Author

@VanishMax VanishMax Feb 18, 2025

Choose a reason for hiding this comment

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

I guess I don't fully understand the idea after re-reading the comment for a 10th time. When talking about cosmetic changes, do you mean we shouldn't display the input/output amounts, or is it only about the fees?

Copy link
Contributor

@TalDerei TalDerei Feb 18, 2025

Choose a reason for hiding this comment

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

In this context, cosmetic changes mean that we should display the same data as the current deprecated UI, with only styling, typography, etc. updated according to the figma design. Like the data modeling shouldn't change, for instance we shouldn't be adding new opaque (public view) fields that weren't there before.

to clarify, the opaque swap claim view should display only the swap claim fee and I don't think we should display the input / output amounts.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, but what's the reason for this?

Like the data modeling shouldn't change, for instance we shouldn't be adding new opaque (public view) fields that weren't there before.

I'm only changing the rendering without touching the fields. If data exists, why can't we display it?

Copy link
Contributor

@TalDerei TalDerei Feb 19, 2025

Choose a reason for hiding this comment

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

well okay, the BSOD is part of the opaque swap claim view, however I initally thought displaying that information might be confusing as apposed to just the claimed amount since we also already link to the swap. It's not actually a privacy leak because I had forgotten the BSOD field was part of the swap claim body.

Copy link
Member

Choose a reason for hiding this comment

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

Yeah there's no privacy issue in the UI here — if the data is there, better to display it (as long as that makes sense in the context of the designs)

<>
{!!fee && <ActionRow label='Swap Claim Fee' info={fee} />}
{!!txId && (
<ActionRow label='Swap Claim Transaction' info={shorten(txId, 8)} copyText={txId} />
Copy link
Contributor

@TalDerei TalDerei Feb 18, 2025

Choose a reason for hiding this comment

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

comment: this should link to the associated swap (rather than swap claim) transaction.

the visible (your view) swap claim views should display the relevant swap transaction, swap claim fee (I like this verbage better than "prepaid claim fee"), and optionally the claimed amount.

Screenshot 2025-02-18 at 9 13 57 AM

and the opaque swap claim view should display only the swap claim fee.

Screenshot 2025-02-18 at 9 16 53 AM

@VanishMax
Copy link
Contributor Author

@TalDerei Updated the PR, seems to be correct now

@VanishMax VanishMax requested a review from TalDerei February 19, 2025 09:40
@VanishMax VanishMax mentioned this pull request Feb 19, 2025
26 tasks
@TalDerei TalDerei closed this Feb 19, 2025
@TalDerei TalDerei reopened this Feb 19, 2025
@TalDerei
Copy link
Contributor

TalDerei commented Feb 19, 2025

@TalDerei Updated the PR, seems to be correct now

@erwanor @hdevalence can you sanity check #2061 (comment)?

@TalDerei TalDerei requested a review from erwanor February 19, 2025 15:22
@VanishMax VanishMax merged commit d0cc2ee into main Feb 21, 2025
15 checks passed
@VanishMax VanishMax deleted the feat/#2053-action-views-2 branch February 21, 2025 06:18
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