Migrate Composer. web#23359
Conversation
…composer-fc-web
…composer-fc-web
…into migrate-composer-fc-web
…composer-fc-web
|
@perunt, please fix the lint issues. You can use the lint command from package.json scripts |
|
it's quite weird that optional chaining is prohibited, as I saw it in the code |
| caretContent: this.getNextChars(this.props.value, event.nativeEvent.selection.start), | ||
| }, | ||
| const addCursorPositionToSelectionChange = (event) => { | ||
| flushSync(() => { |
There was a problem hiding this comment.
Could you explain the usage of flushSync here?
There was a problem hiding this comment.
I need to return up-to-date data for positioning an inline autosuggestion within the callback. If we remove flushSync, we will receive an outdated value, which will lag(be delayed) by one value
There was a problem hiding this comment.
I see, thanks for the explanation!
| ref={setTextInputRef} | ||
| selection={selection} | ||
| style={[ | ||
| StyleSheet.flatten([style, {outline: 'none'}]), |
There was a problem hiding this comment.
In some places, implementation is slightly different. Could you explain why these changes? There is no outline: 'none', old code.
There was a problem hiding this comment.
We use the outline in the old code here
do you mean using useMemo for this?
There was a problem hiding this comment.
Thanks, it's ok, I couldn't find this style because git diff changes are going crazy, harder to compare
There was a problem hiding this comment.
Yeah, sometimes it just gets too messy 😄
|
@ArekChr should be good to go |
|
Hey @perunt, it looks like the test steps are missing. Could you update the location where I can check the logs, especially if no errors occur? Thank you! |
There was a problem hiding this comment.
I compared both files separately because the git diff was difficult to follow. It appears that the implementations have slightly changed, e.g. updateNumberOfLines has been removed. Please retain the original logic and only rewrite the class lifecycle methods with hooks, so the outcome will more accurately reflect the original implementation.
…composer-fc-web
|
@ArekChr, any issue here so far? |
Reviewer Checklist
Screenshots/VideosWebScreen.Recording.2023-08-15.at.4.24.42.PM.movMobile Web - ChromeScreen.Recording.2023-08-15.at.4.41.19.PM.movMobile Web - SafariScreen.Recording.2023-08-15.at.4.39.48.PM.movDesktopScreen.Recording.2023-08-15.at.5.02.07.PM.moviOSScreen.Recording.2023-08-15.at.4.58.01.PM.movAndroidScreen.Recording.2023-08-15.at.4.51.17.PM.mov |
allroundexperts
left a comment
There was a problem hiding this comment.
Tests well!
Screen recordings are missing for iOS and android but I'm approving it since this is urgent.
|
It's a WEB-only change, next time will add it. |
mountiny
left a comment
There was a problem hiding this comment.
Thanks for the quick testing @allroundexperts
@perunt Keep an eye on #expensify-bugs in case there is anything new from this refactoring as its quite complex
| checkComposerVisibility: () => false, | ||
| }; | ||
| // Get characters from the cursor to the next space or new line | ||
| const getNextChars = (str, cursorPos) => { |
There was a problem hiding this comment.
I think that would be handy but we can make it in a follow up PR
|
✋ 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/mountiny in version: 1.3.55-0 🚀
|
|
looks like this caused this regression #25409 where if you copy some text, open any RHP then paste it will paste your clipboard contents twice. |
|
And maybe this one: #25413 |
|
🚀 Deployed to staging by https://github.com/mountiny in version: 1.3.56-0 🚀
|
|
🚀 Deployed to production by https://github.com/roryabraham in version: 1.3.56-24 🚀
|
|
Coming from #25413: |
|
This caused Web - App adds extra line in edit message box |
| setSelection((prevSelection) => { | ||
| if (!!prevSelection && selectionProp.start === prevSelection.start && selectionProp.end === prevSelection.end) { | ||
| return; | ||
| } | ||
| return selectionProp; | ||
| }); |
There was a problem hiding this comment.
Coming from #44259, instead of using a set state function updater, we can use setState function directly
Details
Fixed Issues
$ #16129
PROPOSAL:
Tests
Offline tests
QA Steps
This PR updated the composer related to text input only on WEB
Test Case 1: Input Functionality
Test Case 2: Multiline Input Functionality
Test Case 3: Focus Functionality
Test Case 4: Style Functionality
Test Case 5: Message Sending Functionality
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)/** comment above it */thisproperly so there are no scoping issues (i.e. foronClick={this.submit}the methodthis.submitshould be bound tothisin the constructor)thisare necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);ifthis.submitis never passed to a component event handler likeonClick)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
Web
Screen.Recording.2023-07-27.at.14.18.50.mov
Mobile Web - Chrome
telegram-cloud-document-2-5336800175870455938.mp4
Mobile Web - Safari
Screen.Recording.2023-07-27.at.14.46.54.mov
Desktop
Screen.Recording.2023-07-27.at.15.07.41.mov
iOS
Android