-
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
fix: polish new chat #19054
fix: polish new chat #19054
Conversation
Jenkins BuildsClick to see older builds (64)
|
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.
Nice stuff! Just left a couple of comments, lmk what you think and I'll re-review soon.
Also is it possible to see a screenshot or gif of the results plz? 🙏
@@ -1,10 +1,12 @@ | |||
(ns status-im.common.contact-list.view | |||
(:require | |||
[quo.core :as quo] | |||
[quo.theme :as quo.theme] |
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.
tiny comment: we may be able to have just [quo.theme]
instead of [quo.theme :as quo.theme]
src/react_native/gesture.cljs
Outdated
[{:keys [sections render-section-header-fn render-fn] :as props}] | ||
[{:keys [sections sticky-section-headers-enabled render-section-header-fn render-fn] | ||
:or {sticky-section-headers-enabled true} | ||
:as props}] |
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'm wondering 🤔
Is it safe to default sticky-section-headers-enabled
to true? It seems this has not been supported until now, so maybe it needs to be an opt-in value instead of an opt-out. Thoughts?
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.
For section lists, sticky headers are enabled by default. This implementation uses FlatList
under the hood (from gesture handler) because the normal section list from react native wouldn't work (the gestures do not work) in the context of a bottom sheet (this case).
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.
Ah I see, that makes sense, thanks for the explanation 🙏
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.
Nice stuff! ✅
src/react_native/gesture.cljs
Outdated
@@ -95,13 +95,25 @@ | |||
(into [{:title title :header? true}] data)) | |||
sections)) | |||
|
|||
(defn find-sticky-indices |
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.
should we make it private?
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.
Yeah, makes sense to have it private
@@ -1,10 +1,12 @@ | |||
(ns status-im.common.contact-list.view | |||
(:require | |||
[quo.core :as quo] | |||
[quo.theme :as theme] |
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.
please use [quo.theme]
as theme
will class with the prop name
@@ -2,7 +2,7 @@ | |||
(:require | |||
[quo.core :as quo] | |||
[quo.foundations.colors :as colors] | |||
[quo.theme :as quo.theme] | |||
[quo.theme :as theme] |
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 here
60359cd
to
a9a47c4
Compare
12% of end-end tests have passed
Failed tests (41)Click to expandClass TestCommunityMultipleDeviceMergedTwo:
Class TestOneToOneChatMultipleSharedDevicesNewUiTwo:
Class TestCommunityOneDeviceMerged:
Class TestDeepLinksOneDevice:
Class TestActivityMultipleDevicePR:
Class TestGroupChatMultipleDeviceMergedNewUI:
Class TestOneToOneChatMultipleSharedDevicesNewUi:
Class TestCommunityMultipleDeviceMerged:
Class TestActivityCenterContactRequestMultipleDevicePR:
Class TestActivityMultipleDevicePRTwo:
Expected to fail tests (1)Click to expandClass TestCommunityOneDeviceMerged:
Passed tests (6)Click to expandClass TestOneToOneChatMultipleSharedDevicesNewUiTwo:
Class TestCommunityOneDeviceMerged:
|
8f3eaf5
to
4dadb15
Compare
[react-native.core :as rn] | ||
[status-im.common.contact-list.style :as style])) | ||
|
||
(defn contacts-section-footer |
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.
nice
[rn/view (style/contacts-section-header (= index 0)) | ||
[quo/divider-label title]]) | ||
[{:keys [title]}] | ||
(let [theme (quo.theme/use-theme-value)] |
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.
im not sure this is efficient, could you elaborate on why the header has a different color?
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.
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.
as we have our own implementation of section-list do you think if would be possible to set the theme as a prop to section-list and pass it to the header?
20b6a07
to
6a54804
Compare
94% of end-end tests have passed
Failed tests (2)Click to expandClass TestGroupChatMultipleDeviceMergedNewUI:
Class TestOneToOneChatMultipleSharedDevicesNewUi:
Expected to fail tests (1)Click to expandClass TestCommunityOneDeviceMerged:
Passed tests (45)Click to expandClass TestActivityMultipleDevicePR:
Class TestActivityMultipleDevicePRTwo:
Class TestOneToOneChatMultipleSharedDevicesNewUiTwo:
Class TestOneToOneChatMultipleSharedDevicesNewUi:
Class TestDeepLinksOneDevice:
Class TestCommunityMultipleDeviceMerged:
Class TestCommunityMultipleDeviceMergedTwo:
Class TestCommunityOneDeviceMerged:
Class TestActivityCenterContactRequestMultipleDevicePR:
Class TestGroupChatMultipleDeviceMergedNewUI:
|
88acac0
to
d98fdfd
Compare
@BalogunofAfrica I've checked your fixes and they are fine from my side. I move PR to design review by @Francesca-G . |
src/react_native/gesture.cljs
Outdated
(defn- find-sticky-indices | ||
[data] | ||
(->> data | ||
(map-indexed (fn [index item] (if (:header? item) index nil))) |
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.
(if (:header? item) index nil)
=> (when (:header? item) index)
src/react_native/gesture.cljs
Outdated
[data] | ||
(->> data | ||
(map-indexed (fn [index item] (if (:header? item) index nil))) | ||
(filter (complement nil?)) |
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.
(remove nil?)
instead of (filter (complement nil?))
has better readability
[rn/view])]) | ||
(let [customization-color (rf/sub [:profile/customization-color])] | ||
[rn/touchable-opacity | ||
{:on-press (when on-press on-press)} |
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.
just {:on-press on-press}
will work fine as well
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.
Looks good now ✨
@BalogunofAfrica thanks for addressing the other issues separately!
32d79e7
to
55673ea
Compare
Fixes #18981
Fixes #19202
Summary
Polishes the new chat UI/Sheet
gesture/section-list
which is implemented usinggesture/flat-list (Flatlist)
fromreact-native-gesture-handler
Platforms
Functional
Non-functional
Steps to test
status: ready