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

Move asset list to home tab on small screens #8264

Merged
merged 1 commit into from
Apr 1, 2020
Merged

Move asset list to home tab on small screens #8264

merged 1 commit into from
Apr 1, 2020

Conversation

Gudahtt
Copy link
Member

@Gudahtt Gudahtt commented Mar 31, 2020

Two tabs have been created on the home screen: 'Assets' and 'History'. This tabbed view is shown only on small screens (e.g. in the popup). The fullscreen view is unchanged.

The toggle-able left sidebar no longer exists, so some 'sidebar-left' specific code and styles have been removed. The button in the menu bar has been removed as well.

The 'History' title of the transaction history is now redundant when where are no pending transactions, so it as been conditionally hidden.

A passthrough for data-testid has been added to the Tab component for convenience in e2e tests.

@metamaskbot
Copy link
Collaborator

Builds ready [7a0a279]
Page Load Metrics (719 ± 40 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeNotificationfirstPaint379148126
domContentLoaded6179667188340
load6199687198340
domInteractive6179667178340

@Gudahtt
Copy link
Member Author

Gudahtt commented Mar 31, 2020

Screenshots: Here is the new popup UI with tabs:

home-tabs

Here's what it looks like when scrolled down somewhat:

home-tabs-scrolled

Here's what the it looks like at its widest point (beyond which it goes to the fullscreen UI):

wide-home-tabs

@Gudahtt Gudahtt marked this pull request as ready for review March 31, 2020 21:58
Two tabs have been created on the home screen: 'Assets' and 'History'.
This tabbed view is shown only on small screens (e.g. in the popup).
The fullscreen view is unchanged.

The toggle-able left sidebar no longer exists, so some 'sidebar-left'
specific code and styles have been removed. The button in the menu bar
has been removed as well.

The 'History' title of the transaction history is now redundant when
where are no pending transactions, so it as been conditionally hidden.

A passthrough for `data-testid` has been added to the Tab component for
convenience in e2e tests.
@metamaskbot
Copy link
Collaborator

Builds ready [cb61392]
Page Load Metrics (679 ± 34 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeNotificationfirstPaint36119512211
domContentLoaded4268046777034
load4278076797034
domInteractive4268046777034

@Gudahtt
Copy link
Member Author

Gudahtt commented Apr 1, 2020

When you click on a token, it no longer brings you to the transaction history for that token like it used to. I opened #8266 in preparation for updating the Home component to automatically switch to the History tab when a token was selected, but after using it locally I'm not sure I like the idea 🤔. Either way the interaction is not great, but the automatic tab switching does feel a little more weird.

Copy link
Contributor

@danjm danjm left a comment

Choose a reason for hiding this comment

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

Reviewed every file, everything looks good. My comments are just what I wrote on the important files after reading them and understanding them. No action is needed.

@@ -104,7 +89,6 @@ export default class AssetList extends Component {
name: 'Clicked Token',
},
})
selectedTokenAddress !== tokenAddress && sidebarOpen && hideSidebar()
}}
/>
{this.renderAddToken()}
Copy link
Contributor

Choose a reason for hiding this comment

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

okay, these file changes just remove the triggering of sidebar hiding from the asset list component. Looks good, makes sense, and explains the below change to the container

sidebarOpen ? hideSidebar() : showSidebar()
}}
/>
</Tooltip>
<SelectedAccount />

<Tooltip
Copy link
Contributor

Choose a reason for hiding this comment

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

removes the button for opening the sidebar in popup view. looks good, makes sense

@@ -35,8 +33,6 @@ export default class Sidebar extends Component {
const { type, sidebarProps = {} } = this.props
const { transaction = {} } = sidebarProps
switch (type) {
case WALLET_VIEW_SIDEBAR:
return <WalletView responsiveDisplayClassname="sidebar-right" />
case 'customize-gas':
Copy link
Contributor

Choose a reason for hiding this comment

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

no need for the sidebar component to know about the wallet view if we are no longer showing it in sidebar. Looks good, makes sense

{ t('history') }
</div>
{
pendingLength > 0 && (
Copy link
Contributor

Choose a reason for hiding this comment

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

Okay, so the history title is only needed when the "History" tab needs to be divided into pending and history. Makes sense

history.push(CONNECTED_ROUTE)
if (sidebarOpen) {
hideSidebar()
}
}

Copy link
Contributor

Choose a reason for hiding this comment

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

wallet view no longer interacts with a sidebar, doesn't need to know about it 👌, this implies below container changes

@@ -250,7 +237,6 @@ export default class Routes extends Component {
transitionName={sidebarTransitionName}
type={sidebarType}
sidebarProps={sidebar.props}
onOverlayClose={sidebarOnOverlayClose}
/>
<NetworkDropdown
provider={provider}
Copy link
Contributor

Choose a reason for hiding this comment

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

👌

@@ -24,6 +32,7 @@ const Tab = (props) => {

Tab.propTypes = {
className: PropTypes.string,
'data-testid': PropTypes.string,
isActive: PropTypes.bool, // required, but added using React.cloneElement
name: PropTypes.string.isRequired,
onClick: PropTypes.func,
Copy link
Contributor

Choose a reason for hiding this comment

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

👌

<TransactionList />
</div>
</>
)
)
Copy link
Contributor

Choose a reason for hiding this comment

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

refactor isWideViewport logic and add new tabs to home screen, 👌

@Gudahtt
Copy link
Member Author

Gudahtt commented Apr 1, 2020

I'm not happy with the UX of this new home page - it's ambiguous whether this is a step forward or not. But it's a step toward designs that are better at least, so I'll merge this for now and we can improve it later.

@Gudahtt Gudahtt merged commit cb0ab90 into develop Apr 1, 2020
@danjm danjm mentioned this pull request Apr 1, 2020
18 tasks
Gudahtt added a commit that referenced this pull request Apr 1, 2020
The `History` title above the transaction history was changed in #8264
to only show when there are pending transactions, because it was
redundant to show an additional `History` title below a tab called
`History`. It was preserved when there were pending transactions
because the pending transactions are shown first in the list, followed
by the history, so the title served to divide the two lists.

This ended up breaking the fullscreen view though, which doesn't use
tabs yet. It has been updated to always show on fullscreen.
Gudahtt added a commit that referenced this pull request Apr 1, 2020
The `History` title above the transaction history was changed in #8264
to only show when there are pending transactions, because it was
redundant to show an additional `History` title below a tab called
`History`. It was preserved when there were pending transactions
because the pending transactions are shown first in the list, followed
by the history, so the title served to divide the two lists.

This ended up breaking the fullscreen view though, which doesn't use
tabs yet. It has been updated to always show on fullscreen.
@Gudahtt Gudahtt deleted the home-tabs branch April 8, 2020 15:05
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.

3 participants