-
Notifications
You must be signed in to change notification settings - Fork 3k
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
[Form Provider Refactor] RoomNameInput fixes #32432
[Form Provider Refactor] RoomNameInput fixes #32432
Conversation
Hey! I see that you made changes to our Form component. Make sure to update the docs in FORMS.md accordingly. Cheers! |
d1142ac
to
9fa1591
Compare
Cc. @luacmartins |
<TextInput | ||
<InputWrapper | ||
InputComponent={TextInput} | ||
inputID={inputID} |
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 don't think this is the best to do here. Using InputWrapper
inside RoomNameInput
to wrap TextInput
feels a littler over-engineered. I would rather prefer InputWrapper
to wrap RoomNameInput
. InputWrapper
should wrap the highest-level input.
RoomNameInput > InputWrapper > TextInput
❌
InputWrapper > RoomNameInput > TextInput
✅
PS: We also have a problem with that structure on NewDatePicker
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.
It would look better if we have moved the InputWrapper
outside the component, but that would require dividing the logic of RoomNameInput between the component and screens where it's used. Since the logic of room input is quite complex and the current refactor has already caused some regressions in this PR I would only migrate the input to FormProvider. As soon as we will be sure the current changes won't introduce any regressions I would refactor the RoomNameInput according your suggestions in a separate PR.
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 trying to get rid of the valueParser
and displayParser
that we are passing to the Form. The FromProvider
should not handle those. We should instead call the onInputChange
in the RoomNameInput
and supply the modified value.
This approach should result in the least code changes.
but that would require dividing the logic of RoomNameInput between the component and screens
Can you please elaborate on this one?
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 trying to get rid of the valueParser and displayParser that we are passing to the Form. The FromProvider should not handle those. We should instead call the onInputChange in the RoomNameInput and supply the modified value.
That would be great, but since we need to display different value than the one that is sent to Onyx, I couldn't find any better solution.
The second part I managed to move, I didn't spot that I forgot to move some 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.
we need to display different value than the one that is sent to Onyx
This is already handled within <RoomNameInput />
: value={value.substring(1)}
.
Let's consider this scenario:
- Revert all the changes in this PR
- In places that we use RoomNameInput (i.e. RoomNamePage and WorkspaceNewRoomPage), replace
<RoomNameInput ... />
with<InputWrapper InputComponent={RoomNameInput} ... />
- What could go wrong in 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.
@s77rt Ok, I reverted some changes, I think now it should look fine.
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.
Thanks. This is looking much better. I still see some changes to src/components/RoomNameInput/
that does not look needed. And in src/libs/RoomNameInputUtils.ts
too Can you please check again?
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.
Will do it tomorrow
026ca81
to
c56d3af
Compare
02a3a50
to
f0ac1bd
Compare
Reviewer Checklist
Screenshots/Videos |
We're so close. @kowczarz could you please address the latest comments? Let's get this merged today. |
…name-edit-error # Conflicts: # src/components/Form/FormProvider.js # src/pages/workspace/WorkspaceNewRoomPage.js
Hey @luacmartins, sorry I didn't manage to fix it yesterday, since I had to leave office earlier, but now it's ready. |
@kowczarz Lint please |
730731c
to
31f79a6
Compare
The "Ensure draft works" test can be removed. |
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.
LGTM! Thanks for working on this!
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
🚀 Deployed to staging by https://github.com/luacmartins in version: 1.4.14-0 🚀
|
🚀 Deployed to staging by https://github.com/luacmartins in version: 1.4.14-0 🚀
|
🚀 Deployed to production by https://github.com/jasperhuangg in version: 1.4.14-6 🚀
|
Details
Followup to #30996
Fixed Issues
$ #32398
PROPOSAL: #32398 (comment)
$ #32399
$ #32386
Tests
Workspace new room:
+
button > PressStart chat
> Switch to# Room
-
Room name:
Settings
> PressRoom name
-
Edit room name without change:
Check for consistent errors:
Ensure input can be re-focused:
+
button > Press Start chat > Switch to # RoomOffline tests
Same as above
QA Steps
Same as above
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodWaiting for Copy
label for a copy review on the original GH to get the correct copy.STYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Android: Native
android.native_H.265.mp4
Android: mWeb Chrome
android.web_H.265.mp4
iOS: Native
ios.native_H.265.mp4
iOS: mWeb Safari
ios.web_H.265.mp4
MacOS: Chrome / Safari
web_H.265.mp4
MacOS: Desktop
desktop_H.265.mp4