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

Quo2 Wallet: Settings Item #17179

Merged
merged 12 commits into from
Sep 7, 2023
Merged

Quo2 Wallet: Settings Item #17179

merged 12 commits into from
Sep 7, 2023

Conversation

OmarBasem
Copy link
Contributor

fixes: #17124
also fixes: #17125

This PR reimplements Settings item component to match figma and add the missing variations. Blur is out of scope.

Designs

Demo:

RPReplay-Final1693851039.MP4

Comment on lines 85 to +95
56 0
40 (if border-color 8 9)
32 (if border-color 4 5)
24 (if border-color 0 1)
24 0
(if border-color 8 9)))
:padding-bottom (when-not (or icon-only? icon-left icon-right)
(case size
56 0
40 9
32 5
24 4
24 0
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@J-Son89 I think these paddings need to be revised. They seem redundant to me as height is already given.

Copy link
Contributor

@J-Son89 J-Son89 Sep 4, 2023

Choose a reason for hiding this comment

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

Im not entirely sure, I added some of these to get the text alignment correct in the outline variant. Perhaps it needs adjustment but we have to check all of the cases then. We really need some visual tests in place 🙂🙃

Copy link
Contributor Author

@OmarBasem OmarBasem Sep 5, 2023

Choose a reason for hiding this comment

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

I tried removing padding-top, padding-bottom, padding-left, padding-right, and it stayed centered. Height is given and :align-items :center :justify-content :center is used, so these extra paddings are redundant.

Also, there is horizontal-padding given, why is there also padding-left and right?

Copy link
Contributor

Choose a reason for hiding this comment

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

So I will caveat that the button was already setup when I made recent refactors and I just cleaned the code a little but mostly did not touch styling except in the case of the outline variant as the text was not sitting correctly.
It appears the way the style code was done is that padding-horizontal and padding-left and padding-right are all set so tweaking these might have unexpected consequences. I agree there could be something off there as it is slightly confusingly in implementation. Feel free to adjust as you see fit alt but just consider that when making changes.
Perhaps we do this in a separate pr either?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@J-Son89 Yeah seperate PR. This PR just fixes vertical alignment for size 24

Copy link
Contributor

Choose a reason for hiding this comment

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

sounds good, thanks! 🙌

@status-im-auto
Copy link
Member

status-im-auto commented Sep 4, 2023

Jenkins Builds

Click to see older builds (31)
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ 376b955 #1 2023-09-04 18:19:31 ~5 min android-e2e 🤖apk 📲
✔️ 376b955 #1 2023-09-04 18:20:59 ~7 min ios 📱ipa 📲
✔️ 376b955 #1 2023-09-04 18:23:06 ~9 min android 🤖apk 📲
376b955 #1 2023-09-04 18:23:41 ~9 min tests 📄log
✔️ 40cd959 #2 2023-09-05 05:26:56 ~6 min android-e2e 🤖apk 📲
✔️ 40cd959 #2 2023-09-05 05:27:12 ~6 min android 🤖apk 📲
✔️ 40cd959 #2 2023-09-05 05:28:08 ~7 min ios 📱ipa 📲
40cd959 #2 2023-09-05 05:29:22 ~8 min tests 📄log
✔️ fdbc90f #3 2023-09-05 11:14:52 ~5 min android 🤖apk 📲
✔️ fdbc90f #3 2023-09-05 11:15:25 ~6 min android-e2e 🤖apk 📲
fdbc90f #3 2023-09-05 11:18:01 ~8 min tests 📄log
✔️ fdbc90f #3 2023-09-05 11:20:13 ~10 min ios 📱ipa 📲
7b4bf87 #4 2023-09-06 09:42:15 ~2 min tests 📄log
✔️ 7b4bf87 #4 2023-09-06 09:45:14 ~5 min android 🤖apk 📲
✔️ 7b4bf87 #4 2023-09-06 09:45:39 ~6 min android-e2e 🤖apk 📲
✔️ 7b4bf87 #4 2023-09-06 09:48:55 ~9 min ios 📱ipa 📲
✔️ d3e9a19 #5 2023-09-06 17:18:37 ~5 min android-e2e 🤖apk 📲
✔️ d3e9a19 #5 2023-09-06 17:18:44 ~5 min android 🤖apk 📲
✔️ d3e9a19 #5 2023-09-06 17:19:30 ~6 min ios 📱ipa 📲
d3e9a19 #5 2023-09-06 17:21:31 ~8 min tests 📄log
✔️ 933d164 #6 2023-09-07 10:13:02 ~6 min android 🤖apk 📲
✔️ 933d164 #6 2023-09-07 10:13:03 ~6 min android-e2e 🤖apk 📲
933d164 #6 2023-09-07 10:15:20 ~8 min tests 📄log
✔️ 933d164 #6 2023-09-07 10:16:11 ~9 min ios 📱ipa 📲
d07aa41 #7 2023-09-07 10:30:25 ~2 min tests 📄log
✔️ d07aa41 #7 2023-09-07 10:33:52 ~6 min android-e2e 🤖apk 📲
✔️ d07aa41 #7 2023-09-07 10:33:58 ~6 min android 🤖apk 📲
✔️ ca865e9 #8 2023-09-07 10:40:13 ~5 min android 🤖apk 📲
✔️ ca865e9 #8 2023-09-07 10:43:47 ~9 min android-e2e 🤖apk 📲
✔️ ca865e9 #8 2023-09-07 10:44:22 ~10 min tests 📄log
✔️ ca865e9 #8 2023-09-07 10:48:48 ~14 min ios 📱ipa 📲
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ a76ed62 #9 2023-09-07 11:04:43 ~5 min android 🤖apk 📲
✔️ a76ed62 #9 2023-09-07 11:04:57 ~6 min android-e2e 🤖apk 📲
✔️ a76ed62 #9 2023-09-07 11:05:48 ~6 min ios 📱ipa 📲
✔️ a76ed62 #9 2023-09-07 11:08:48 ~9 min tests 📄log
ed1d34e #10 2023-09-07 11:28:59 ~3 min ios 📄log
✔️ ed1d34e #10 2023-09-07 11:30:41 ~5 min android-e2e 🤖apk 📲
✔️ ed1d34e #10 2023-09-07 11:30:50 ~5 min android 🤖apk 📲
✔️ ed1d34e #10 2023-09-07 11:34:30 ~9 min tests 📄log

:selector [selectors/toggle action-props]
nil)])

