Change Display Name to Functional Component#20953
Conversation
|
@aimane-chnaif Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
|
@srikarparsi is this ready for review? Lint failing. |
|
Hi @aimane-chnaif, I just added it as a draft to finish working on later but I should get this ready to review today and will ping you once I do. |
|
Hi @gedu! I tried addressing the feedback in this comment but didn't completely understand one thing. Why can't |
|
@aimane-chnaif @gedu, can we make this useCallback have an empty dependency array? containerLayout and childRefs don't change except when the component is mounted so not sure if we have to include them in the dependency array. |
No problem as long as it doesn't need recalculation during component lifecycle. but just make sure to add additional comment (https://github.com/Expensify/App/blob/main/contributingGuides/STYLE.md#what-is-the-exhaustive-deps-lint-rule-can-i-ignore-it). |
Because the component |
|
Hi @gedu! I tried finding a couple of ways to avoid using the lambda function but I couldn't find any good ones. The only option I could come find is |
Yes, first I would split the component because if Then in the And you use it like: Hope this makes sense |
|
Thanks for the tip @gedu! I went ahead with your advice and created a bridge function within the map so that we're not re-creating the getTooltipShiftX function on multiple renders. I did keep it all in the same component though since I didn't think it was worth creating a new UserToolTipItem component to handle this functionality. I also do agree that we should split the component based on tooltipEnabled but I think this should be done in a different PR as I think it would make sense to focus on just the refactor to a functional component. Do you think you could take a look at this whenever you get a chance? @gedu @aimane-chnaif |
|
@srikarparsi you have a Lint error, you can't have |
Just notice this, In my opinion, there is no better time than now while refactoring the component, you don't even have to create a new file, can be in the same file, but well I think could be @aimane-chnaif call |
created a function for usertooltipitem
Yeah that is true I agree, I'll ask internally to make sure that refactoring components as a whole can be done with refactoring to functional components as we usually like to keep PRs focussed and will make the change if all is okay. I'll also fix lint with this change. |
aimane-chnaif
left a comment
There was a problem hiding this comment.
There are several lint errors to fix
Screen.Recording.2023-07-20.at.7.30.00.AM.mov
|
Hi @aimane-chnaif, yeah I changed the title to "WIP (work in progress)" because I was working on some other bugs but I'll fix these and re-request review tomorrow or the day after. |
|
I think it is in good shape, great job migrating the component. I'm not in a C+ role, just supporting here so the final call will be from @aimane-chnaif , who will be checking and testing deeper than me |
|
Hi @aimane-chnaif, can you please take a look at this whenever you get a chance |
|
reviewing shortly |
|
bump @aimane-chnaif |
|
Hi @aimane-chnaif, did you have a chance to look at this? If you're busy, please let me know and I can ask if there are other C+s who have a spare cycle. |
|
I will review this by end of this week |
|
Thanks @aimane-chnaif, made those changes so this is ready for re-review. |
Reviewer Checklist
Screenshots/VideosWebweb.movDesktopdesktop.mov |
|
@PauloGasparSv Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
PauloGasparSv
left a comment
There was a problem hiding this comment.
LGTM, tested on Web too and is working fine!
|
✋ 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/PauloGasparSv in version: 1.3.56-0 🚀
|
|
🚀 Deployed to production by https://github.com/roryabraham in version: 1.3.56-24 🚀
|
| setIsEllipsisActive( | ||
| containerRef.current && containerRef.current.offsetWidth && containerRef.current.scrollWidth && containerRef.current.offsetWidth < containerRef.current.scrollWidth, | ||
| ); | ||
| }, []); |
There was a problem hiding this comment.
Ellipsis is not updated when the fullTitle prop is changed which is lead to this issue - #27545




Details
Fixed Issues
$ #16141
Tests
Offline tests
QA Steps
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
Mobile Web - Chrome
Mobile Web - Safari
Desktop
iOS
Android