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

fix android composer background shadow not visible when image is attached #19492

Merged
merged 1 commit into from
Apr 8, 2024

Conversation

Parveshdhull
Copy link
Member

@Parveshdhull Parveshdhull commented Apr 3, 2024

fixes #18953

Summary

PR fixes the composer shadow problem, also as bonus makes blur view static instead of animated one.

Testing notes:

status: ready

@status-im-auto
Copy link
Member

status-im-auto commented Apr 3, 2024

Jenkins Builds

Click to see older builds (8)
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ 99eb361 #1 2024-04-03 10:16:52 ~5 min tests 📄log
✔️ 99eb361 #1 2024-04-03 10:18:37 ~6 min android 🤖apk 📲
✔️ 99eb361 #1 2024-04-03 10:19:18 ~7 min android-e2e 🤖apk 📲
✔️ 99eb361 #1 2024-04-03 10:23:28 ~11 min ios 📱ipa 📲
✔️ 76ab1d5 #2 2024-04-04 14:31:03 ~4 min tests 📄log
✔️ 76ab1d5 #2 2024-04-04 14:34:10 ~7 min android-e2e 🤖apk 📲
✔️ 76ab1d5 #2 2024-04-04 14:34:13 ~7 min android 🤖apk 📲
✔️ 76ab1d5 #2 2024-04-04 14:36:14 ~9 min ios 📱ipa 📲
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ d080259 #3 2024-04-05 10:02:37 ~4 min tests 📄log
✔️ d080259 #3 2024-04-05 10:04:21 ~6 min android-e2e 🤖apk 📲
✔️ d080259 #3 2024-04-05 10:05:06 ~7 min android 🤖apk 📲
✔️ d080259 #3 2024-04-05 10:08:03 ~9 min ios 📱ipa 📲
✔️ 887395e #5 2024-04-08 11:08:26 ~8 min tests 📄log
✔️ 887395e #5 2024-04-08 11:10:43 ~10 min android 🤖apk 📲
✔️ 887395e #5 2024-04-08 11:11:09 ~11 min android-e2e 🤖apk 📲
✔️ 887395e #5 2024-04-08 11:26:24 ~26 min ios 📱ipa 📲

@status-im-auto
Copy link
Member

94% of end-end tests have passed

Total executed tests: 48
Failed tests: 2
Expected to fail tests: 1
Passed tests: 45
IDs of failed tests: 702733,702732 
IDs of expected to fail tests: 703503 

Failed tests (2)

