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

Implement asset page #8696

Merged
merged 5 commits into from
Jun 1, 2020
Merged

Implement asset page #8696

merged 5 commits into from
Jun 1, 2020

Conversation

Gudahtt
Copy link
Member

@Gudahtt Gudahtt commented May 29, 2020

A new page has been created for viewing assets. This replaces the old selectedToken state, which previously would augment the home page to show token-specific information.

The new asset page shows the standard token overview as seen previously on the home page, plus a history filtered to show just transactions relevant to that token.

The actions that were available in the old token list menu have been moved to a "Token Options" menu that mirrors the "Account Options" menu.

The selectedTokenAddress state has been removed, as it is no longer being used for anything.

A new Redux store has been added to track state related to browser history. The most recent "overview" page (i.e. the home page or the asset page) is currently being tracked, so that actions taken from the asset page can return the user back to the asset page when the action has finished.

@Gudahtt Gudahtt force-pushed the use-send-token-in-send-flow branch from 2d3f2ea to 091e782 Compare May 29, 2020 03:07
@Gudahtt Gudahtt force-pushed the asset-page branch 3 times, most recently from c814567 to aede31f Compare May 29, 2020 03:37
@Gudahtt
Copy link
Member Author

Gudahtt commented May 29, 2020

This depends upon #8695 #8695 has been merged.

@Gudahtt Gudahtt force-pushed the asset-page branch 3 times, most recently from 64cb6fc to aa4b0c5 Compare May 29, 2020 15:01
Base automatically changed from use-send-token-in-send-flow to develop May 29, 2020 17:46
@Gudahtt Gudahtt force-pushed the asset-page branch 7 times, most recently from 05bfe32 to cc2720c Compare May 29, 2020 23:36
@Gudahtt Gudahtt marked this pull request as ready for review May 29, 2020 23:51
@Gudahtt Gudahtt requested review from kumavis and a team as code owners May 29, 2020 23:51
@metamaskbot
Copy link
Collaborator

