[Form Provider Refactor] RoomNameInput fixes#32432
[Form Provider Refactor] RoomNameInput fixes#32432luacmartins merged 16 commits intoExpensify:mainfrom
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.
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.
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.
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.
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.
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.
@s77rt Ok, I reverted some changes, I think now it should look fine.
There was a problem hiding this comment.
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.
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. |
luacmartins
left a comment
There was a problem hiding this comment.
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 Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)myBool && <MyComponent />.src/languages/*files and using the translation methodWaiting for Copylabel for a copy review on the original GH to get the correct copy.STYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG))Avataris modified, I verified thatAvataris working as expected in all cases)ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.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