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
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
ce0d1cf
feat:(label) improved address label ux
otkstudio Nov 17, 2022
33ecc24
Merge branch 'master' into improved-address-labels
moneymanolis Nov 23, 2022
cd0eb5f
service icon alignment
moneymanolis Nov 23, 2022
c74e155
Merge branch 'improved-address-labels' of github.com:cryptoadvance/sp…
moneymanolis Nov 23, 2022
2b77b1e
Merge branch 'master' into improved-address-labels
moneymanolis Nov 23, 2022
d5a0c16
make it work on firefox
moneymanolis Nov 23, 2022
4488033
Merge branch 'improved-address-labels' of github.com:cryptoadvance/sp…
moneymanolis Nov 23, 2022
05171c4
fix:(label) fix spacing of the service logo on tx table
otkstudio Nov 24, 2022
4649727
fix:(label) fix sizing of service icon within label
otkstudio Nov 24, 2022
6cd2f2e
fix:(label) fix table not scaling to label width
otkstudio Nov 24, 2022
c323949
Merge branch 'master' into improved-address-labels
moneymanolis Nov 30, 2022
e689e8c
add / change titles
moneymanolis Dec 1, 2022
3b60fe7
draft - copy button in address list
moneymanolis Dec 1, 2022
03f32b0
Merge branch 'master' into improved-address-labels
moneymanolis Dec 2, 2022
428dbab
Merge branch 'master' into improved-address-labels
moneymanolis Dec 11, 2022
96b9b7b
Merge branch 'improved-address-labels' of github.com:cryptoadvance/sp…
moneymanolis Dec 11, 2022
91c903a
click away from edit section cancels editing
moneymanolis Dec 11, 2022
eb5f68f
check whether addressesTableComponent is available
moneymanolis Dec 12, 2022
9204952
solution for spacebar bug in firefox
moneymanolis Dec 12, 2022
7f36482
address data and tx table listeneres
moneymanolis Dec 13, 2022
5eaae52
make pressing ENTER work
moneymanolis Dec 13, 2022
1ff8fb3
Merge branch 'master' into improved-address-labels
moneymanolis Dec 13, 2022
27d44e3
add address to tx info
moneymanolis Dec 13, 2022
8dc794c
typo
moneymanolis Dec 14, 2022
fbd7d95
firefox fixes
moneymanolis Dec 14, 2022
1607e03
prevent bubbling
moneymanolis Dec 14, 2022
0f48852
check whether there is an address-label for txlist
moneymanolis Dec 14, 2022
b4f1abf
select all only at edit start
moneymanolis Dec 15, 2022
809cec7
revert copy address button
moneymanolis Dec 15, 2022
d6e08db
add editable attribute
moneymanolis Dec 15, 2022
acb4829
disable editing for receive page
moneymanolis Dec 15, 2022
fd0eb4d
change cursor to default in non-editable mode
moneymanolis Dec 15, 2022
eb61708
disable bubbling for update & cancel btns
moneymanolis Dec 16, 2022
ce20e87
no need to check for specific event targets anymore
moneymanolis Dec 16, 2022
b673168
Merge branch 'master' into improved-address-labels
moneymanolis Dec 16, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions pyinstaller/electron/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -665,9 +665,6 @@ tbody tr:hover{
.xpub{
max-width: 300px;
}
.tx{
max-width: 200px;
}
.scroll{
padding: 0 10px;
}
Expand Down Expand Up @@ -1118,4 +1115,4 @@ input:checked + .slider:before {
-webkit-transform: translateX(-50%) translateY(-50%);
transform: translateX(-50%) translateY(-50%);
text-align: center;
}
}
38 changes: 38 additions & 0 deletions src/cryptoadvance/specter/static/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,44 @@ document.addEventListener("updateAddressLabel", function (e) {
}
});

// Clicking somewhere else than on the edit label section cancels the label editing
document.addEventListener("click", (e) => {
addressesTableComponent = document.querySelector('addresses-table')
txTableComponent = document.querySelector('tx-table')
addressDataComponent = document.querySelector('address-data')
const path = e.composedPath()
const clickedElement = path[0]
const parentElement = path[1]
if (addressesTableComponent) {
addressesTableComponent.shadowRoot.querySelectorAll('address-row').forEach(addressRow => {
const addressLabel = addressRow.shadowRoot.querySelector('address-label')
if (addressLabel.isEditing) {
console.log("Clicking somewhere else on the screen. Canceling editing.")
addressLabel.cancelEditing()
}
})
}
else if (txTableComponent) {
txTableComponent.shadowRoot.querySelectorAll('tx-row').forEach(txRow => {
const addressLabel = txRow.shadowRoot.querySelector('address-label')
// In the tx labeling there also "labels" ("X Recipients") which aren't label components
if (addressLabel !== null && addressLabel.isEditing) {
console.log("Clicking somewhere else on the screen. Canceling editing.")
addressLabel.cancelEditing()
}
})
}
// Can't use else if here: Address data is a pop-up so addresses or tx table are still in the DOM
if (addressDataComponent) {
addressDataComponent.shadowRoot.querySelectorAll('address-label').forEach(addressLabel => {
if (addressLabel.isEditing) {
console.log("Clicking somewhere else on the screen. Canceling editing.")
addressLabel.cancelEditing()
}
})
}
})

document.documentElement.style.setProperty('--mobileDistanceElementBottomHeight', `${Math.max(0, window.outerHeight - window.innerHeight)}px`);

function showError(msg, timeout=0) {
Expand Down
61 changes: 61 additions & 0 deletions src/cryptoadvance/specter/static/img/copy-color.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/cryptoadvance/specter/static/img/tag.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 1 addition & 5 deletions src/cryptoadvance/specter/static/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -739,7 +739,6 @@ table{
}
td, th{
padding: 20px 10px;
border-bottom: 1px solid var(--cmap-bg-lightest);
}
tr, thead{
background: var(--cmap-bg-lighter);
Expand All @@ -752,9 +751,6 @@ th{
.xpub{
max-width: 300px;
}
.tx{
max-width: 200px;
}

/* Scroll functionality along x axis
(mainly used for xpub keys)
Expand Down Expand Up @@ -1346,4 +1342,4 @@ input:checked + .slider:before {
}
.last-digits-in-sats-amount{
color: #797979;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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

}
</style>
<div class="address-data">
<h1>{{ _("Address details") }}</h1><br>
Expand Down
Loading