Fix scrolling to bottom list on MoneyRequestReportView#59664
Fix scrolling to bottom list on MoneyRequestReportView#59664mountiny merged 13 commits intoExpensify:mainfrom
Conversation
| import ListBoundaryLoader from './ListBoundaryLoader'; | ||
| import ReportActionsListItemRenderer from './ReportActionsListItemRenderer'; | ||
|
|
||
| type LoadNewerChats = DebouncedFunc<(params: {distanceFromStart: number}) => void>; |
There was a problem hiding this comment.
noticed this was unused
2d77809 to
82fcf4c
Compare
| * This function decides whether the given report action (message) should have the new marker indicator displayed | ||
| * It's used for the standard "chat" Report and for `MoneyRequestReport` actions lists. | ||
| */ | ||
| const shouldDisplayNewMarkerOnReportAction = ({ |
There was a problem hiding this comment.
this function was extracted from ReportActionsList almost without change - I'm just passing down arguments so that it can be reused in 2 places.
No logic changes are intended for ReportActionsList
|
@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] |
82fcf4c to
6335519
Compare
|
Cleaned and ready for review |
|
Will run a test build 🚀 |
|
🚧 @shawnborton has triggered a test app build. You can view the workflow run here. |
This comment has been minimized.
This comment has been minimized.
|
Hmm this doesn't feel like a viable solution to me... the LHN shows a loading bar after I send a comment, and there is a delay in scrolling me down the page: CleanShot.2025-04-09.at.10.53.24.mp4cc @mountiny for thoughts, but this doesn't feel like smooth UX to me. |
|
The loading bar we can probably disable - if that is what you think makes more sense - this more of an oversight on my part. The delay in scrolling to bottom however will be more problematic. In "normal" chats we use the reverse list, and what to you is bottom is really the top of the list and so scrolling there works much better. |
|
Cool, yeah I think in the very least removing the LHN loader would help it feel a little smoother |
|
New message indicator should only appear if the message come from another user. If the new action from the current user, we shouldn't display the new message indicator Screen.Recording.2025-04-09.at.18.08.03.mov |
|
I will come back to this tomorrow to update and fix things |
6335519 to
d2dc97c
Compare
|
@DylanDylann I manged to fix the unreadIndicator, I believe it now behaves same as on normal chats rec-scrolling-web.mp4However the request from Shawn to disable loading bar is not yet done, because this Loading bar is kinda global and unrelated to search, and I need more time ot make this work. |
Done in order to make the view feel more fluid and less jumpy.
|
@DylanDylann ready for re-review. @shawnborton at this point the Loading bar is disable on Report in Search/Reports context, however I did not modify any behaviour related to scrolling to bottom. |
|
Will spin up a new testie for us 🚀 |
|
🚧 @shawnborton has triggered a test app build. You can view the workflow run here. |
|
@DylanDylann confirming that I can repro this mweb error on android emulator: #59664 (comment) Seems to be coming from here: Line 203 in dbd0421 I also cannot reproduce it on main :/ not sure what happens here and why |
|
Opsss.... You mean it comes from our change. |
|
Ok @DylanDylann For now I think we don't have to block this PR. rec-error.mp4 |
|
@mountiny What do you think? Are we good to merge and fix above error later in another PR? |
src/components/MoneyRequestReportView/MoneyRequestReportActionsList.tsx
Outdated
Show resolved
Hide resolved
src/components/MoneyRequestReportView/MoneyRequestReportActionsList.tsx
Outdated
Show resolved
Hide resolved
| const reportActionSize = useRef(visibleReportActions.length); | ||
| const lastAction = visibleReportActions.at(-1); | ||
| const lastActionIndex = lastAction?.reportActionID; | ||
| const previousLastIndex = useRef(lastActionIndex); |
There was a problem hiding this comment.
There is usePrevious hook
There was a problem hiding this comment.
thanks, I agree with you, but at this point I'd prefer to keep code the same both inMoneyRequestReportActionsList and standard ReportActionsList.
I will add this comment to another issue where I will be de-duplicating common code and fix it there.
src/components/MoneyRequestReportView/MoneyRequestReportActionsList.tsx
Outdated
Show resolved
Hide resolved
mountiny
left a comment
There was a problem hiding this comment.
This is already large and complex change so I would avoid adding more complexity by the optional es lint fixes
|
@mountiny looks like this was merged without a test passing. Please add a note explaining why this was done and remove the |
|
Noted above, due to the existing complexity of the pr we have skipped the optional eslint changes to the touched file |
|
✋ 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: 9.1.29-0 🚀
|
|
cc @Kicu |
|
🚀 Deployed to production by https://github.com/marcaaron in version: 9.1.29-10 🚀
|
|
Looking |
|
sorry I in fact did not look - will do so tomorrow, since I got more work on my other PR than expected. |
| // Scan through each visible report action until we find the appropriate action to show the unread marker | ||
| for (let index = startIndex; index >= endIndex; index--) { | ||
| const reportAction = visibleReportActions.at(index); | ||
| const nextAction = visibleReportActions.at(index - 1); |
There was a problem hiding this comment.
The logic in ReportActionsList loops up and here it is in reverse so we needed to check if index > 0 here. Fixed in #65918
Make scrolling to bottom and unread message marker work on MoneyRequestReportView.
Explanation of Change
setTimeoutFixed Issues
$ #58808
PROPOSAL:
Tests
Offline tests
QA Steps
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))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
rec-andr.mp4
Android: mWeb Chrome
iOS: Native
rec-ios.mp4
iOS: mWeb Safari
MacOS: Chrome / Safari
rec-web.mp4
MacOS: Desktop