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

Allow user to watch a chosen account [UI] #17781

Merged
merged 1 commit into from
Nov 7, 2023

Conversation

tumanov-alex
Copy link
Contributor

@tumanov-alex tumanov-alex commented Oct 31, 2023

implements #17490

Design link

(don't mind broken color picker, it's outside of this pr's scope)

Summary

It's a follow up on this: #17479

I added a "continue" button for the "add address to watch" screen and added another screen where you can edit accounts name, emoji & color.

Steps to test

  • Open Status
  • go to new wallet
  • add account
  • choose "add address to watch"
  • enter eth adress or ens name
  • go to the next screen

{:flex-direction :row
:justify-content :space-around
:padding-vertical 12
:padding-horizontal 20})
Copy link
Contributor

Choose a reason for hiding this comment

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

hmm will this not break other uses of this component? 🤔 The issue might be on the page itself actually.
I would recommend using the regular button instead on that page instead as I think it's also fine to do. This bottom_actions is mostly for drawers as the ns suggests 👌

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@@ -0,0 +1,59 @@
(ns status-im.ui.screens.wallet.address-add-edit.views
Copy link
Contributor

Choose a reason for hiding this comment

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

hmm, this looks wrong. Why are we adding code into status-im ns? that is legacy code 👍
All new code should be in status-im2 unless absolutely necessary

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@status-im-auto
Copy link
Member

status-im-auto commented Oct 31, 2023

Jenkins Builds

Click to see older builds (80)
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ a98f76c #1 2023-10-31 15:54:47 ~8 min android-e2e 🤖apk 📲
a98f76c #1 2023-10-31 15:55:54 ~9 min tests 📄log
✔️ a98f76c #1 2023-10-31 15:59:55 ~13 min android 🤖apk 📲
✔️ a98f76c #1 2023-10-31 16:01:31 ~14 min ios 📱ipa 📲
5e15d0a #2 2023-10-31 16:28:05 ~3 min tests 📄log
✔️ 5e15d0a #2 2023-10-31 16:31:00 ~6 min android-e2e 🤖apk 📲
✔️ 5e15d0a #2 2023-10-31 16:31:24 ~6 min android 🤖apk 📲
✔️ 5e15d0a #2 2023-10-31 16:42:59 ~18 min ios 📱ipa 📲
a6ce48a #4 2023-10-31 17:16:12 ~2 min tests 📄log
✔️ a6ce48a #4 2023-10-31 17:19:05 ~5 min android-e2e 🤖apk 📲
✔️ a6ce48a #4 2023-10-31 17:19:14 ~5 min ios 📱ipa 📲
✔️ a6ce48a #4 2023-10-31 17:19:41 ~6 min android 🤖apk 📲
d9065e3 #5 2023-10-31 17:48:39 ~3 min tests 📄log
✔️ d9065e3 #5 2023-10-31 17:51:38 ~6 min android-e2e 🤖apk 📲
✔️ d9065e3 #5 2023-10-31 17:51:45 ~6 min android 🤖apk 📲
f0695f4 #6 2023-10-31 17:55:23 ~3 min tests 📄log
✔️ f0695f4 #6 2023-10-31 17:58:46 ~6 min android-e2e 🤖apk 📲
✔️ f0695f4 #6 2023-10-31 17:58:54 ~6 min android 🤖apk 📲
9728eb3 #7 2023-10-31 18:03:55 ~2 min tests 📄log
✔️ 9728eb3 #7 2023-10-31 18:07:32 ~6 min android-e2e 🤖apk 📲
✔️ 9728eb3 #7 2023-10-31 18:07:33 ~6 min android 🤖apk 📲
e7c2f19 #8 2023-10-31 18:15:25 ~2 min tests 📄log
✔️ e7c2f19 #8 2023-10-31 18:18:54 ~6 min android-e2e 🤖apk 📲
✔️ e7c2f19 #8 2023-10-31 18:19:02 ~6 min android 🤖apk 📲
b32b551 #9 2023-10-31 18:26:29 ~2 min tests 📄log
✔️ b32b551 #9 2023-10-31 18:30:09 ~6 min android-e2e 🤖apk 📲
✔️ b32b551 #9 2023-10-31 18:30:13 ~6 min android 🤖apk 📲
✔️ b32b551 #9 2023-10-31 18:41:01 ~17 min ios 📱ipa 📲
91a8c2f #10 2023-10-31 18:53:09 ~3 min tests 📄log
✔️ 91a8c2f #10 2023-10-31 18:56:31 ~6 min android-e2e 🤖apk 📲
✔️ 91a8c2f #10 2023-10-31 18:56:40 ~6 min android 🤖apk 📲
c08b989 #12 2023-10-31 19:02:45 ~2 min tests 📄log
✔️ c08b989 #12 2023-10-31 19:05:45 ~5 min android-e2e 🤖apk 📲
✔️ c08b989 #12 2023-10-31 19:06:03 ~5 min android 🤖apk 📲
✔️ c08b989 #12 2023-10-31 19:17:53 ~17 min ios 📱ipa 📲
✔️ f69c5aa #13 2023-11-01 16:58:46 ~7 min android-e2e 🤖apk 📲
✔️ f69c5aa #13 2023-11-01 16:58:53 ~7 min android 🤖apk 📲
✔️ f69c5aa #13 2023-11-01 17:04:24 ~12 min ios 📱ipa 📲
f69c5aa #13 2023-11-01 17:07:14 ~15 min tests 📄log
a802c1f #14 2023-11-01 19:13:20 ~2 min tests 📄log
ab09974 #16 2023-11-01 19:18:39 ~3 min tests 📄log
✔️ ab09974 #16 2023-11-01 19:21:20 ~6 min android-e2e 🤖apk 📲
✔️ ab09974 #16 2023-11-01 19:21:29 ~6 min android 🤖apk 📲
✔️ ab09974 #16 2023-11-01 19:30:33 ~15 min ios 📱ipa 📲
ab09974 #17 2023-11-01 19:58:58 ~2 min tests 📄log
c172656 #18 2023-11-02 13:48:33 ~2 min tests 📄log
✔️ c172656 #17 2023-11-02 13:51:40 ~5 min android-e2e 🤖apk 📲
✔️ c172656 #17 2023-11-02 13:51:53 ~6 min android 🤖apk 📲
✔️ c172656 #17 2023-11-02 14:11:05 ~25 min ios 📱ipa 📲
4e92f3e #19 2023-11-02 16:44:57 ~2 min tests 📄log
✔️ 4e92f3e #18 2023-11-02 16:47:49 ~5 min android 🤖apk 📲
✔️ 4e92f3e #18 2023-11-02 16:47:59 ~5 min android-e2e 🤖apk 📲
✔️ 4e92f3e #18 2023-11-02 17:03:11 ~20 min ios 📱ipa 📲
280adae #21 2023-11-02 18:31:46 ~2 min tests 📄log
✔️ 280adae #20 2023-11-02 18:35:06 ~5 min android 🤖apk 📲
✔️ 280adae #20 2023-11-02 18:42:38 ~13 min ios 📱ipa 📲
f862966 #22 2023-11-02 18:50:41 ~2 min tests 📄log
✔️ f862966 #21 2023-11-02 18:53:31 ~5 min android-e2e 🤖apk 📲
✔️ f862966 #21 2023-11-02 18:54:58 ~7 min android 🤖apk 📲
✔️ f862966 #21 2023-11-02 19:01:36 ~13 min ios 📱ipa 📲
5435a30 #23 2023-11-03 08:25:09 ~3 min tests 📄log
✔️ 5435a30 #22 2023-11-03 08:28:27 ~6 min android-e2e 🤖apk 📲
✔️ 5435a30 #22 2023-11-03 08:28:45 ~6 min android 🤖apk 📲
✔️ 5435a30 #22 2023-11-03 08:33:41 ~11 min ios 📱ipa 📲
6bf5687 #24 2023-11-03 13:52:11 ~2 min tests 📄log
✔️ 6bf5687 #23 2023-11-03 13:55:57 ~6 min android-e2e 🤖apk 📲
✔️ 6bf5687 #23 2023-11-03 13:55:59 ~6 min android 🤖apk 📲
✔️ 6bf5687 #23 2023-11-03 13:59:50 ~10 min ios 📱ipa 📲
ada5d36 #25 2023-11-03 14:52:03 ~2 min tests 📄log
✔️ ada5d36 #24 2023-11-03 14:56:10 ~6 min android-e2e 🤖apk 📲
✔️ ada5d36 #24 2023-11-03 14:57:50 ~8 min android 🤖apk 📲
✔️ ada5d36 #24 2023-11-03 14:59:48 ~10 min ios 📱ipa 📲
6ff09d1 #26 2023-11-06 15:13:51 ~2 min tests 📄log
✔️ 6ff09d1 #25 2023-11-06 15:16:59 ~5 min android 🤖apk 📲
✔️ 6ff09d1 #25 2023-11-06 15:17:16 ~5 min ios 📱ipa 📲
✔️ 6ff09d1 #25 2023-11-06 15:17:20 ~5 min android-e2e 🤖apk 📲
✔️ 9ac8d4f #26 2023-11-07 14:45:17 ~5 min ios 📱ipa 📲
✔️ 9ac8d4f #26 2023-11-07 14:48:58 ~9 min android-e2e 🤖apk 📲
✔️ 9ac8d4f #26 2023-11-07 14:53:38 ~13 min android 🤖apk 📲
✔️ 9ac8d4f #27 2023-11-07 14:53:52 ~13 min tests 📄log
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ 72ee746 #27 2023-11-07 15:29:59 ~5 min ios 📱ipa 📲
✔️ 72ee746 #27 2023-11-07 15:30:55 ~6 min android-e2e 🤖apk 📲
✔️ 72ee746 #27 2023-11-07 15:32:02 ~7 min android 🤖apk 📲
✔️ 72ee746 #28 2023-11-07 15:37:56 ~13 min tests 📄log
✔️ 2585a13 #29 2023-11-07 16:21:46 ~5 min ios 📱ipa 📲
✔️ 2585a13 #29 2023-11-07 16:22:41 ~6 min android-e2e 🤖apk 📲
✔️ 2585a13 #29 2023-11-07 16:22:53 ~6 min android 🤖apk 📲
✔️ 2585a13 #30 2023-11-07 16:26:56 ~10 min tests 📄log

@@ -1,6 +1,7 @@
(ns status-im2.contexts.wallet.address-watch.view
Copy link
Contributor

Choose a reason for hiding this comment

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

perhaps the ns status-im2.contexts.wallet.select-address-to-watch.view is clearer here and then
the following page can be
status-im2.contexts.wallet.add-watch-only-account.view

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@@ -13,6 +13,8 @@
[utils.i18n :as i18n]
[utils.re-frame :as rf]))