Builds ready [cc2720c]
Page Load Metrics (602 ± 29 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint29383331
domContentLoaded3406336016129
load3426356026129
domInteractive3406336006129

@Gudahtt
Copy link
Member Author

Gudahtt commented May 30, 2020

Screenshots: Home (popup):

home-popup

Asset page - Eth (popup):

eth-popup

Asset page - TST token (popup):

tst-popup

Asset page - TST token with menu open (popup):

tst-menu-popup

Home (fullscreen):

home-fullscreen

Asset page - Eth (fullscreen):

eth-fullscreen

Asset page - TST token with menu open (fullscreen):

test-menu-fullscreen

@rekmarks
Copy link
Member

rekmarks commented May 30, 2020

Fantastic!

This will take some time to review of course, but one initial piece of feedback:

Were there any designs for the asset rows being highlighted on hover, with a link/pointer cursor? I imagine we want at least the pointer cursor, but a subtle highlight would be best, IMO.

@Gudahtt
Copy link
Member Author

Gudahtt commented May 30, 2020

Yes, good point! The hover state was in the design and is missing. Cursor pointer seems appropriate as well. I'll add those

@Gudahtt
Copy link
Member Author

Gudahtt commented May 30, 2020

I've updated the asset list items to have a grey background on hover, cursor: pointer, and a border similar to the transaction list items.

These things are still TODO:

  • Add the inline "Send [token]" button on the token list items, but only on large viewports
  • Use the ListItem component for both lists (some minor refactoring is required first here), and update the styles to get more consistent heights, spacing, etc. across both lists
  • Update tab styles to match design more closely
  • Expand the "warning" state to show the entire warning inline on large viewports

None of these seem trivial, nor do they seem like blockers, so I'd prefer to deal with them in a future PR if possible to avoid blocking the RC, and to keep this monstrously sized PR from getting any larger

@metamaskbot
Copy link
Collaborator

Builds ready [7861a2a]
Page Load Metrics (521 ± 58 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint297935105
domContentLoaded32863552012158
load32963652112158
domInteractive32763551912158

@brad-decker
Copy link
Contributor

Q: Should clicking on ETH show only ETH transactions? I know in the previous version of the UI clicking ETH was just like 'unselecting' a token, but with the new UI and the header "Account 1 / ETH" I'm not sure I'd expect token transactions to show up. -- Not at all a blocker for merge just curious.

@Gudahtt
Copy link
Member Author

Gudahtt commented Jun 1, 2020

Q: Should clicking on ETH show only ETH transactions?

Yes, that was the intention for now, since all transactions use Eth for gas. It seemed strange to allow the eth balance to change without showing why it changed in the transaction history.

Maybe we should filter out signature requests in that view though? 🤔 🤷‍♂️ I hadn't thought of that, since they're only shown when pending.

@brad-decker
Copy link
Contributor

Perhaps. Maybe, in a later iteration, we can highlight token transfers on the eth screen in some way that makes it evident that they are token transfers, but that indicates the gas prices paid in eth.

@Gudahtt
Copy link
Member Author

Gudahtt commented Jun 1, 2020

Yeah, perhaps by showing the gas cost instead of the token balance that was transferred. I was just thinking that too. Not sure how to make clear that it's the gas price we're showing though, and not the transfer amount converted to Eth.

brad-decker
brad-decker previously approved these changes Jun 1, 2020
Copy link
Contributor

@brad-decker brad-decker left a comment

Choose a reason for hiding this comment

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

LGTM

Gudahtt added 5 commits June 1, 2020 13:24
A new page has been created for viewing assets. This replaces the old
`selectedToken` state, which previously would augment the home page
to show token-specific information.

The new asset page shows the standard token overview as seen previously
on the home page, plus a history filtered to show just transactions
relevant to that token.

The actions that were available in the old token list menu have been
moved to a "Token Options" menu that mirrors the "Account Options"
menu.

The `selectedTokenAddress` state has been removed, as it is no longer
being used for anything.

`getMetaMetricState` has been renamed to `getBackgroundMetaMetricState`
because its sole purpose is extracting data from the background state
to send metrics from the background. It's not really a selector, but
it was convenient for it to use the same selectors the UI uses to
extract background data, so I left it there for now.
The `history` store tracks state related to browser history. The most
recent "overview" page (i.e. the home page or the asset page) is
currently being tracked, so that actions taken from the asset page can
return the user back to the asset page when the action has finished.
This action also handles clearing other `send` state relating to tokens
when switching back to the native currency.
The asset list items now have borders, a grey background on hover, and
a pointer cursor.
The `.asset__container` element doesn't need to set `overflow-y` or any
scrollbar-related rules because that element doesn't have a defined
`height` or `max-height`; it can grow as long as it wants. There can
be no overflow, and no scrollbar.
Copy link
Contributor

@brad-decker brad-decker left a comment

Choose a reason for hiding this comment

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

LGTM

@rekmarks
Copy link
Member

rekmarks commented Jun 1, 2020

Why do we use the history state/ducks (i.e. mostRecentOverviewPage) instead of history.goBack()?

@Gudahtt
Copy link
Member Author

Gudahtt commented Jun 1, 2020

history.goBack doesn't work because we use the HashRouter, which doesn't keep any history.

Copy link
Member

@rekmarks rekmarks left a comment

Choose a reason for hiding this comment

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

Great work!

@metamaskbot
Copy link
Collaborator

Builds ready [d07d54b]
Page Load Metrics (834 ± 81 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaintNaNNaNNaNNaNNaN
domContentLoaded484130083216881
load486131183416981
domInteractive484130083116881

@brad-decker
Copy link
Contributor

:shipit:

@Gudahtt Gudahtt merged commit df85ab6 into develop Jun 1, 2020
@Gudahtt Gudahtt deleted the asset-page branch June 1, 2020 17:54
Gudahtt added a commit that referenced this pull request Jun 1, 2020
* origin/develop: (689 commits)
  Implement asset page (#8696)
  fix crash on signature request (#8709)
  Fix accounts menu styling (#8707)
  Delete docs/porting_to_new_environment.md (#8704)
  Remove unused `getToErrorObject` parameters (#8705)
  hide connected-status on metamask ext (#8703)
  Stop adding permissions middleware to trusted connections (#8701)
  Use `send` state for send flow token (#8695)
  do not display extension id in connection modal (#8699)
  Fix tab content disappearing during scrolling on macOS Firefox (#8702)
  close details when button is pressed (#8694)
  Refactor token selectors (#8671)
  Update eth_accounts permission description (#8693)
  Extract selected token from token input (#8692)
  Fix propType for Home defaultHomeActiveTabName (#8683)
  Fix create account form styling (#8689)
  Remove unused `getSelectedTokenAssetImage` selector (#8691)
  Remove `getTxParams` (#8676)
  do not show account mismatch alert on details (#8678)
  Fix connect hardware styling (#8680)
  ...
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.

4 participants