Skip to content

Commit

Permalink
Merge branch 'feat/#Expensify#23220-web-maintainVisibleContentPositio…
Browse files Browse the repository at this point in the history
  • Loading branch information
perunt committed Jan 8, 2024
2 parents 5a9bd2f + 54921a9 commit 7febd4a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 18 deletions.
10 changes: 0 additions & 10 deletions .github/workflows/reassurePerformanceTests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,21 +29,11 @@ jobs:
BASELINE_BRANCH=${BASELINE_BRANCH:="main"}
git fetch origin "$BASELINE_BRANCH" --no-tags --depth=1
git switch "$BASELINE_BRANCH"
# Clear node_modules and reinstall dependencies
rm -rf node_modules
npm install --force
npx patch-package
npx reassure --baseline
git switch --force --detach -
git merge --no-commit --allow-unrelated-histories "$BASELINE_BRANCH" -X ours
# Repeat clearing node_modules and reinstalling for the feature branch
rm -rf node_modules
npm install --force
npx patch-package
npx reassure --branch
- name: Validate output.json
Expand Down
10 changes: 9 additions & 1 deletion src/pages/home/report/ReportActionsList.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import withCurrentUserPersonalDetails, {withCurrentUserPersonalDetailsDefaultPro
import withWindowDimensions, {windowDimensionsPropTypes} from '@components/withWindowDimensions';
import useLocalize from '@hooks/useLocalize';
import useNetwork from '@hooks/useNetwork';
import useReportScrollManager from '@hooks/useReportScrollManager';
import useThemeStyles from '@hooks/useThemeStyles';
import compose from '@libs/compose';
import DateUtils from '@libs/DateUtils';
Expand Down Expand Up @@ -139,7 +140,6 @@ function ReportActionsList({
loadOlderChats,
onLayout,
isComposerFullSize,
reportScrollManager,
listID,
onContentSizeChange,
}) {
Expand All @@ -158,6 +158,7 @@ function ReportActionsList({
};
const platform = getPlatform();
const isNative = platform === CONST.PLATFORM.IOS || platform === CONST.PLATFORM.ANDROID;
const reportScrollManager = useReportScrollManager();
const [currentUnreadMarker, setCurrentUnreadMarker] = useState(markerInit);
const scrollingVerticalOffset = useRef(0);
const readActionSkipped = useRef(false);
Expand Down Expand Up @@ -260,6 +261,13 @@ function ReportActionsList({
});
}, [report.reportID]);

useEffect(() => {
InteractionManager.runAfterInteractions(() => {
reportScrollManager.scrollToBottom();
});
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);

useEffect(() => {
// Why are we doing this, when in the cleanup of the useEffect we are already calling the unsubscribe function?
// Answer: On web, when navigating to another report screen, the previous report screen doesn't get unmounted,
Expand Down
7 changes: 0 additions & 7 deletions src/pages/home/report/ReportActionsView.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import withWindowDimensions, {windowDimensionsPropTypes} from '@components/withW
import useCopySelectionHelper from '@hooks/useCopySelectionHelper';
import useInitialValue from '@hooks/useInitialValue';
import usePrevious from '@hooks/usePrevious';
import useReportScrollManager from '@hooks/useReportScrollManager';
import useWindowDimensions from '@hooks/useWindowDimensions';
import compose from '@libs/compose';
import getIsReportFullyVisible from '@libs/getIsReportFullyVisible';
Expand Down Expand Up @@ -173,7 +172,6 @@ const useHandleList = (linkedID, messageArray, fetchFn, route, isLoading) => {
function ReportActionsView({reportActions: allReportActions, fetchReport, ...props}) {
useCopySelectionHelper();
const reactionListRef = useContext(ReactionListContext);
const reportScrollManager = useReportScrollManager();
const route = useRoute();
const {reportActionID} = getReportActionID(route);
const didLayout = useRef(false);
Expand Down Expand Up @@ -239,10 +237,6 @@ function ReportActionsView({reportActions: allReportActions, fetchReport, ...pro
return;
}
openReportIfNecessary();

InteractionManager.runAfterInteractions(() => {
reportScrollManager.scrollToBottom();
});
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);

Expand Down Expand Up @@ -391,7 +385,6 @@ function ReportActionsView({reportActions: allReportActions, fetchReport, ...pro
isLoadingInitialReportActions={props.isLoadingInitialReportActions}
isLoadingOlderReportActions={props.isLoadingOlderReportActions}
isLoadingNewerReportActions={props.isLoadingNewerReportActions}
reportScrollManager={reportScrollManager}
policy={props.policy}
listID={listID}
onContentSizeChange={onContentSizeChange}
Expand Down

0 comments on commit 7febd4a

Please sign in to comment.