(declare account-cards)
Copy link
Contributor

Choose a reason for hiding this comment

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

why do we need this? 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it's a hack to fix cross-reference issue: new-account points to account-cards before the declaration of the latter — so i'm declaring it beforehand

Copy link
Contributor

Choose a reason for hiding this comment

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

ok got it, we can clean this up in a follow up. perhaps it's better to add that to the temp file so it's easier to find this afterwards 👍

Copy link
Contributor

Choose a reason for hiding this comment

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

btw this is probably as a re-frame sub in the actual view.
similar to how it's done in create account ->
src/status_im2/contexts/wallet/create_account/view.cljs

Screenshot 2023-10-31 at 16 45 01

I'd say go with the approach in create account page and once we have some watch only accounts added we can update the sub to filter for watch only accounts 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@J-Son89
Copy link
Contributor

J-Son89 commented Oct 31, 2023

please revert the icon you added, we already have this. 👍 it seems where you added it is in a legacy folder.
we have icons in "resources/images/icons2..."

@J-Son89
Copy link
Contributor

J-Son89 commented Oct 31, 2023

UI looks good! nice work :)

@@ -0,0 +1,14 @@
(ns status-im.ui.screens.wallet.address-add-edit.utils)

(defn random-emoji
Copy link
Contributor

Choose a reason for hiding this comment

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

is this needed?? 🤔 This is to get the initial random emoji right?
Perhaps you can align with @smohamedjavid on how to select it from the set he added in his emoji picker work?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

:button-two-type - same as button/button :type"
:actions - keyword (default nil) - :1-action/:2-actions
:description - string (default nil) - Description to display below the title
:button-one-disabled? - bool (default false) - Whether the first button is
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think the naming is clear enough here. Maybe create and continue would be better

Copy link
Contributor

Choose a reason for hiding this comment

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

imo it should be button-one-props and button-two-props and we pass the map along 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@tumanov-alex
Copy link
Contributor Author

tumanov-alex commented Oct 31, 2023

@J-Son89 about the icons: i've checked these folders by hand, they don't have this exact icon (see screenshot). About the location — I'll move it to the correct folder, but we should change the docs, since they're pointing to the legacy folder — i can edit them

image

@@ -0,0 +1,14 @@
(ns status-im.ui.screens.wallet.address-add-edit.utils)

(defn random-emoji
Copy link
Contributor

Choose a reason for hiding this comment

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

I believe that emojis should be created more generic since they will be used in a lot of other places as well. Don't we already have then in the project?

Copy link
Member

Choose a reason for hiding this comment

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

Yes, this can be a generic function to get random emoji from the emoji data set.

The data is clojurized in emoji-data def var under status-im2.contexts.emoji-picker.data ns.

We can pass it directly to the rand-nth macro to get the random emoji. The result would be a map that will have a key named unicode which will have the emoji.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@J-Son89
Copy link
Contributor

J-Son89 commented Oct 31, 2023

@J-Son89 about the icons: i've checked these folders by hand, they don't have this exact icon (see screenshot). About the location — I'll move it to the correct folder, but we should change the docs, since they're pointing to the legacy folder — i can edit them

image

ah was not aware of this, yeah that would be great if you can update the docs :)

hmm, not sure why that is. because when I search for :i/advanced I can see it being used in the codebase

it should be being used on the edit (wallet) account page if you check

:default-value @input-value}]
[quo/button
{:icon-only? true
:type :outline} :i/scan]]
[rn/view {:style (style/button-container bottom)}
[quo/text "[WIP] Bottom Actions"]]])))
[quo/bottom-actions
Copy link
Contributor

Choose a reason for hiding this comment

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

btw, here we need customization-color on the button too. on this page it's the users custom color 👍 we have this data available on many pages.
you can get it by the following sub {:keys [customization-color]} (rf/sub [:profile/multiaccount])

Copy link
Contributor Author

Choose a reason for hiding this comment

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

great suggestion! i also used this customization color on the second screen, so the user won't need to touch color picked if he would like to preserve the old color

Comment on lines 3 to 20
(def container
{:flex 1})
(def input
{:margin-right 12
:flex 1})
(def data-item
{:margin-horizontal 20
:padding-vertical 8
:padding-horizontal 12})
(defn button-container
[bottom]
{:position :absolute
:bottom (+ bottom 12)
:left 20
:right 20})
Copy link
Member

Choose a reason for hiding this comment

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

Please add a line break between styles

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@tumanov-alex tumanov-alex force-pushed the 17490-watch-account-5 branch 2 times, most recently from 17eab55 to ab09974 Compare November 1, 2023 19:14
@pavloburykh
Copy link
Contributor

pavloburykh commented Nov 3, 2023

ISSUE 4 Color pickers do not correspond the designs

@tumanov-alex I understand that colorpickers are out of scope. But wallet colorpickers have been recently fixed here #17748 and I would expect them to look correct during creating Watch only account.

Actual result: less than half of color picker is hidden by default

photo_2023-11-03 13 54 16

Expected result: half of color picker should be hidden by default. This is a screenshot how it looks on Account create screen.

photo_2023-11-03 13 53 43

@pavloburykh
Copy link
Contributor

ISSUE 5 Continue button is hidden behind active keyboard on IOS

Reproducing on IOS 16.1, iPhoneX

Actual result:

photo_2023-11-03 13 22 50

Expected result: Continue button should be located above active keyboard

photo_2023-11-03 13 22 47

@tumanov-alex
Copy link
Contributor Author

@pavloburykh thanks for the review!

about issues 1, 2 & 3: this is a UI-only ticket, so these feature aren't expected to be implemented in its scope, but would be added alongside actual backend features.

4 & 5 — great catch, working on it

@pavloburykh
Copy link
Contributor

pavloburykh commented Nov 3, 2023

ISSUE 4 Color pickers do not correspond the designs

in addition to this:

ISSUE 6 User's current custom color is selected by default when creating watch only account

Actual result:

telegram-cloud-document-2-5343968403273039042.mp4

Expected result: when creating a regular account the first color picker in a row is selected despite of users custom color. I am not sure which behaviour is correct, it is not clear from Figma which behaviour is correct. Better ask the design team. But I believe that watch only and regular account customisation screens should behave the same.

telegram-cloud-document-2-5343968403273039048.mp4

@pavloburykh
Copy link
Contributor

pavloburykh commented Nov 3, 2023

ISSUE 7 Wallet icon and emoji picker background do correspond the designs

This issue is common for both watch only and regular account customisation screens

The color and opacity seems to be wrong.

Expected result:

Designs

Wallet for Mobile – Figma 2023-11-03 15-05-29

Actual result:

photo_2023-11-03 15 06 50

@tumanov-alex
Copy link
Contributor Author

tumanov-alex commented Nov 3, 2023

@pavloburykh about the issue # 5 — its a little complex to finish right now, while this pr is blocking @mmilad75, so ive talked to Jamie and he confirmed that we can merge the pr without it for now.
About the issue 6 — Jamie & Ulises are working on a component that should solve this later

But ive fixed issues 4 & #17781 (comment) (lets call it isssue # 4.5 :D)

cc @J-Son89

@J-Son89
Copy link
Contributor

J-Son89 commented Nov 3, 2023

SSUE 5 Continue button is hidden behind active keyboard on IOS

@pavloburykh about the issue # 5 — its a little complex to finish right now, while this pr is blocking @mmilad75, so ive talked to Jamie and he confirmed that we can merge the pr without it for now. About the issue 6 — Jamie & Ulises are working on a component that should solve this later

But ive fixed issues 4 & #17781 (comment) (lets call it isssue # 4.5 :D)

cc @J-Son89

yes, just to point the issue me & Ulises are addressing is related to - ISSUE 5 Continue button is hidden behind active keyboard on IOS.

ISSUE 6 User's current custom color is selected by default when creating watch only account - As Alex said it would be better to handle this separately. The scope of this pr is mostly to get the structure of the UI sitting right and then we will further integrate all of the appropriate behaviours properly in small follow ups as we need this pr merged to begin connecting the backend etc as well :)

ISSUE 7 Wallet icon and emoji picker background do correspond the designs - this should be a follow up imo and handled in a separate issue/ pr 👍

We can create the issues to track all of these details! 👌

@pavloburykh
Copy link
Contributor

pavloburykh commented Nov 3, 2023

Thank you @tumanov-alex

ISSUE 5 Continue button is hidden behind active keyboard on IOS

and

ISSUE 6 User's current custom color is selected by default when creating watch only account

are fixed
PR is ready for merge.

We can create the issues to track all of these details!

Thank you! Will you create followups to track the rest of the issues?

@J-Son89
Copy link
Contributor

J-Son89 commented Nov 3, 2023

Yes @tumanov-alex & I can create these issues @pavloburykh! Thanks for catching them! 🙌🏼

@pavloburykh
Copy link
Contributor

@tumanov-alex @J-Son89 I have messed up with issues numeration (already fixed).
Just to clarify: ISSUES 5 and 6 are fixed. The rest of the issues should be tracked in followups.

@J-Son89
Copy link
Contributor

J-Son89 commented Nov 3, 2023

Thanks! 🙏

@J-Son89
Copy link
Contributor

J-Son89 commented Nov 3, 2023

Adjust color picker issue:
#17806

emoji picker - #17807

scan address - #17808

validation - #17809 (although this is lower priority in the current set of priorities we are working on)

@@ -219,6 +220,9 @@
:options {:insets {:top? true}}
:component wallet.swap/asset-selector}

