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

feat:(label) Improved address label user experience #1978

Merged
merged 35 commits into from
Dec 16, 2022

Conversation

otkstudio
Copy link
Contributor

@otkstudio otkstudio commented Nov 17, 2022

New label UX for easier labelling and cleaner UX. Targeting this issue #1922

Screen.Recording.2022-11-17.at.2.03.05.PM.mov

@netlify
Copy link

netlify bot commented Nov 17, 2022

Deploy Preview for specter-desktop-docs canceled.

Name Link
🔨 Latest commit b673168
🔍 Latest deploy log https://app.netlify.com/sites/specter-desktop-docs/deploys/639cba0e685cf300092c66c7

@k9ert
Copy link
Collaborator

k9ert commented Nov 21, 2022

Awesome! Looks really good! LGTM!

@moneymanolis
Copy link
Collaborator

moneymanolis commented Nov 23, 2022

We are trying to support Firefox and Chrome/Chromium, so my tests are with both:

Chrome:
Works really well. Just the positioning of the service logos could be improved:
Update: Fixed!
Under addresses:
grafik

Not fixed yet
Under transactions - history:
grafik

Updat: Fixed!
Firefox:
Doesn't really work, no cursor, can't confirm, only cancel, can't input anything:
https://user-images.githubusercontent.com/70536101/203537013-ff484053-a025-4f2a-9bfe-69c6470736fe.mov

Copy link
Collaborator

@moneymanolis moneymanolis left a comment

Choose a reason for hiding this comment

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

Not working on Firefox yet.

