-
Notifications
You must be signed in to change notification settings - Fork 3k
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
[Discussion] ReportScreen 2.0 wish list #13793
Comments
getIsReportFullyVisible
To me this piece of code is a bit confusing because it determines whether or not the openReportIfNecessary
ReconnectReportApp/src/pages/home/report/ReportActionsView.js Lines 184 to 194 in 53bc1ea
|
Adapting the
|
shouldComponentUpdate(nextProps, nextState) { | |
if (!_.isEqual(nextProps.reportActions, this.props.reportActions)) { | |
this.sortedReportActions = this.getSortedReportActionsForDisplay(nextProps.reportActions); | |
this.mostRecentIOUReportActionID = ReportActionsUtils.getMostRecentIOUReportActionID(nextProps.reportActions); | |
return true; | |
} | |
if (lodashGet(nextProps.network, 'isOffline') !== lodashGet(this.props.network, 'isOffline')) { | |
return true; | |
} | |
if (nextProps.report.isLoadingMoreReportActions !== this.props.report.isLoadingMoreReportActions) { | |
return true; | |
} | |
if (nextProps.report.isLoadingReportActions !== this.props.report.isLoadingReportActions) { | |
return true; | |
} | |
if (nextProps.report.lastReadSequenceNumber !== this.props.report.lastReadSequenceNumber) { | |
return true; | |
} | |
if (nextState.isFloatingMessageCounterVisible !== this.state.isFloatingMessageCounterVisible) { | |
return true; | |
} | |
if (nextState.newMarkerSequenceNumber !== this.state.newMarkerSequenceNumber) { | |
return true; | |
} | |
if (this.props.isSmallScreenWidth !== nextProps.isSmallScreenWidth) { | |
return true; | |
} | |
if (this.props.isDrawerOpen !== nextProps.isDrawerOpen) { | |
return true; | |
} | |
if (lodashGet(this.props.report, 'hasOutstandingIOU') !== lodashGet(nextProps.report, 'hasOutstandingIOU')) { | |
return true; | |
} | |
if (this.props.isComposerFullSize !== nextProps.isComposerFullSize) { | |
return true; | |
} | |
return !_.isEqual(lodashGet(this.props.report, 'icons', []), lodashGet(nextProps.report, 'icons', [])); | |
} |
I'm not really sure how much of an optimization this is at this point - but it's hard to understand why we are doing all of this and leads to people whitelisting every piece of state
or props
anyway. It feels kind of anti-patterny and we probably just organize things better.
@roryabraham, this Monthly task hasn't been acted upon in 6 weeks; closing. If you disagree, feel encouraged to reopen it -- but pick your least important issue to close instead. |
Coming from this thread.
This issue is really just a placeholder to discuss the current
ReportScreen
andReportActionsView
implementation. We should list out any problems or things that are confusing and have a discussion about how to implement improvements in a holistic way.The text was updated successfully, but these errors were encountered: