-
Notifications
You must be signed in to change notification settings - Fork 985
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
Implement collectible image preview #18449
Conversation
Jenkins BuildsClick to see older builds (40)
|
8633105
to
8f6f2f2
Compare
8f6f2f2
to
ea7bf1e
Compare
:image-width 300 ; collectibles don't have | ||
; width/height but we need | ||
; to pass something | ||
:image-height 300 ; without it animation | ||
; doesn't work smoothly and | ||
; :border-radius not | ||
; applied |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These values are used in zooming animations. Have you tested how does zooming look.
Instead of using an arbitrary value we could use the device's width as the image dimensions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, I didn't find any problems with resizing.
Good idea, will try this!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried using device dimensions and that resulted in wrong scaling and strange animation
ea7bf1e
to
51cac35
Compare
@@ -1,4 +1,4 @@ | |||
(ns status-im.contexts.chat.messenger.lightbox.animations | |||
(ns status-im.common.lightbox.animations |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🙌
(fn [{:keys [db]} [value]] | ||
{:db (assoc db :lightbox/scale value)})) | ||
|
||
(rf/reg-event-fx :chat.ui/share-image |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:chat.ui/share-image should this event be in this ns?
(fn [_ [uri]] | ||
{:effects.lightbox/share-image uri})) | ||
|
||
(rf/reg-event-fx :chat.ui/save-image-to-gallery |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same 🤔
ebe7f8a
to
4b1a894
Compare
(:require | ||
[quo.foundations.colors :as colors] | ||
[react-native.platform :as platform] | ||
[react-native.reanimated :as reanimated] | ||
[status-im.contexts.chat.messenger.lightbox.constants :as c])) | ||
[status-im.common.lightbox.constants :as c])) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see that sometimes this namespace is imported as c
, and sometimes is imported as constants
. We should unify the naming IMO.
|
||
(defn convert-message-to-lightbox-image | ||
[{:keys [timestamp image-width image-height message-id from content]}] | ||
(let [[primary-name _] (rf/sub [:contacts/contact-two-names-by-identity from])] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure an utils function should susbcribe, I think they should be more pure, maybe it can be an additional parameter?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be honest, I see no convenient way to remove this subscription out of the function. It is used within the map in status-im.contexts.chat.messenger.messages.content.album.view
and subscription itself relies on other subs, so can't be easily converted to usual function. I would prefer to leave it "as is" because it encapsulates all the work needed to convert message to image description.
69% of end-end tests have passed
Failed tests (12)Click to expandClass TestGroupChatMultipleDeviceMergedNewUI:
Class TestActivityCenterContactRequestMultipleDevicePR:
Class TestOneToOneChatMultipleSharedDevicesNewUi:
Class TestCommunityOneDeviceMerged:
Class TestDeepLinksOneDevice:
Class TestOneToOneChatMultipleSharedDevicesNewUiTwo:
Expected to fail tests (3)Click to expandClass TestGroupChatMultipleDeviceMergedNewUI:
Class TestCommunityMultipleDeviceMergedTwo:
Class TestCommunityOneDeviceMerged:
Passed tests (33)Click to expandClass TestCommunityMultipleDeviceMerged:
Class TestGroupChatMultipleDeviceMergedNewUI:
Class TestCommunityMultipleDeviceMergedTwo:
Class TestOneToOneChatMultipleSharedDevicesNewUi:
Class TestActivityCenterContactRequestMultipleDevicePR:
Class TestCommunityOneDeviceMerged:
Class TestActivityMultipleDevicePR:
Class TestActivityMultipleDevicePRTwo:
|
fc475e0
to
fd5e426
Compare
fd5e426
to
779d936
Compare
779d936
to
d38ed89
Compare
85% of end-end tests have passed
Failed tests (4)Click to expandClass TestDeepLinksOneDevice:
Class TestGroupChatMultipleDeviceMergedNewUI:
Class TestActivityCenterContactRequestMultipleDevicePR:
Expected to fail tests (3)Click to expandClass TestCommunityMultipleDeviceMergedTwo:
Class TestCommunityOneDeviceMerged:
Class TestGroupChatMultipleDeviceMergedNewUI:
Passed tests (41)Click to expandClass TestCommunityMultipleDeviceMergedTwo:
Class TestCommunityMultipleDeviceMerged:
Class TestCommunityOneDeviceMerged:
Class TestOneToOneChatMultipleSharedDevicesNewUiTwo:
Class TestOneToOneChatMultipleSharedDevicesNewUi:
Class TestActivityCenterContactRequestMultipleDevicePR:
Class TestGroupChatMultipleDeviceMergedNewUI:
Class TestActivityMultipleDevicePR:
Class TestActivityMultipleDevicePRTwo:
|
50% of end-end tests have passed
Failed tests (2)Click to expandClass TestDeepLinksOneDevice:
Passed tests (2)Click to expandClass TestGroupChatMultipleDeviceMergedNewUI:
Class TestActivityCenterContactRequestMultipleDevicePR:
|
@vkjr thanks for your work! Figma |
d38ed89
to
b53d95d
Compare
@qoqobolo, I'd leave this for the followup if you don't mind, wdyt? |
@vkjr sure, would you mind creating an issue for it, please? I also noticed some weird behavior with a couple of collectibles, but I think we'll double check that once #18577 is merged. Please, send it to design review before merging if you think it's needed. |
fixes #17326
Summary
The lightbox screen is a screen for pictures preview.
Before it was used only for previewing sent photos in messages with images.
In the current PR it was untied from message data structures and moved to commons to be reused for previewing collectibles.
Previewing collectible image was made with this screen
Testing notes
Impacted area is image preview in messages and collectible preview
Testing steps
status: ready