(defn- internal-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 use :as props and pass it along and destructure as you need.

(defn- internal-view
  [{:keys [title image image-props description description-props action action-props label label-props
           tag tag-props on-press in-card? blur? accessibility-label theme] :as props}]
           
  [rn/pressable
   {:style               (style/container in-card? tag)
    :on-press            on-press
    :accessibility-label accessibility-label}
   [rn/view {:style style/sub-container}
    [image-component props]
    [rn/view {:style {:margin-left 12}}
     [text/text {:weight :medium} title]
     [description-component props]
     [tag-component props]]]
   [rn/view {:style style/sub-container}
    [label-component props]

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@J-Son89 fixed 👍

@@ -61,9 +64,10 @@
:color text-color}} label]]])))

(defn- positive
[size theme label _ no-icon?]
[size theme label _ no-icon? container-style]
Copy link
Contributor

Choose a reason for hiding this comment

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

preferably these args are a map instead

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This would affect the rest of the component and would need further changes for all the other cases. This is not part of this PR, I just needed to add a container-style

(h/test "its gets passed an on press event"
(let [event (h/mock-fn)]
(h/render [settings-item/view
(merge props {:on-press event})])
Copy link
Contributor

Choose a reason for hiding this comment

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

nit, let's use assoc

Copy link
Contributor Author

Choose a reason for hiding this comment

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

using assoc for this particular one is fine, but merge is used multiple times in this file to merge maps, so for consistency I think we can keep it merge

(:require [quo2.components.settings.settings-item.view :as settings-item]
[test-helpers.component :as h]))

(def props
Copy link
Contributor

Choose a reason for hiding this comment

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

args for tests should ideally be the bare minimum for the test to work imo.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

trimmed it down a little

Comment on lines +6 to +7
(let [icon-height (if (= image :icon-avatar) 32 20)
icon-height (if description 40 icon-height)]
Copy link
Member

Choose a reason for hiding this comment

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

Maybe use cond here

Copy link
Contributor Author

@OmarBasem OmarBasem Sep 5, 2023

Choose a reason for hiding this comment

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

@briansztamfater Can you elaborate how? Here we first set the height based on what type of image. Then we add more height based on description. Then we may add more height based on tag.

@OmarBasem
Copy link
Contributor Author

@Francesca-G a design review please :)

Copy link

@Francesca-G Francesca-G left a comment

Choose a reason for hiding this comment

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

Here's the Figma frame with the design review :)

@OmarBasem
Copy link
Contributor Author

OmarBasem commented Sep 6, 2023

@Francesca-G there is a known issue with letter spacing. I don't think it is specific to this PR. I double checked the values used in Figma and they are matching what I am using

@Francesca-G
Copy link

@Francesca-G there is a known issue with letter spacing. I don't think it is specific to this PR. I double checked the values used in Figma and they are matching what I am using

I'm talking about the icon, not the letter spacing. The icon isn't aligned with the text

@OmarBasem
Copy link
Contributor Author

@Francesca-G please check now

Copy link

@Francesca-G Francesca-G left a comment

Choose a reason for hiding this comment

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

here's the updated review

@OmarBasem
Copy link
Contributor Author

@Francesca-G please check again :)

@status-im-auto
Copy link
Member

74% of end-end tests have passed

Total executed tests: 43
Failed tests: 11
Passed tests: 32
IDs of failed tests: 702733,702732,702813,702948,702745,703503,702786,702807,702731,702808,702958 

Failed tests (11)

Click to expand
  • Rerun failed tests

  • Class TestCommunityOneDeviceMerged:

    1. test_community_discovery, id: 703503

    Device 1: Tap on found: Button
    Device 1: Find `Button` by `xpath`: `//*[@text="Contributors' test community"]`

    critical/test_public_chat_browsing.py:333: in test_community_discovery
        self.home.element_by_text(self.discovery_community_attributes[0]).click()
    ../views/base_element.py:90: in click
        self.find_element().click()
    ../views/base_element.py:79: in find_element
        raise NoSuchElementException(
     Device 1: Button by xpath: `//*[@text="Contributors' test community"]` is not found on the screen; For documentation on this error, please visit: https://www.selenium.dev/documentation/webdriver/troubleshooting/errors#no-such-element-exception
    



    Device sessions

    Class TestGroupChatMultipleDeviceMergedNewUI:

    1. test_group_chat_pin_messages, id: 702732

    Test is not run, e2e blocker  
    

    [[reason: [NOTRUN] Pin feature is in development]]

    2. test_group_chat_join_send_text_messages_push, id: 702807

    Device 2: Text is Delivered
    Device 1: Looking for a message by text: Hey, admin!

    critical/chats/test_group_chat.py:231: in test_group_chat_join_send_text_messages_push
        self.errors.verify_no_errors()
    base_test_case.py:187: in verify_no_errors
        pytest.fail('\n '.join([self.errors.pop(0) for _ in range(len(self.errors))]))
     No PN was received on new message for message in group chat
    



    Device sessions

    3. test_group_chat_offline_pn, id: 702808

    Device 3: Looking for a message by text: message from old member
    Device 3: Looking for a message by text: message from new member

    critical/chats/test_group_chat.py:441: in test_group_chat_offline_pn
        self.errors.verify_no_errors()
    base_test_case.py:187: in verify_no_errors
        pytest.fail('\n '.join([self.errors.pop(0) for _ in range(len(self.errors))]))
     Messages PN was not fetched from offline
    



    Device sessions

    Class TestOneToOneChatMultipleSharedDevicesNewUi:

    1. test_1_1_chat_text_message_delete_push_disappear, id: 702733

    Device 1: Could not reach home view by pressing system back button
    Device 2: Could not reach home view by pressing system back button

    critical/chats/test_1_1_public_chats.py:1328: in test_1_1_chat_text_message_delete_push_disappear
        self.errors.verify_no_errors()
    base_test_case.py:187: in verify_no_errors
        pytest.fail('\n '.join([self.errors.pop(0) for _ in range(len(self.errors))]))
     Push notification doesn't appear
    



    Device sessions

    2. test_1_1_chat_push_emoji, id: 702813

    Device 1: Find Button by xpath: //*[contains(@content-desc,'Status')]
    Device 1: Tap on found: Button

    critical/chats/test_1_1_public_chats.py:1166: in test_1_1_chat_push_emoji
        self.device_1.driver.fail("Push notification with emoji was not received")
    base_test_case.py:175: in fail
        pytest.fail('Device %s: %s' % (self.number, text))
     Device 1: Push notification with emoji was not received
    



    Device sessions

    3. test_1_1_chat_non_latin_messages_stack_update_profile_photo, id: 702745

    Device 2: Find MemberPhoto by xpath: //*[starts-with(@text,'profile_photo')]/ancestor::android.view.ViewGroup[@content-desc='chat-item']//*[@content-desc='user-avatar']
    Device 2: Image differs from template to 7.357129863664216 percents

    critical/chats/test_1_1_public_chats.py:1127: in test_1_1_chat_non_latin_messages_stack_update_profile_photo
        self.errors.verify_no_errors()
    base_test_case.py:187: in verify_no_errors
        pytest.fail('\n '.join([self.errors.pop(0) for _ in range(len(self.errors))]))
     Image of user in 1-1 chat is too different from template!
    



    Device sessions

    4. test_1_1_chat_pin_messages, id: 702731

    Test is not run, e2e blocker  
    

    [[reason: [NOTRUN] Pin feature is in development]]

    Class TestCommunityMultipleDeviceMergedTwo:

    1. test_community_hashtag_links_to_community_channels, id: 702948

    # STEP: Device 1 sends a message with hashtag in the dogs channel
    Device 1: Sending message '#cats'

    critical/test_public_chat_browsing.py:1257: in test_community_hashtag_links_to_community_channels
        self.channel_1.send_message(message_with_hashtag)
    ../views/chat_view.py:995: in send_message
        self.chat_message_input.wait_for_element(wait_chat_input_sec)
    ../views/base_element.py:121: in wait_for_element
        raise TimeoutException(
     Device `1`: `ChatMessageInput` by` accessibility id`: `chat-message-input` is not found on the screen after wait_for_element; 
     RemoteDisconnected
    



    Device sessions

    2. test_community_mentions_push_notification, id: 702786

    # STEP: Invited member gets push notification with the mention and tap it
    Device 2: Getting PN by 'user_2'

    critical/test_public_chat_browsing.py:1147: in test_community_mentions_push_notification
        self.errors.verify_no_errors()
    base_test_case.py:187: in verify_no_errors
        pytest.fail('\n '.join([self.errors.pop(0) for _ in range(len(self.errors))]))
     Push notification with the mention was not received by admin
    E    Can not edit a message with a mention
    E    Push notification with the mention was not received by the invited member 
    

    [[Issue with username in PN, issue #6 in 15500]]

    Device sessions

    Class TestActivityMultipleDevicePRTwo:

    1. test_activity_center_admin_notification_accept_swipe, id: 702958

    Device 2: Find Button by xpath: //*[@content-desc='password-input']/../following-sibling::*//*[@text='Join Community']
    Device 2: Tap on found: Button

    medium/test_activity_center.py:385: in test_activity_center_admin_notification_accept_swipe
        self.community_2.join_community()
    ../views/chat_view.py:424: in join_community
        self.community_status_joined.wait_for_visibility_of_element(60)
    ../views/base_element.py:139: in wait_for_visibility_of_element
        raise TimeoutException(
     Device 2: Text by accessibility id:`status-tag-positive` is not found on the screen after wait_for_visibility_of_element
    



    Device sessions

    Passed tests (32)

    Click to expand

    Class TestCommunityOneDeviceMerged:

    1. test_restore_multiaccount_with_waku_backup_remove_switch, id: 703133
    Device sessions

    2. test_community_copy_and_paste_message_in_chat_input, id: 702742
    Device sessions

    3. test_community_undo_delete_message, id: 702869
    Device sessions

    4. test_community_navigate_to_channel_when_relaunch, id: 702846
    Device sessions

    5. test_community_mute_community_and_channel, id: 703382
    Device sessions

    Class TestActivityCenterContactRequestMultipleDevicePR:

    1. test_activity_center_contact_request_accept_swipe_mark_all_as_read, id: 702851
    Device sessions

    2. test_activity_center_contact_request_decline, id: 702850
    Device sessions

    Class TestCommunityMultipleDeviceMerged:

    1. test_community_several_images_send_reply, id: 703194
    Device sessions

    2. test_community_one_image_send_reply, id: 702859
    Device sessions

    3. test_community_emoji_send_copy_paste_reply, id: 702840
    Device sessions

    4. test_community_mark_all_messages_as_read, id: 703086
    Device sessions

    5. test_community_contact_block_unblock_offline, id: 702894
    Device sessions

    6. test_community_message_delete, id: 702839
    Device sessions

    7. test_community_message_send_check_timestamps_sender_username, id: 702838
    Device sessions

    8. test_community_links_with_previews_github_youtube_twitter_gif_send_enable, id: 702844
    Device sessions

    9. test_community_message_edit, id: 702843
    Device sessions

    10. test_community_unread_messages_badge, id: 702841
    Device sessions

    Class TestActivityMultipleDevicePR:

    1. test_navigation_jump_to, id: 702936
    Device sessions

    2. test_activity_center_reply_read_unread_delete_filter_swipe, id: 702947
    Device sessions

    Class TestOneToOneChatMultipleSharedDevicesNewUiTwo:

    1. test_1_1_chat_delete_via_long_press_relogin, id: 702784
    Device sessions

    2. test_1_1_chat_is_shown_message_sent_delivered_from_offline, id: 702783
    Device sessions

    3. test_1_1_chat_mute_chat, id: 703496
    Device sessions

    Class TestGroupChatMultipleDeviceMergedNewUI:

    1. test_group_chat_mute_chat, id: 703495
    Device sessions

    2. test_group_chat_send_image_save_and_share, id: 703297
    Device sessions

    3. test_group_chat_reactions, id: 703202
    Device sessions

    Class TestOneToOneChatMultipleSharedDevicesNewUi:

    1. test_1_1_chat_emoji_send_reply_and_open_link, id: 702782
    Device sessions

    2. test_1_1_chat_edit_message, id: 702855
    Device sessions

    3. test_1_1_chat_send_image_save_and_share, id: 703391
    Device sessions

    4. test_1_1_chat_message_reaction, id: 702730
    Device sessions

    Class TestCommunityMultipleDeviceMergedTwo:

    1. test_community_markdown_support, id: 702809
    Device sessions

    2. test_community_leave, id: 702845
    Device sessions

    Class TestActivityMultipleDevicePRTwo:

    1. test_activity_center_mentions, id: 702957
    Device sessions

    @OmarBasem OmarBasem force-pushed the quo2/settings-item branch 2 times, most recently from ca865e9 to a76ed62 Compare September 7, 2023 10:58
    @OmarBasem OmarBasem merged commit 36c87d3 into develop Sep 7, 2023
    2 checks passed
    @OmarBasem OmarBasem deleted the quo2/settings-item branch September 7, 2023 11:36
    @J-Son89
    Copy link
    Contributor

    J-Son89 commented Sep 11, 2023

    curious, seems like this pr was not reviewed/approved by QA. However this code is touching design system components which are used in the application code. Is that the case? 🤔

    @OmarBasem
    Copy link
    Contributor Author

    @J-Son89 I was not aware that it is used in application code. Did it break anything?

    @J-Son89
    Copy link
    Contributor

    J-Son89 commented Sep 12, 2023

    ah okay, yes it had some uses in the codebase. Not to worry, it's a small enough fix 👍

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

    Successfully merging this pull request may close these issues.

    Button text is not vertically centered with size 24 Quo2: Implement Settings Item component
    6 participants