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

Redesign Duration display for Dutch auctions with live-updating price visualization. #1092

Merged
merged 17 commits into from
May 13, 2024

Conversation

jessepinho
Copy link
Contributor

@jessepinho jessepinho commented May 10, 2024

Scrub through this video to get a timelapse of part of a 10-minute auction.

Screen.Recording.2024-05-10.at.5.41.55.PM.mov

This is a bit of a frilly PR that I prob shouldn't have spent as much time on as I did... Basically it visualizes to the user what the current price is of the input asset in terms of the output asset, as well as how far along we are in the auction.

Again, this is by no means a finalized design, but it's at least an improvement on what we had before.

In this PR

  • Design a live-updating display for Dutch auctions.
  • Create a new Zustand status slice for storing the sync status (fullSyncHeight and latestKnownBlockHeight) so it can be used both in the header and in places like Dutch auctions.
  • Simplify <Progress /> to only accept a few specific props, rather than the full default set (which we neither need nor want).
  • Add size variants to both <AssetIcon /> and <ValueViewComponent />.

Closes #1088

@jessepinho jessepinho force-pushed the jessepinho/redesign-duration-web-1088 branch from 5b5e865 to 6b6c273 Compare May 10, 2024 00:53
Base automatically changed from jessepinho/web-1081-arrow-auction to main May 10, 2024 17:57
@jessepinho jessepinho force-pushed the jessepinho/redesign-duration-web-1088 branch from 6b6c273 to f481c41 Compare May 10, 2024 17:58
@jessepinho jessepinho force-pushed the jessepinho/redesign-duration-web-1088 branch from f481c41 to 3696baa Compare May 10, 2024 23:44
size='sm'
className='mt-2'
/>
<div className='mt-2'>
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 removed className from <Progress />'s props, so we need to wrap it in a div with a margin-top.

@jessepinho jessepinho changed the title WIP: Redesign Duration display for Dutch auctions Redesign Duration display for Dutch auctions with live-updating price visualization. May 11, 2024
@jessepinho jessepinho marked this pull request as ready for review May 11, 2024 01:30
Copy link
Collaborator

@grod220 grod220 left a comment

Choose a reason for hiding this comment

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

Nice! Looks good.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ah! Another case for #965.

Comment on lines 49 to 50
const p = targetOutputScaled;
const q = inputScaled;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we need these reassigned? Can we just use targetOutputScaled and inputScaled inline below?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah, good catch — this was a leftover from copying core's implementation.

@@ -0,0 +1,16 @@
const clampToDecimal = (value: number) => Math.min(Math.max(value, 0), 1);
Copy link
Collaborator

Choose a reason for hiding this comment

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

What does clamp mean here? Maybe a code comment here? (same in other usage too)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Clamping refers to limiting a value between a given min and max. Will add a comment.

@jessepinho jessepinho merged commit d7a2c04 into main May 13, 2024
6 checks passed
@jessepinho jessepinho deleted the jessepinho/redesign-duration-web-1088 branch May 13, 2024 23:07
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.

Redesign "duration" field in auction view to show a live-updating slider
2 participants