@@ -40,6 +40,9 @@
border: 1px solid var(--main-color);
background: var(--cmap-border);
}
tr {
vertical-align: center;
Copy link
Collaborator

@moneymanolis moneymanolis Nov 23, 2022

Choose a reason for hiding this comment

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

Suggested change
vertical-align: center;
vertical-align: middle;

not sure whether it changes anything to have this - in any case center is an invalid property for vertical-align

@moneymanolis
Copy link
Collaborator

I wanted to add proper backend validation / error handling at wallets api endpoint to ensure consistency between front end changes and the backend. Following the code I can see that we use rpc calls (setlabel and listlabels) in addresslist.py which confused me since I thought we didn't use rpc calls in this respect anymore. @stepansnigirev @k9ert - could you help clarify?

.label {
word-break: break-all;
background: none;
color: #fff;
font-size: 1em;
max-width: 80%;
outline: none;
margin-top: 1px;
margin-left: 2px;
white-space: nowrap;
Copy link
Collaborator

Choose a reason for hiding this comment

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

This causes that the addresses here are not fully displayed:

grafik

We could keep the nowrap and just shorten the addresses like we do in the addresses overview:

grafik

@moneymanolis
Copy link
Collaborator

Short video on the changes in d5a0c16 (not seen in the video is that if the label is empty it can still be saved, makes kind of sense since we have logos and perhaps someone just wants to have the logo):
https://user-images.githubusercontent.com/70536101/203639739-36984c83-6a97-460b-b4ce-1ca120217d50.mov

@moneymanolis
Copy link
Collaborator

moneymanolis commented Nov 23, 2022

@otkstdio please have a look at my changes. If okay, could you do the two remaining tasks:

  • Fix address display in transactions - history
  • Fix service logo positioning in transactions - history
    (both issues were "introduced" with this PR)

@moneymanolis
Copy link
Collaborator

@relativisticelectron could you do a quick test?

@otkstudio
Copy link
Contributor Author

@moneymanolis All fixed 👍

@relativisticelectron
Copy link
Collaborator

relativisticelectron commented Nov 25, 2022

I like the "click to edit" UX!

  • For long labels and narrow screen, the other columns are not visible any more.

image

  • clicking into an empty field of the table should end the edit mode

@moneymanolis
Copy link
Collaborator

@otkstdio can you have a look at electron's points?

@otkstudio
Copy link
Contributor Author

Hey @relativisticelectron!

I think we need a solution to the label being too long in another PR (one I'm working on). This is certainly a problem but it needs to be fixed in the context of the table not being able to handle all sized inputs, not just the label. I think we'll need the ability to scroll horizontally in tables with extended data points. Also, what's the use case of having a label of an address the same as the address? I'd hope users wouldn't actually do this as labels are effectively human readable descriptors to reflect the not-so-human-readable address, not the address itself.

When it comes to clicking on other elements, I suspect this would show the user intent of cancelling the editing process and thus not updating the label. Would you agree?

@relativisticelectron
Copy link
Collaborator

On master long labels are wrapped to multiple lines, such that all columns stay visible. I think this is the desirable behavior.

When it comes to clicking on other elements, I suspect this would show the user intent of cancelling the editing process and thus not updating the label. Would you agree?

Yes.

@moneymanolis
Copy link
Collaborator

@otkstdio I'd also say let's keep the wrapping of the addresses for now and change that once you came up with a more general solution that you were mentioning above:

This is certainly a problem but it needs to be fixed in the context of the table not being able to handle all sized inputs, not just the label.

@moneymanolis
Copy link
Collaborator

moneymanolis commented Nov 30, 2022

Some more issues:

  • The border here looks a bit random, should either be unified or dropped:

grafik

  • This PR deletes the copy functionality of an address in the address list via the explorer link. This at first looks like no issue but if you open up tx info for example, there is now no way anymore to copy an address there. Possible solution: we could just add the address here alongside the label wherever needed - perhaps add copy / past functionality, but selection of the address would probably be enough here:

grafik

As for the long label with multisig address, I'd suggest to change the default label of the address by sth. like "External address", see screenshot above? @relativisticelectron what do you think?

  • Add a copy icon similar to the QR code icon when hovering over the address in the address list to "compensate" for the deleted explorer link.

@moneymanolis
Copy link
Collaborator

moneymanolis commented Dec 14, 2022

As for

long labels are not wrapping

I know. @otkstdio will take care of that in his first or second round of CSS revamp.

  • The console message is fine / intended.
  • Thanks for the hint on the click propagation, will do that!

@moneymanolis
Copy link
Collaborator

moneymanolis commented Dec 14, 2022

@relativisticelectron could you please test again?

@relativisticelectron
Copy link
Collaborator

relativisticelectron commented Dec 14, 2022

@relativisticelectron could you please test again?

Sorry, but it still doesn't work. Moving with left-right arrow keys works, but not with the mouse.
Peek 2022-12-14 19-35

@moneymanolis
Copy link
Collaborator

@relativisticelectron but this is intended / normal in the selection all that we use. Please test by removing the whole selection and then type sth. and by using the arrows and add sth. for example.
In particular, does the spacebar work as intended?

@relativisticelectron
Copy link
Collaborator

relativisticelectron commented Dec 15, 2022

@relativisticelectron but this is intended / normal in the selection all that we use.

I expect an editable field to work not only with the keyboard but also with the mouse. The wallet-name edit function works as I would expect an editable field to work:
Peek 2022-12-15 09-28

Please test by removing the whole selection and then type sth. and by using the arrows and add sth. for example. In particular, does the spacebar work as intended?

Yes, spacebar works as intended.

@moneymanolis
Copy link
Collaborator

moneymanolis commented Dec 15, 2022

The relevant lines are (in the edit.onclick() in address-label.html)

    let selection = window.getSelection();
    selection.selectAllChildren(this.label);

The idea behind this is, that you usually want to replace the default label in the addresses (sth. like Address #5) completely and the above lines make this easier. Perhaps we can check whether this is the first click on the label (enabling the editing and thus use select all) and then the next clicks are not selecting all anymore.

UPDATE: Implemented in b4f1abf - @relativisticelectron - perhaps one last check?

@relativisticelectron
Copy link
Collaborator

relativisticelectron commented Dec 15, 2022

  • Peek 2022-12-15 21-05
    It seems clicking on the side of the update button fails to update it. (Center clicking works) The console shows Clicking somewhere else on the screen. Canceling editing.

  • The "Select All" at edit start is nice. Good work

Other points:

Thanks for the hint on the click propagation, will do that!

For long labels and narrow screen, the other columns are not visible any more.

@moneymanolis
Copy link
Collaborator

moneymanolis commented Dec 16, 2022

It seems clicking on the side of the update button fails to update it. (Center clicking works) The console shows Clicking somewhere else on the screen. Canceling editing.

I see, cancelEditing was called first (via the global event listener which ensures the "clicking somewhere else cancels the editing").

From GPT:
"Event listeners are executed in the order in which they are registered. If you register the global event listener first and then the event listener for the update button, the global event listener will be executed first and then the event listener for the update button will be executed."

I am using stopPropagation now on all click event handler in the component so the global one is not even receiving the event and it also makes checking where the click originated from in the global listener obsolete.

@relativisticelectron that should have fixed your last point. Thanks a lot for the rigorous testing!

@moneymanolis
Copy link
Collaborator

@relativisticelectron can I merge?

@moneymanolis
Copy link
Collaborator

I am merging this now and will directly open an issue with @relativisticelectron input to deal better with long labels.

@moneymanolis moneymanolis merged commit ab0245c into master Dec 16, 2022
@k9ert k9ert deleted the improved-address-labels branch February 3, 2023 10:59
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.

Optimise position of Swan logo for withdrawal addresses
4 participants