Skip to content

Conversation

landonreed
Copy link
Contributor

@landonreed landonreed commented Oct 16, 2020

Checklist

  • Appropriate branch selected (all PRs must first be merged to dev before they can be merged to master)
  • Any modified or new methods or classes have helpful JSDoc and code is thoroughly commented
  • The description lists all applicable issues this PR seeks to resolve
  • The description lists any configuration setting(s) that differ from the default settings
  • All tests and CI builds passing

Description

This PR does a few things:

  • fixes Editor freezes when adding stops for certain patterns #617
  • improves the process for adding stops by name to a pattern (see screenshot 1)
  • DRYs out shared code for the dropdown that adds a stop to a pattern
  • adds feedback to user about pattern stops that are too far from the pattern shape (see screenshot 2)
  • adds a shared type for Style props

Screenshot 1: Adding a stop by name

image

Screenshot 2: feedback about pattern stops

image

Copy link
Contributor

@binh-dam-ibigroup binh-dam-ibigroup left a comment

Choose a reason for hiding this comment

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

LGTM. Just a refactor suggestion regarding the multiple addIndex - 1 and addIndex - 2 instances.

Comment on lines 95 to 96
this._matchesStopAtIndex(addIndex - 2) ||
this._matchesStopAtIndex(addIndex - 1)
Copy link
Contributor

Choose a reason for hiding this comment

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

I would extract addIndex - 2 and addIndex - 1 into consts with comments.

@binh-dam-ibigroup binh-dam-ibigroup removed their assignment Oct 19, 2020
@evansiroky evansiroky assigned landonreed and unassigned evansiroky Oct 19, 2020
@codecov-io
Copy link

Codecov Report

Merging #618 into dev will decrease coverage by 27.94%.
The diff coverage is 0.96%.

Impacted file tree graph

@@             Coverage Diff             @@
##              dev     #618       +/-   ##
===========================================
- Coverage   43.46%   15.52%   -27.95%     
===========================================
  Files         323      324        +1     
  Lines       17603    16663      -940     
  Branches     5368     5072      -296     
===========================================
- Hits         7652     2587     -5065     
- Misses       8676    12012     +3336     
- Partials     1275     2064      +789     
Flag Coverage Δ
#end_to_end_tests ?
#unit_tests 15.52% <0.96%> (-0.14%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
lib/common/components/Loading.js 46.15% <ø> (-46.16%) ⬇️
lib/editor/components/MinuteSecondInput.js 0.00% <ø> (-40.75%) ⬇️
lib/editor/components/VirtualizedEntitySelect.js 0.00% <ø> (-58.98%) ⬇️
lib/editor/components/map/AddableStop.js 0.00% <0.00%> (ø)
lib/editor/components/map/pattern-debug-lines.js 0.00% <0.00%> (-59.46%) ⬇️
...ditor/components/pattern/AddPatternStopDropdown.js 0.00% <0.00%> (ø)
lib/editor/components/pattern/EditShapePanel.js 0.00% <0.00%> (-19.24%) ⬇️
...ib/editor/components/pattern/PatternStopButtons.js 0.00% <0.00%> (-2.33%) ⬇️
lib/editor/components/pattern/PatternStopsPanel.js 0.00% <0.00%> (-38.64%) ⬇️
lib/editor/selectors/index.js 0.00% <0.00%> (-41.00%) ⬇️
... and 280 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 646dfcf...c0257d5. Read the comment docs.

@landonreed landonreed merged commit 0d2cb4a into dev Oct 20, 2020
@landonreed landonreed deleted the fix-pattern-stop-issue branch October 20, 2020 15:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Editor freezes when adding stops for certain patterns

4 participants