-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Fix scrolling to bottom list on MoneyRequestReportView #59664
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix scrolling to bottom list on MoneyRequestReportView #59664
Conversation
@@ -66,8 +64,6 @@ import getInitialNumToRender from './getInitialNumReportActionsToRender'; | |||
import ListBoundaryLoader from './ListBoundaryLoader'; | |||
import ReportActionsListItemRenderer from './ReportActionsListItemRenderer'; | |||
|
|||
type LoadNewerChats = DebouncedFunc<(params: {distanceFromStart: number}) => void>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 I fixed the minor mistake and moved 1 extra line to inside the function, left the rest unchanged. Will try to check if I can reproduce the weird error |
@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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is usePrevious
hook
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small suggestion
src/components/MoneyRequestReportView/MoneyRequestReportActionsList.tsx
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. |
Make scrolling to bottom and unread message marker work on MoneyRequestReportView.
Explanation of Change
setTimeout
Fixed Issues
$ #58808
PROPOSAL:
Tests
Offline tests
QA Steps
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)src/languages/*
files and using the translation methodSTYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label and/or tagged@Expensify/design
so the design team can review the changes.ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.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