-
Notifications
You must be signed in to change notification settings - Fork 79
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(@desktop/wallet): Adapt Token Selector #16733
base: master
Are you sure you want to change the base?
Conversation
Jenkins BuildsClick to see older builds (14)
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Otherwise LGTM
ui/app/AppLayouts/Wallet/panels/SearchableCollectiblesPanel.qml
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM in general, but there are several details imo worth amending to simplify/sort out things.
@@ -17,6 +17,7 @@ ItemDelegate { | |||
required property string symbol | |||
required property string currencyBalanceAsString | |||
required property string iconSource | |||
required property bool isFirstSearchEntry |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This property seems not necessary as we already have highlighted
property there which could be used to highlight first element if necessary.
Currently we can highlight even 3 items at once, what doesn't seem to be correct:
(first, selected and hovered)
Setting highlighted in
SearchableAssetsPanel` seems to solve it nicely:
highlighted: !!searchBox.text
? (index === 0)
: (model.tokensKey === root.highlightedKey)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@micieslak the thing is that I dont want it to be highlighted but it should be the same as hovered state which is a readonly property. check line 40.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but perhaps the name could be more generic ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But isn't the situation on the screenshot a bit strange?
Maybe if we want to have the first item "hovered" by default, that hover should disappear when we explicitly hover over another item? And go back to first when we are completely outside with the mouse cursor?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
aaah I dont know but I overlooked that issue. Yes you are right, should be hovered by default but then should change if the user manually hovers over anther item.
I can check how to correct this logic and rename this property to something like - automaticHoverOn ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@micieslak updated property name and behaviour now
Screen.Recording.2024-11-22.at.5.39.42.PM.mov
a7ca3e6
to
0b153d8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just some smaller details
ui/app/AppLayouts/Wallet/panels/SearchableCollectiblesPanel.qml
Outdated
Show resolved
Hide resolved
ui/app/AppLayouts/Wallet/views/TokenSelectorCollectibleDelegate.qml
Outdated
Show resolved
Hide resolved
ui/app/AppLayouts/Wallet/views/TokenSelectorCollectibleDelegate.qml
Outdated
Show resolved
Hide resolved
0b153d8
to
f96d34b
Compare
f96d34b
to
ae4b190
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! Thank you for introducing the proposed amendments!
@@ -34,6 +34,11 @@ Control { | |||
tokenSelectorPanel.highlightedKey = key ?? "" | |||
} | |||
|
|||
QObject { | |||
id: d |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we keep empty line after id
onClosed: tokenSelectorPanel.clear() | ||
|
||
contentItem: Item { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not necessary empty line here
@@ -99,6 +110,7 @@ Control { | |||
highlighted: model.tokensKey === root.highlightedKey | |||
enabled: model.tokensKey !== root.nonInteractiveKey | |||
balancesListInteractive: !ListView.view.moving | |||
isAutoHovered: d.validSearchResultExists && index === 0 && !listViewHoverHandler.hovered |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice and clean, here and in TokenSelectorAssetDelegate
:)
@@ -409,6 +409,10 @@ StatusDialog { | |||
sourceComponent: CollectiblesSelectionAdaptor { | |||
accountKey: popup.selectedAccount.address | |||
|
|||
networksModel: SortFilterProxyModel { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ideally we should take just networsModel
as a top-level input param and use it as it is, with no extra shenanigans inside. So not in store, but also not here as it shouldn't be this component responsibility to do that. But ofc we can try to improve it later, as it probably triggers more work.
fixes #16702
What does the PR do
Adapts the TokenSelectors and its components to adapt to new design from Ben here -
https://www.figma.com/design/FkFClTCYKf83RJWoifWgoX/Wallet-v2?node-id=25229-108897&t=Ech2sOd4zCGhGFzC-4
https://www.figma.com/design/FkFClTCYKf83RJWoifWgoX/Wallet-v2?node-id=25232-114042&t=x7Ukt7ixxp7Ji84n-4
Affected areas
TokenSelector
SendModal
Architecture compliance
My PR is consistent with this document: Status Desktop Architecture Guide
Screenshot of functionality (including design for comparison)
Token Selector Button size is not 24 not 21.
https://github.com/user-attachments/assets/6947b3d8-4256-4f4e-83ac-454781c6db41
Searchable Assets and Collectibles now have padding of 4px and spacing of 4x.
On Hover Collectible shows contract network
Only 5.5 items are shown
On search the top item is highlighted and user can press enter to quickly select it.
https://github.com/user-attachments/assets/d06cc015-3c1b-448c-8377-042616db8a62
Empty Collectibles list state