Remove onyx.connect from DraftCommentUtils#70409
Remove onyx.connect from DraftCommentUtils#70409danieldoglas merged 41 commits intoExpensify:mainfrom
Conversation
…to remove-onyxconnect-from-draft-comment-utils
…to remove-onyxconnect-from-draft-comment-utils
…to remove-onyxconnect-from-draft-comment-utils
…to remove-onyxconnect-from-draft-comment-utils
|
@DylanDylann 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] |
|
@kubabutkiewicz Please fix failed GH actions |
src/pages/home/report/ReportActionCompose/ComposerWithSuggestions/ComposerWithSuggestions.tsx
Outdated
Show resolved
Hide resolved
…to remove-onyxconnect-from-draft-comment-utils
|
@kubabutkiewicz Please ping me when this PR is ready again |
|
@DylanDylann Will do it 👍 |
…to remove-onyxconnect-from-draft-comment-utils
…to remove-onyxconnect-from-draft-comment-utils
| // Rule disabled intentionally - reports should be sorted only when the reportsToDisplayInLHN changes | ||
| // eslint-disable-next-line react-compiler/react-compiler, react-hooks/exhaustive-deps | ||
| [reportsToDisplayInLHN, localeCompare], | ||
| [deepComparedReportsToDisplayInLHN, localeCompare], |
There was a problem hiding this comment.
@kubabutkiewicz It seems we’ve run into an interesting case with the failed test.
-
Regarding your solution, let’s take a closer look. In perf: optimize useSidebarOrderedReports hook #68038, it looks like the author forgot to update the dependency. Since eslint is disabled on that line, this missing was overlooked. cc @OlimpiaZurek @hoangzinh (tag you because you guys worked on perf: optimize useSidebarOrderedReports hook #68038)
-
What’s more puzzling is why this failed test doesn’t occur on main. That’s still a question I haven’t been able to answer.
There was a problem hiding this comment.
If @OlimpiaZurek can confirm that we can update the dependency from reportsToDisplayInLHN to deepComparedReportsToDisplayInLHN, then I think we can move forward and set aside my second point above.
On the other hand, if not, we’ll need to dig deeper into point 2 to clarify it which could take quite a bit of time.
There was a problem hiding this comment.
I recall it will cause this bug if we use deepComparedReportsToDisplayInLHN as dependency
There was a problem hiding this comment.
@hoangzinh Thanks for the reminder. @kubabutkiewicz Look like we need to revert this line
There was a problem hiding this comment.
hey, yeah I will confirm if this bug is still there firstly if yes I will revert this line and try to figure out the solution
There was a problem hiding this comment.
@DylanDylann I pushed new fix for test, I checked it locally and the test is passing, and I dont see this problem which @hoangzinh mentioned
…to remove-onyxconnect-from-draft-comment-utils
…to remove-onyxconnect-from-draft-comment-utils
|
@kubabutkiewicz I’m writing to ask for a main merge 😄 |
| // Rule disabled intentionally - reports should be sorted only when the reportsToDisplayInLHN changes | ||
| // eslint-disable-next-line react-compiler/react-compiler, react-hooks/exhaustive-deps | ||
| [deepComparedReportsToDisplayInLHN, localeCompare], | ||
| [deepComparedReportsToDisplayInLHN, localeCompare, deepComparedReportsDrafts], |
There was a problem hiding this comment.
Why do we need to add deepComparedReportsDrafts to dependency list? It is intentional to keep reportsToDisplayInLHN and localeCompare only in the dependency list (see detail here: #63980)
There was a problem hiding this comment.
Yes I am on it, earlier without deepComparedReportsDrafts there was a problem that when we add the draft message, the LHN wasnt updated, I want to check it but have some problems with running the native app locally
There was a problem hiding this comment.
Ok, I was able to test this, so without deepComparedReportsDrafts in the dependecy array we are not sorting the LHN items when we add draft to some report, so I think it needs to be there + also tests for useSidebarOrderedReports is passing which means that this hook only rerenderes when the report id is changing which is what we want
…to remove-onyxconnect-from-draft-comment-utils
…to remove-onyxconnect-from-draft-comment-utils
danieldoglas
left a comment
There was a problem hiding this comment.
is it possible to break this down into smaller PRs?
…to remove-onyxconnect-from-draft-comment-utils
|
@danieldoglas I think its not possible for this PR, we are removing module DraftCommentsUtils, and we need to adjust all the places which are using this module at once :( |
|
@danieldoglas Sorry for the inconvenience. The changes gradually expanded during the review process. We’ll make sure to split big PRs better in future PRs. Since this one is almost complete, could we proceed with it here for now? Many thanks |
|
✋ 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/danieldoglas in version: 9.2.30-0 🚀
|
|
🚀 Deployed to production by https://github.com/mountiny in version: 9.2.30-6 🚀
|
Explanation of Change
Fixed Issues
$ #66308
PROPOSAL:
Tests
Offline tests
QA Steps
// TODO: These must be filled out, or the issue title must include "[No QA]."
Same as tests
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.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: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
MacOS: Desktop