Skip to content

feat: show last message while loading others #47243

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

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 24 additions & 1 deletion src/pages/home/ReportScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ import type * as OnyxTypes from '@src/types/onyx';
import {isEmptyObject} from '@src/types/utils/EmptyObject';
import isLoadingOnyxValue from '@src/types/utils/isLoadingOnyxValue';
import HeaderView from './HeaderView';
import ReportActionsListItemRenderer from './report/ReportActionsListItemRenderer';
import ReportActionsView from './report/ReportActionsView';
import ReportFooter from './report/ReportFooter';
import type {ActionListContextType, ReactionListRef, ScrollPosition} from './ReportScreenContext';
Expand Down Expand Up @@ -723,6 +724,7 @@ function ReportScreen({route, currentReportID = '', navigation}: ReportScreenPro
// After creating the task report then navigating to task detail we don't have any report actions and the last read time is empty so We need to update the initial last read time when opening the task report detail.
Report.readNewestAction(report.reportID);
}, [report]);
const firstReportAction = reportActions[0];

return (
<ActionListContext.Provider value={actionListValue}>
Expand Down Expand Up @@ -791,7 +793,28 @@ function ReportScreen({route, currentReportID = '', navigation}: ReportScreenPro
{/* Note: The ReportActionsSkeletonView should be allowed to mount even if the initial report actions are not loaded.
If we prevent rendering the report while they are loading then
we'll unnecessarily unmount the ReportActionsView which will clear the new marker lines initial state. */}
{shouldShowSkeleton && <ReportActionsSkeletonView />}
{shouldShowSkeleton && (
<>
<ReportActionsSkeletonView />
{!!firstReportAction && (
<ReportActionsListItemRenderer
reportAction={firstReportAction}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While report is loading the UI break the Export Button on action. #51763

reportActions={reportActions}
parentReportAction={parentReportAction}
parentReportActionForTransactionThread={undefined}
transactionThreadReport={undefined}
index={0}
report={report}
displayAsGroup={false}
shouldHideThreadDividerLine
shouldDisplayNewMarker={false}
shouldDisplayReplyDivider={false}
isFirstVisibleReportAction
shouldUseThreadDividerLine={false}
/>
)}
</>
)}

{isCurrentReportLoadedFromOnyx ? (
<ReportFooter
Expand Down
Loading