Click to expand
  • Rerun failed tests

  • Class TestGroupChatMultipleDeviceMergedNewUI:

    1. test_group_chat_pin_messages, id: 702732

    Device 2: Find `Text` by `xpath`: `//*[@content-desc='pinned-messages-menu']//*[starts-with(@text,'Message 4')]/../../*[@content-desc='pinned-by']/android.widget.TextView`
    Device 2: `Text` is `user admin`

    critical/chats/test_group_chat.py:404: in test_group_chat_pin_messages
        self.errors.verify_no_errors()
    base_test_case.py:190: in verify_no_errors
        pytest.fail('\n '.join([self.errors.pop(0) for _ in range(len(self.errors))]))
     Pinned messages count 4 doesn't match expected 3 for user 2
    



    Device sessions

    Class TestOneToOneChatMultipleSharedDevicesNewUi:

    1. test_1_1_chat_text_message_delete_push_disappear, id: 702733

    Device 2: Find Text by xpath: //android.view.ViewGroup[@content-desc='chat-item']//android.widget.TextView[contains(@text,'DELETE ME')]
    Device 2: Long press on Text

    critical/chats/test_1_1_public_chats.py:514: in test_1_1_chat_text_message_delete_push_disappear
        self.chat_2.delete_message_in_chat(message_to_delete)
    ../views/chat_view.py:1047: in delete_message_in_chat
        self.chat_element_by_text(message).message_body.long_press_element()
    ../views/base_element.py:323: in long_press_element
        action.long_press(element).release().perform()
    /home/jenkins/.local/lib/python3.10/site-packages/appium/webdriver/common/touch_action.py:174: in perform
        self._driver.execute(Command.TOUCH_ACTION, params)
    /home/jenkins/.local/lib/python3.10/site-packages/selenium/webdriver/remote/webdriver.py:345: in execute
        self.error_handler.check_response(response)
    /home/jenkins/.local/lib/python3.10/site-packages/appium/webdriver/errorhandler.py:122: in check_response
        raise exception_class(msg=message, stacktrace=format_stacktrace(stacktrace))
     The element 'By.xpath: //android.view.ViewGroup[@content-desc='chat-item']//android.widget.TextView[contains(@text,'DELETE ME')]' is not linked to the same object in DOM anymore; For documentation on this error, please visit: https://www.selenium.dev/documentation/webdriver/troubleshooting/errors#stale-element-reference-exception
    E   Stacktrace:
    E   io.appium.uiautomator2.common.exceptions.StaleElementReferenceException: The element 'By.xpath: //android.view.ViewGroup[@content-desc='chat-item']//android.widget.TextView[contains(@text,'DELETE ME')]' is not linked to the same object in DOM anymore
    E   	at io.appium.uiautomator2.model.ElementsCache.restore(ElementsCache.java:122)
    E   	at io.appium.uiautomator2.model.ElementsCache.get(ElementsCache.java:153)
    E   	at io.appium.uiautomator2.handler.Location.safeHandle(Location.java:23)
    E   	at io.appium.uiautomator2.handler.request.SafeRequestHandler.handle(SafeRequestHandler.java:59)
    E   	at io.appium.uiautomator2.server.AppiumServlet.handleRequest(AppiumServlet.java:277)
    E   	at io.appium.uiautomator2.server.AppiumServlet.handleHttpRequest(AppiumServlet.java:271)
    E   	at io.appium.uiautomator2.http.ServerHandler.channelRead(ServerHandler.java:68)
    E   	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:366)
    E   	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:352)
    E   	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:345)
    E   	at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:102)
    E   	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:366)
    E   	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:352)
    E   	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:345)
    E   	at io.netty.channel.CombinedChannelDuplexHandler$DelegatingChannelHandlerContext.fireChannelRead(CombinedChannelDuplexHandler.java:435)
    E   	at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:293)
    E   	at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:267)
    E   	at io.netty.channel.CombinedChannelDuplexHandler.channelRead(CombinedChannelDuplexHandler.java:250)
    E   	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:366)
    E   	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:352)
    E   	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:345)
    E   	at io.netty.handler.timeout.IdleStateHandler.channelRead(IdleStateHandler.java:266)
    E   	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:366)
    E   	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:352)
    E   	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:345)
    E   	at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1294)
    E   	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:366)
    E   	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:352)
    E   	at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:911)
    E   	at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:131)
    E   	at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:611)
    E   	at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:552)
    E   	at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:466)
    E   	at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:438)
    E   	at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:140)
    E   	at io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:144)
    E   	at java.lang.Thread.run(Thread.java:1012)
    



    Device sessions

    Expected to fail tests (1)

    Click to expand

    Class TestCommunityOneDeviceMerged:

    1. test_community_discovery, id: 703503

    Test is not run, e2e blocker  
    

    [[reason: [NOTRUN] Curated communities not loading, https://github.com//issues/17852]]

    Passed tests (45)

    Click to expand

    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 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_edit_delete_message_when_offline, id: 704615
    Device sessions

    7. test_community_message_delete, id: 702839
    Device sessions

    8. test_community_message_send_check_timestamps_sender_username, id: 702838
    Device sessions

    9. test_community_links_with_previews_github_youtube_twitter_gif_send_enable, id: 702844
    Device sessions

    10. test_community_message_edit, id: 702843
    Device sessions

    11. test_community_unread_messages_badge, id: 702841
    Device sessions

    Class TestOneToOneChatMultipleSharedDevicesNewUi:

    1. test_1_1_chat_emoji_send_reply_and_open_link, id: 702782
    Device sessions

    2. test_1_1_chat_push_emoji, id: 702813
    Device sessions

    3. test_1_1_chat_non_latin_messages_stack_update_profile_photo, id: 702745
    Device sessions

    4. test_1_1_chat_edit_message, id: 702855
    Device sessions

    5. test_1_1_chat_send_image_save_and_share, id: 703391
    Device sessions

    6. test_1_1_chat_pin_messages, id: 702731
    Device sessions

    7. test_1_1_chat_message_reaction, id: 702730
    Device sessions

    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_add_contact_field_validation, id: 702777
    Device sessions

    2. test_activity_center_contact_request_accept_swipe_mark_all_as_read, id: 702851
    Device sessions

    3. test_activity_center_contact_request_decline, id: 702850
    Device sessions

    Class TestCommunityMultipleDeviceMergedTwo:

    1. test_community_markdown_support, id: 702809
    Device sessions

    2. test_community_hashtag_links_to_community_channels, id: 702948
    Device sessions

    3. test_community_mentions_push_notification, id: 702786
    Device sessions

    4. test_community_leave, id: 702845
    Device sessions

    5. test_community_join_when_node_owner_offline, id: 703629
    Device sessions

    Class TestDeepLinksOneDevice:

    1. test_links_open_universal_links_from_chat, id: 704613
    Device sessions

    2. test_links_deep_links, id: 702775
    Device sessions

    Class TestActivityMultipleDevicePRTwo:

    1. test_activity_center_mentions, id: 702957
    Device sessions

    2. test_activity_center_admin_notification_accept_swipe, id: 702958
    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

    4. test_group_chat_join_send_text_messages_push, id: 702807
    Device sessions

    5. test_group_chat_offline_pn, id: 702808
    Device sessions

    @pavloburykh pavloburykh force-pushed the fix/composer-photo-shadow branch from 99eb361 to 76ab1d5 Compare April 4, 2024 14:26
    @pavloburykh pavloburykh self-assigned this Apr 4, 2024
    @pavloburykh pavloburykh force-pushed the fix/composer-photo-shadow branch from 76ab1d5 to d080259 Compare April 5, 2024 09:57
    @pavloburykh
    Copy link
    Contributor

    @OmarBasem @alwx hello guys! Could please someone review this PR? Thank you.

    @Parveshdhull Parveshdhull requested review from jo-mut and ibrkhalil April 8, 2024 08:08
    Comment on lines -84 to +83
    (when (and (not @focused?) (utils/empty-input? input-text images link-previews? reply audio))
    (reanimated/animate-delay container-opacity constants/empty-opacity 200)))
    (reanimated/set-shared-value
    empty-input?
    (utils/empty-input? input-text images link-previews? reply audio)))
    Copy link
    Contributor

    Choose a reason for hiding this comment

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

    This was an animation, and now it is setting a shared value. Are you sure about this change @Parveshdhull ?

    Copy link
    Member Author

    Choose a reason for hiding this comment

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

    hi @OmarBasem, Thank you very much for reviewing PR.

    Yes, the empty-input? shared value is supposed to be updated whenever we have input empty without delay. We need animation for container-opacity, which is now handled in composerContainerOpacity in the composer.js file.

    Comment on lines -210 to -211
    (when images
    (reanimated/animate container-opacity 1))
    Copy link
    Contributor

    Choose a reason for hiding this comment

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

    Is the container's opacity being animated on adding images somewhere else? (and have you tested adding images, then existing and entering the chat screen)

    Copy link
    Member Author

    Choose a reason for hiding this comment

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

    Yes, as I mentioned in above comment all animations for container-opacity is handled in composer.js file at one place. Now we don't need to handle this manually.

    and have you tested adding images, then existing and entering the chat screen

    Double checked just now, working fine. Thank you for reminding.

    Copy link
    Contributor

    Choose a reason for hiding this comment

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

    I also checked this case and it looks fine for me

    @@ -68,7 +68,6 @@
    (if-not keyboard-shown
    (do ; focus and end
    (when (< (oops/oget event "velocityY") constants/velocity-threshold)
    (reanimated/set-shared-value container-opacity 1)
    Copy link
    Contributor

    Choose a reason for hiding this comment

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

    Also here, is the container's opacity being handled somewhere else on-focus?

    Copy link
    Member Author

    Choose a reason for hiding this comment

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

    yes

    Comment on lines -167 to -171

    (defn layout
    [event state blur-height]
    (when (utils/update-blur-height? event state blur-height)
    (reanimated/set-shared-value blur-height (oops/oget event "nativeEvent.layout.height"))))
    Copy link
    Contributor

    Choose a reason for hiding this comment

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

    Do we not need this anymore?

    Copy link
    Member Author

    Choose a reason for hiding this comment

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

    Composer is only blurred when it is collapsed and empty, not sure why we animated blur height in first place. But yes we don't this anymore

    Comment on lines 12 to +18
    (defn shadow
    [focused? theme]
    (if platform/ios?
    [theme]
    (when platform/ios?
    {:shadow-radius 20
    :shadow-opacity (colors/theme-colors 0.1 0.7 theme)
    :shadow-color colors/neutral-100
    :shadow-offset {:width 0 :height (colors/theme-colors -4 -8 theme)}}
    {:elevation (if @focused? 10 0)}))
    :shadow-offset {:width 0 :height (colors/theme-colors -4 -8 theme)}}))
    Copy link
    Contributor

    Choose a reason for hiding this comment

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

    Is the elevation here not needed? Does the shadow look right with all combinations of being focused and not focused, and having content and not having content?

    Copy link
    Member Author

    Choose a reason for hiding this comment

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

    Yes, it looks fine. But just to be double sure, @pavloburykh Please keep an eye on this while testing.

    Copy link
    Contributor

    Choose a reason for hiding this comment

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

    I have checked those cases, shadow looks okay to me

    {:position :absolute
    :elevation (if-not @focused? 10 0)
    Copy link
    Contributor

    Choose a reason for hiding this comment

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

    Are we removing the shadow completely on Android?

    Copy link
    Member Author

    Choose a reason for hiding this comment

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

    Nope, moved to blur-container-elevation

    @pavloburykh
    Copy link
    Contributor

    @OmarBasem thanks for the review. @Parveshdhull please, ping me up when review comments will be addressed. I have tested the PR and it looks good to me. If there will be any changes based on the review please let me know so I perform re-test. Thank you.

    @pavloburykh
    Copy link
    Contributor

    @Parveshdhull if not changes are required - PR is ready for merge.

    @Parveshdhull Parveshdhull force-pushed the fix/composer-photo-shadow branch from 99eb361 to 887395e Compare April 8, 2024 10:59
    @Parveshdhull Parveshdhull merged commit 5fe28a2 into develop Apr 8, 2024
    6 checks passed
    @Parveshdhull Parveshdhull deleted the fix/composer-photo-shadow branch April 8, 2024 11:28
    @Parveshdhull Parveshdhull restored the fix/composer-photo-shadow branch April 25, 2024 16:12
    @Parveshdhull Parveshdhull deleted the fix/composer-photo-shadow branch April 25, 2024 16:13
    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.

    Android composer background shadow not visible when image is attached
    5 participants