{:name :address-to-watch-edit
Copy link
Contributor

Choose a reason for hiding this comment

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

@tumanov-alex this should be in status_im2 screens file. please move there before merging 👍

@status-im-auto
Copy link
Member

✔️ status-mobile/prs/android/PR-17781#26 🔹 ~13 min 🔹 9ac8d4f 🔹 📦 android package

@tumanov-alex tumanov-alex force-pushed the 17490-watch-account-5 branch 2 times, most recently from 72ee746 to 358dd47 Compare November 7, 2023 16:15
Add account creation screen

remove icons

remove extra utility and create a new one that would use conventional way of getting an emoji

fix lint

Use button component instead of bottom-actions

Provide global customization color to buttons

Use conventional approach to extract account name

Move to another address

Move to another namespace

Refactor bottom-actions to have button props in maps

Update doc with new icon location

Add spaces between styles

Work on pr comments

Use :on-change-text instead of :on-change for input component
Subscribe to :profile/customization-color directly
Use bottom button from the create-or-edit-account wrapper

Remove extra code
Sort requires

Move ns to proper fileˆ

Fix styles
@tumanov-alex tumanov-alex merged commit 569036c into develop Nov 7, 2023
6 checks passed
@tumanov-alex tumanov-alex deleted the 17490-watch-account-5 branch November 7, 2023 16:40
yevh-berdnyk pushed a commit that referenced this pull request Dec 8, 2023
Add account creation screen

remove icons

remove extra utility and create a new one that would use conventional way of getting an emoji

fix lint

Use button component instead of bottom-actions

Provide global customization color to buttons

Use conventional approach to extract account name

Move to another address

Move to another namespace

Refactor bottom-actions to have button props in maps

Update doc with new icon location

Add spaces between styles

Work on pr comments

Use :on-change-text instead of :on-change for input component
Subscribe to :profile/customization-color directly
Use bottom button from the create-or-edit-account wrapper

Remove extra code
Sort requires

Move ns to proper fileˆ

Fix styles
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Archived in project
Development

Successfully merging this pull request may close these issues.

9 participants