-
Notifications
You must be signed in to change notification settings - Fork 987
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
feat: implement audio message component #15594
Conversation
Jenkins BuildsClick to see older builds (91)
|
a19692f
to
97d5aec
Compare
f6bd97b
to
4570164
Compare
7c4f809
to
3fd7424
Compare
3fd7424
to
9d844f9
Compare
9d844f9
to
29bfef7
Compare
[react-native.audio-toolkit :as audio] | ||
[re-frame.core :as re-frame])) | ||
|
||
(defonce message |
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.
@briansztamfater, defonce
is unnecessary in pure maps, since they never change.
(defn audio-message | ||
[message context] | ||
(let [player-state (reagent/atom :not-loaded) | ||
progress (reagent/atom 0) |
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.
@briansztamfater, I see progress
is passed along in this file to other functions and it's named as progress-ref
, even though it's not a ref. Refs are non-reactive and usually start as (atom nil)
. If that makes sense, could you rename all instances of progress-ref
to just progress
, for example? I was confused by the suffix ref
when it's a reactive state :)
#(update-state player-state :error))))) | ||
(update-state player-state :preparing)) | ||
|
||
(defn play-pause-player |
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 you tried to separate some of the state management outside the f-audio-message
component, but still @briansztamfater, I'd just like to share some thoughts or suggestions.
- A very good chunk of this namespace is not concerned or doesn't need to know about hiccup, reagent, etc, it's just raw timers and manipulation of atoms. In my experience in other React projects, this is a perfect candidate for a separate hook with good unit tests.
- HTTP effects should happen at re-frame's event layer, ideally.
- If we so desire to reduce usages of
use-effect
, we can also extract the whole state management into re-frame. Of course this is not a trivial task since the code is already written in the style of hooks, but it could lead to the best results.
But to summarize, I think the effectful part should exist as a separate hook, even outside this file, for example in content/audio/hooks.cljs
and unit tested.
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.
@ilmotta As always, thanks for your valuable feedback, and agree with them. As I have another ongoing time consuming task and given that manual testing went fine, I wanted to merge this PR, and created an issue to keep track of this suggestion 👍 #15816
Will make sure to address it as soon as possible!
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.
Thank you for taking the time to create the issue @briansztamfater. I would have done the same, priorities first :)
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.
Nicely done @briansztamfater 🚀! I left some comments I feel are important, but they're not blockers.
c0d3995
to
b88e2c7
Compare
700636c
to
d290a6f
Compare
93% of end-end tests have passed
Failed tests (2)Click to expandClass TestGroupChatMultipleDeviceMergedNewUI:
Class TestCommunityMultipleDeviceMerged:
Passed tests (28)Click to expandClass TestCommunityOneDeviceMerged:
Class TestActivityCenterContactRequestMultipleDevicePR:
Class TestActivityMultipleDevicePR:
Class TestGroupChatMultipleDeviceMergedNewUI:
Class TestCommunityMultipleDeviceMerged:
Class TestOneToOneChatMultipleSharedDevicesNewUi:
|
LGTM, @briansztamfater thanks for your work! |
Signed-off-by: Brian Sztamfater <[email protected]>
d290a6f
to
e5913cc
Compare
fixes: #13530 #15536
Summary
Audio message component implementation
Screenshots
Testing notes
In #13530, these items were listed to be resolved. Those not checked should be worked separately in follow up issues / PRs.
Should be implemented separately:
Platforms
Areas that maybe impacted
Functional
Steps to test
status: ready