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: ActionView component #2055

Merged
merged 8 commits into from
Feb 17, 2025
Merged

Conversation

VanishMax
Copy link
Contributor

@VanishMax VanishMax commented Feb 14, 2025

Relates to #2053

This PR implements 3 action views: Spend, Output, and Swap. The rest actions are mocked and simply display 'Unimplemented'.

Check the component live here (change the 'action' parameter from the table): https://penumbra-ui-preview--pr2055-feat-2053-action-vi-9770fr20.web.app/?path=/docs/ui-library-actionview--docs

@VanishMax VanishMax requested review from hdevalence and a team February 14, 2025 12:53
@VanishMax VanishMax self-assigned this Feb 14, 2025
Copy link
Contributor

github-actions bot commented Feb 14, 2025

Visit the preview URL for this PR (updated for commit 57d6e25):

https://penumbra-ui-preview--pr2055-feat-2053-action-vi-9770fr20.web.app

(expires Mon, 24 Feb 2025 07:49:31 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.

nice work! I really like the wrapper abstraction here for switching between opaque and visible views


return (
<ActionWrapper title='Output' opaque={value.outputView.case === 'opaque'}>
{value.outputView.case === 'visible' && (
Copy link
Contributor

@TalDerei TalDerei Feb 14, 2025

Choose a reason for hiding this comment

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

ACK – conditional visibility rendering

<ActionWrapperHeader {...props} />
</div>

{infoRows}
Copy link
Contributor

Choose a reason for hiding this comment

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

question: wondering if there's anything in this ActionWrapper component or prop that might trigger unnecessary re-renders?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

i'm a little worried about useDensity calls – there are just too many of them within the ActionView and its subcomponents. I'd like to test its performance later and maybe try to import this component dynamically in the DEX

spend: SpendAction,
output: OutputAction,
swap: SwapAction,
// TODO: Implement the actions below
Copy link
Contributor

@TalDerei TalDerei Feb 14, 2025

Choose a reason for hiding this comment

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

comment: reference https://github.com/penumbra-zone/web/blob/main/docs/adrs/003-action-views.md for details on which fields are marked as opaque or visible if you need more context.

@VanishMax VanishMax linked an issue Feb 17, 2025 that may be closed by this pull request
26 tasks
@VanishMax VanishMax merged commit 07aa2fe into main Feb 17, 2025
8 checks passed
@VanishMax VanishMax deleted the feat/#2053-action-view branch February 17, 2025 07:55
@VanishMax VanishMax mentioned this pull request Feb 19, 2025
26 tasks
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.

UI v2: ActionView component
2 participants