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(uirefresh): component refresh - trade box [2/2] #1214

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

moo-onthelawn
Copy link
Contributor

@moo-onthelawn moo-onthelawn commented Oct 24, 2024

Figma

  1. [Flagged] Updates margin selector
  2. [Flagged] Moves target leverage selector to be a leverage slider very similar to leverage in cross margin orders
  3. Fixes invalid dom nesting issue in HorizontalPanel's CollapsibleTabs (due to rendering a Button in slotTrigger of TradeTableSettings)

To follow up on:

  • Add a tooltip to "Margin Mode" - still waiting for copy
Flag Off Flag On
Web - toggleable Screenshot 2024-10-24 at 1 09 03 PM Screenshot 2024-10-24 at 1 04 36 PM
Web - untoggleable Screenshot 2024-10-24 at 1 08 38 PM Screenshot 2024-10-24 at 1 04 06 PM
Mobile - toggleable Screenshot 2024-10-24 at 1 09 15 PM Screenshot 2024-10-24 at 12 56 01 PM
Mobile - untoggleable Screenshot 2024-10-24 at 1 09 23 PM Screenshot 2024-10-24 at 12 56 13 PM

Views

  • <TargetLeverageButton>

    • Small cleanup to use more specific target leverage selector
  • <TradeSizeInputs>

    • [Flagged] Conditionally render TargetLeverageInput component when necessary
  • New: <TargetLeverageInput>

    • Basically copied over the code from AdjustTargetLeverageForm. Did not bother refactoring to share this component since that component can be deprecated when uiRefresh is launched
    • Slightly updated to add debouncing logic
  • <MarginAndLeverageButtons>

    • [Flagged] Update to not render TargetLeverageButton when flag on
  • <MarginModeSelector>

    • [Flagged] Updated rendering when uiRefresh enabled
  • <TradeBoxOrderView>

    • [Flagged] styling
  • <TradeTableSettings>

    • Reorder Isolated / Cross to match with toggle order in trade box
    • Fix DOM nesting error

Components

  • <ToggleGroup>
    • Add some styling for disabled cursors

Functions/Clients

  • lib/abacus/index.ts
    • Clear targetLeverage when necessary since it's now a user input on the trade form

Copy link

vercel bot commented Oct 24, 2024

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

Name Status Preview Comments Updated (UTC)
v4-staging ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 24, 2024 5:31pm
v4-testnet ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 24, 2024 5:31pm

Copy link

linear bot commented Oct 24, 2024

@@ -69,7 +71,7 @@ export const ToggleGroup = forwardRefFn(
<$ToggleButton
size={size ?? (isTablet ? ButtonSize.Small : ButtonSize.XSmall)}
shape={shape}
disabled={item.disabled}
disabled={item.disabled ?? disabled}
Copy link
Contributor

Choose a reason for hiding this comment

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

shouldn't this be || ?

@@ -199,6 +200,10 @@ class AbacusStateManager {
this.setTradeValue({ value: null, field: TradeInputField.leverage });
}

if (uiRefresh && needsTargetLeverage) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why not just clear them all the time? I worry about edge cases where target leverage is entered but then needsTargetLeverage becomes false before this clear function is called and we just leave it there forever.

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

Successfully merging this pull request may close these issues.

2 participants