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

[BUG#2882] Improved wallet asset selection #2973

Merged
merged 1 commit into from
Jan 10, 2018
Merged

[BUG#2882] Improved wallet asset selection #2973

merged 1 commit into from
Jan 10, 2018

Conversation

jeluard
Copy link
Contributor

@jeluard jeluard commented Jan 9, 2018

relates #2882

EDIT: Addresses #2974 bug and #2975

Summary:

Steps to test:

  • Open Status
  • Navigate wallet tab
  • Asset selection should open a new screen with a list of relevant tokens (both for send and request)

status: ready

[status-im.ui.components.icons.vector-icons :as vector-icons]
[status-im.ui.components.list.views :as list]
[status-im.ui.components.toolbar.view :as toolbar]
[status-im.ui.components.styles :as components.styles]
Copy link
Contributor

Choose a reason for hiding this comment

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

Seems like already required at line 6

Copy link
Contributor Author

Choose a reason for hiding this comment

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

👍

Copy link
Contributor

@oskarth oskarth left a comment

Choose a reason for hiding this comment

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

I'm not super comfortable with this big a change to cherry-pick in release, but according to Julien this is all necessary to fix #2974 and some button alignment. Let's please test this extra carefully as it's a big change code-wise, IMO.

@@ -36,18 +36,6 @@
str)
"...")))

(reg-sub :portfolio-change
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you explain why this is no longer needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Portfolio changes are not displayed anymore, this was a leftover.

@@ -214,14 +217,7 @@
:on-focus (fn [] (when @scroll (js/setTimeout #(.scrollToEnd @scroll) 100)))
:on-change-text #(re-frame/dispatch [:wallet.send/set-and-validate-amount %])}}
(when modal?
Copy link
Contributor

Choose a reason for hiding this comment

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

What happens if it isn't modal? Why not disabled true for both?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

GH diff makes it difficult to read because 2 views have been swapped. It's actually the same thing but couple lines above.

:value (name (or symbol :ETH))}]]]]]
:on-change-text #(re-frame/dispatch [:wallet.request/set-and-validate-amount %])}}]]
[react/view wallet.styles/choose-asset-container
[components/choose-asset {:type :request
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is :on-change #(re-frame/dispatch [:wallet.request/set-symbol (keyword %)]) no longer necessary?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's done when you select an element from the asset list now.

@@ -16,8 +16,10 @@
db)

(defmethod navigation/preload-data! :wallet-request-transaction
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you explain this change? Why navigate back db and why different dissoc/wallet form?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Always dissoc was a bug preventing to select an asset in request screen.
The key change reflect a update to the app-db to align with new semantic (and reflect what is done in send screen).

[react/text {:style styles/label}
(i18n/label :t/wallet-asset)]
[react/touchable-highlight {:style styles/asset-container
:on-press #(re-frame/dispatch [:navigate-to (type->view type)])}
Copy link
Contributor

@oskarth oskarth Jan 9, 2018

Choose a reason for hiding this comment

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

What can type be here?
EDIT: See above, so if unknown type then we throw error, OK


(defn- render-token [{:keys [symbol name icon decimals]} balance type]
[list/touchable-item #(do (re-frame/dispatch [(type->handler type) symbol])
(re-frame/dispatch [:navigate-back]))
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't like this double dispatch very much - instead of double dispatch + special preload logic for :navigate-back (hard to track, on 2 places), we should create one atomic handler for that kind of preset/navigation.

Copy link
Contributor

Choose a reason for hiding this comment

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

Make a todo and an tech-debt issue that links to it @jeluard let's not delay this merge too much

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 agree but didn't want to make too big changes. This mimic what is done for the send screen which share most of the logic.


(defn- render-token [{:keys [symbol name icon decimals]} balance type]
[list/touchable-item #(do (re-frame/dispatch [(type->handler type) symbol])
(re-frame/dispatch [:navigate-back]))
Copy link
Contributor

Choose a reason for hiding this comment

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

Make a todo and an tech-debt issue that links to it @jeluard let's not delay this merge too much

@oskarth
Copy link
Contributor

oskarth commented Jan 9, 2018

Moving to TO TEST to speed up verification. Can still concurrently review to look for potential bugs.

@dmitryn
Copy link
Contributor

dmitryn commented Jan 9, 2018

@jeluard I'd move screen a lit bit down, too close to the top right now, at least in iOS simulator

screenshot 2018-01-09 19 17 53

@oskarth
Copy link
Contributor

oskarth commented Jan 9, 2018

@dmitryn @jeluard Agree, looks like 16 vs 8 or 32 vs 16 top padding.

@jeluard
Copy link
Contributor Author

jeluard commented Jan 9, 2018

@dmitryn Do you mind checking now?

@dmitryn
Copy link
Contributor

dmitryn commented Jan 9, 2018

@jeluard looks good

@oskarth
Copy link
Contributor

oskarth commented Jan 9, 2018

Thanks for checking screen on device @dmitryn :)

@asemiankevich asemiankevich self-assigned this Jan 10, 2018
@asemiankevich
Copy link
Contributor

ARTIFACT iOS: https://i.diawi.com/hRGwUd
ARTIFACT Android: https://i.diawi.com/ZPhxxr

@asemiankevich
Copy link
Contributor

The fix is totally a new feature implemented. I am checking against the invision and here are the remarks:

  1. No Done button
  2. No question icon
  3. No bottom line
  4. Too many space for Gas limit and Gas price, Amount and Fee
  5. No ~ sign
  6. Cross should be back button instead
  7. Transaction Fee header should be centered

image

@jeluard
Copy link
Contributor Author

jeluard commented Jan 10, 2018

@asemiankevich Those changes are not related to the Transaction fee screen

@asemiankevich
Copy link
Contributor

i will log it separately @jeluard 👍

@asemiankevich
Copy link
Contributor

asemiankevich commented Jan 10, 2018

Branch: PR-2973
Android: https://i.diawi.com/fJT8RV
iOS: https://i.diawi.com/znjNAZ

null is not an object error shown when sending 0 ETH request from Wallet
image

TF https://app.testfairy.com/projects/4803622-status/builds/7469607/sessions/1/?accessToken=L2mud/NkboZgJdXjOB6XHNgc63U

@asemiankevich
Copy link
Contributor

Branch: PR-2973
Android: https://i.diawi.com/RWtJqy
iOS: https://i.diawi.com/3rjNEY

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

Successfully merging this pull request may close these issues.

7 participants