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

unopened isolated positions pt1 #191

Merged
merged 16 commits into from
Jun 17, 2024
Merged

Conversation

mike-dydx
Copy link
Contributor

@mike-dydx mike-dydx commented Jun 13, 2024

Links (dYdX Internal Use Only)

Figma Design: https://www.figma.com/design/mKevZOfE9nj6MZpiolKYW1/dYdX-%E2%80%BA-Mobile?node-id=5962-23534&t=amLuAKC8dnKISGXT-4


Description / Intuition

part 2 will be the cancel behavior and the market info appearance (see comment)

  • wires up pendingPositions to display in Overview and Positions lists
  • refactors positions to not be a PlatformListView since there are two items list
  • renames ParsingError computed property to localizedMessage to avoid confusion with system localizedDescription API
  • adds local validation to match web since it is not in abacus yet
  • removes "Max" button

Before/After Screenshots or Videos

Before After
ensuring feature flag still works
ensuring feature flag still works
display unopened isolated positions in positions
display unopened isolated positions in overview

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Refactoring or Technical Debt
  • Documentation update
  • Other (please describe: )

@mike-dydx mike-dydx force-pushed the mike/unopened-isolated-positions branch from 523354c to 7c859d8 Compare June 13, 2024 20:04
@mike-dydx mike-dydx force-pushed the mike/unopened-isolated-positions branch from 7c859d8 to 7a3bf31 Compare June 13, 2024 20:22
@mike-dydx mike-dydx requested a review from ruixhuang June 13, 2024 20:28
Comment on lines -228 to -235
private func updateButtonState(input: AdjustIsolatedMarginInput) {
if parser.asNumber(input.amount)?.doubleValue ?? 0 > 0 {
self.ctaButtonPresenter.viewModel?.ctaButtonState = .enabled()
} else {
self.ctaButtonPresenter.viewModel?.ctaButtonState = .disabled()
}
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

this was moved to validate fxn

Comment on lines -83 to -85
viewModel.amount?.maxAction = {
AbacusStateManager.shared.adjustIsolatedMargin(input: "1", type: .amountpercent)
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

per corey's guidance, removing max button


return VStack(spacing: 0) {
self.topContent
self.divider
Copy link
Contributor

Choose a reason for hiding this comment

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

Doesn't seem like the divider is visible from the screenshot

Copy link
Contributor Author

Choose a reason for hiding this comment

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

addressed in de39f47
Screenshot 2024-06-17 at 1 56 50 PM

ruixhuang
ruixhuang previously approved these changes Jun 14, 2024
private var bottomContent: some View {
let viewOrdersStringKey: String
let viewOrdersStringParams: [String: String]?
if orderCount > 1 {
Copy link
Contributor

Choose a reason for hiding this comment

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

orderCount == 1

@mike-dydx mike-dydx enabled auto-merge (squash) June 17, 2024 17:59
@mike-dydx mike-dydx requested a review from ruixhuang June 17, 2024 18:18
@mike-dydx mike-dydx merged commit a66f9cc into develop Jun 17, 2024
2 checks passed
@mike-dydx mike-dydx deleted the mike/unopened-isolated-positions branch June 17, 2024 23:52
mike-dydx added a commit that referenced this pull request Aug 20, 2024
* hide/show target leverage for margin mode selection

* fix adjust margin % horizontal sizings

* remove unused files

* dismiss on success, update button state on submission

* multi-line receipt line item title

* use localized error

* stubbed unopened isolated positions UI

* wire up abacus data for unopened positions

* put back fixed size, clean up

* hide keyboard when margin direction changes

* remove max action

* add local validation

* update button state after validation

* remove alternate validation

* clean up

* ui tweaks
mike-dydx added a commit that referenced this pull request Aug 21, 2024
* hide/show target leverage for margin mode selection

* fix adjust margin % horizontal sizings

* remove unused files

* dismiss on success, update button state on submission

* multi-line receipt line item title

* use localized error

* stubbed unopened isolated positions UI

* wire up abacus data for unopened positions

* put back fixed size, clean up

* hide keyboard when margin direction changes

* remove max action

* add local validation

* update button state after validation

* remove alternate validation

* clean up

* ui tweaks
mike-dydx added a commit that referenced this pull request Aug 21, 2024
* hide/show target leverage for margin mode selection

* fix adjust margin % horizontal sizings

* remove unused files

* dismiss on success, update button state on submission

* multi-line receipt line item title

* use localized error

* stubbed unopened isolated positions UI

* wire up abacus data for unopened positions

* put back fixed size, clean up

* hide keyboard when margin direction changes

* remove max action

* add local validation

* update button state after validation

* remove alternate validation

* clean up

* ui tweaks
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