Skip to content
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

Transitive styles #366

Merged
merged 13 commits into from
Jun 15, 2021
Merged

Transitive styles #366

merged 13 commits into from
Jun 15, 2021

Conversation

binh-dam-ibigroup
Copy link
Collaborator

@binh-dam-ibigroup binh-dam-ibigroup commented May 19, 2021

This PR modifies code to use new styling props introduced in @opentripplanner/core-utils/transitive-overlays v 1.0.7 (see opentripplanner/otp-ui#246):

  • A new, optional section for transitive is added under example-config.yml#map.
  • A new, optional getTransitiveRouteLabel function to render a route label is introduced in the ComponentContext,
  • Rendering for TransitiveCanvasOverlay is updated accordingly.

EDIT: Example configuration for testing: see https://github.com/ibi-group/configurations/pull/141.

EDIT: This PR should fix #374.

@codecov-commenter
Copy link

Codecov Report

Merging #366 (6d2a97d) into dev (0457a25) will decrease coverage by 1.63%.
The diff coverage is 7.78%.

❗ Current head 6d2a97d differs from pull request most recent head 2842877. Consider uploading reports for the commit 2842877 to get more accurate results
Impacted file tree graph

@@           Coverage Diff            @@
##             dev    #366      +/-   ##
========================================
- Coverage   9.78%   8.14%   -1.64%     
========================================
  Files        115     195      +80     
  Lines       4078    7340    +3262     
  Branches    1077    1843     +766     
========================================
+ Hits         399     598     +199     
- Misses      3191    5805    +2614     
- Partials     488     937     +449     
Impacted Files Coverage Δ
lib/actions/auth.js 0.00% <0.00%> (ø)
lib/actions/call-taker.js 0.00% <0.00%> (ø)
lib/actions/field-trip.js 0.00% <0.00%> (ø)
lib/actions/user.js 0.00% <0.00%> (ø)
lib/components/admin/call-record.js 0.00% <0.00%> (ø)
lib/components/admin/call-taker-controls.js 0.00% <0.00%> (ø)
lib/components/admin/call-taker-windows.js 0.00% <0.00%> (ø)
lib/components/admin/call-time-counter.js 0.00% <0.00%> (ø)
lib/components/admin/draggable-window.js 0.00% <0.00%> (ø)
lib/components/admin/editable-section.js 0.00% <0.00%> (ø)
... and 295 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8a50b67...2842877. Read the comment docs.

Comment on lines 18 to 19
!isEqual(nextProps.activeSearchVisibleItinerary, this.props.activeSearchVisibleItinerary) ||
!isEqual(nextProps.activeSearchResponseOtp, this.props.activeSearchResponseOtp)
Copy link
Contributor

Choose a reason for hiding this comment

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

This could end up being quite an expensive operation because of the deep comparisons done to look at each of these items. It'd be much better to have a simple equality check or at least not check so many items.

Copy link
Contributor

@evansiroky evansiroky left a comment

Choose a reason for hiding this comment

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

It seems there are two overall goals of this PR

  1. Use the getTransitiveRouteLabel function from the ComponentContext
  2. Avoid as many rerenders as possible

However, as noted in the comments, this PR kind of has stuff all over the place and the method in which the shouldComponentUpdate is calculated could actually be a very expensive operation if every part of two objects need to be analyzed. Therefore, I propose an alternate way of doing things that consolidates the code and uses selectors to avoid recomputations. See #370.

@binh-dam-ibigroup
Copy link
Collaborator Author

Ready for review again...

lib/util/state.js Outdated Show resolved Hide resolved
lib/util/state.js Outdated Show resolved Hide resolved
lib/util/state.js Outdated Show resolved Hide resolved
Copy link
Member

@landonreed landonreed left a comment

Choose a reason for hiding this comment

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

Just a few recs in the comments.

@landonreed landonreed removed their assignment May 27, 2021
Copy link
Contributor

@evansiroky evansiroky left a comment

Choose a reason for hiding this comment

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

Contingent upon addressing @landonreed's comments and also on merging in #379.

@evansiroky evansiroky removed their assignment Jun 3, 2021
@landonreed landonreed removed their assignment Jun 11, 2021
lib/util/state.js Outdated Show resolved Hide resolved
Copy link
Contributor

@evansiroky evansiroky left a comment

Choose a reason for hiding this comment

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

Just one little recommended improvement.

@binh-dam-ibigroup binh-dam-ibigroup merged commit 2584b1f into dev Jun 15, 2021
@binh-dam-ibigroup binh-dam-ibigroup deleted the transitive-styles branch June 15, 2021 17:58
@github-actions
Copy link
Contributor

github-actions bot commented Jul 7, 2021

🎉 This PR is included in version 3.1.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Transitive itinerary transient shift
4 participants