Skip to content
This repository was archived by the owner on Jan 11, 2023. It is now read-only.

Animate the SymbolModal's entrance/exit#3415

Merged
codehag merged 7 commits into
firefox-devtools:nextfrom
wldcordeiro:animate-modal
Jul 28, 2017
Merged

Animate the SymbolModal's entrance/exit#3415
codehag merged 7 commits into
firefox-devtools:nextfrom
wldcordeiro:animate-modal

Conversation

@wldcordeiro

@wldcordeiro wldcordeiro commented Jul 22, 2017

Copy link
Copy Markdown
Contributor

Associated Issue: #3234

Summary of Changes

  • Break the Modal itself into it's own component
  • Animate that component
  • Use it in SymbolModal

Test Plan

  • cmd+shift+O to open
  • See the modal slide in
  • escape to close
  • See the modal slide out

Screenshots/Videos

Modal Animated

@codecov

codecov Bot commented Jul 22, 2017

Copy link
Copy Markdown

Codecov Report

Merging #3415 into next will decrease coverage by 0.18%.
The diff coverage is 16%.

Impacted file tree graph

@@           Coverage Diff            @@
##           next    #3415      +/-   ##
========================================
- Coverage    50%   49.81%   -0.19%     
========================================
  Files       107      108       +1     
  Lines      4460     4483      +23     
  Branches    920      919       -1     
========================================
+ Hits       2230     2233       +3     
- Misses     2230     2250      +20
Impacted Files Coverage Δ
src/components/SymbolModal.js 31.53% <100%> (+0.24%) ⬆️
src/components/shared/Modal.js 12.5% <12.5%> (ø)

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 4691d7a...8356b51. Read the comment docs.

@codecov

codecov Bot commented Jul 22, 2017

Copy link
Copy Markdown

Codecov Report

❗ No coverage uploaded for pull request base (next@9b3b2c6). Click here to learn what that means.
The diff coverage is 20.83%.

Impacted file tree graph

@@          Coverage Diff           @@
##             next   #3415   +/-   ##
======================================
  Coverage        ?   51.5%           
======================================
  Files           ?     110           
  Lines           ?    4565           
  Branches        ?     943           
======================================
  Hits            ?    2351           
  Misses          ?    2214           
  Partials        ?       0
Impacted Files Coverage Δ
src/components/shared/Modal.js 10.52% <10.52%> (ø)
src/components/SymbolModal.js 31.53% <60%> (ø)

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 9b3b2c6...14cbd24. Read the comment docs.

@wldcordeiro wldcordeiro force-pushed the animate-modal branch 2 times, most recently from 7cf448d to a7d8f3b Compare July 22, 2017 20:33
@wldcordeiro

Copy link
Copy Markdown
Contributor Author

I'm not sure how to resolve these flow issues as the Modal doesn't really have any typings different from other components. Then as for yarn check, I can't seem to resolve that either. Seems like some dependency of storybook isn't happy with the react version we have?

@codehag

codehag commented Jul 24, 2017

Copy link
Copy Markdown
Contributor

I will take a look again later, but from a quick reading it looks like you are expecting a single node as a child, and passing two.. i will take another look later in the evening.

@jasonLaster jasonLaster left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Very cool. Just concerned about the wrapper overlaying the window.

Comment thread src/components/shared/Modal.js Outdated
return Slide({
in: enabled,
children: status => {
return dom.div(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It might help if the wrapper and modal were siblings. This way the modal could animate onto the <body>.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Not sure I follow. Could you elaborate?

.modal-wrapper.entered,
.modal-wrapper.exiting {
pointer-events: auto;
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

we should avoid having a div overlaying the window at all times.

another strategy might be to use z-index: -1.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good idea on moving the z-index.

@wldcordeiro

Copy link
Copy Markdown
Contributor Author

I will take a look again later, but from a quick reading it looks like you are expecting a single node as a child, and passing two.. i will take another look later in the evening.

@codehag I was looking into how to make a function have variadic arity in Flow but I'm not finding a good resource. 🙁 I'll keep digging.

Comment thread src/components/shared/Modal.css Outdated
z-index: -1;
top: 0;
left: 0;
transition: z-index 0.4s ease-in-out;

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I added this slightly longer transition to the z-index change to make sure we have enough time for the animation to play.

@codehag

codehag commented Jul 25, 2017

Copy link
Copy Markdown
Contributor

fixed up the flow types, was a tough case!

@jasonLaster

Copy link
Copy Markdown
Contributor
➜  debugger.html yarn check
yarn check v0.24.5
warning "chokidar#fsevents#node-pre-gyp@^0.6.36" could be deduped from "0.6.36" to "node-pre-gyp@0.6.36"
error "react-modal#react-dom-factories#react@^15.5.4" doesn't satisfy found match of "react@15.3.2"
error Found 1 errors.
info Visit https://yarnpkg.com/en/docs/cli/check for documentation about this command.

we might need a lower version of transition-group

@wldcordeiro

Copy link
Copy Markdown
Contributor Author

@codehag thanks for that! @jasonLaster the transition-group package.json seems to indicate we would have a good version. https://github.com/reactjs/react-transition-group/blob/master/package.json#L44 We could try rolling back to a different version but the 1.x has a slightly different API so I'd need to modify a bit further.

@jasonLaster

jasonLaster commented Jul 25, 2017 via email

Copy link
Copy Markdown
Contributor

@wldcordeiro

Copy link
Copy Markdown
Contributor Author

I tried dropping to 1.x and still saw the same error. 🙁

@jasonLaster

jasonLaster commented Jul 25, 2017 via email

Copy link
Copy Markdown
Contributor

@wldcordeiro wldcordeiro force-pushed the animate-modal branch 3 times, most recently from cc1140d to 98a6b33 Compare July 26, 2017 01:05
@codehag

codehag commented Jul 26, 2017

Copy link
Copy Markdown
Contributor

I have a fix, just waiting for tests to pass

@codehag

codehag commented Jul 26, 2017

Copy link
Copy Markdown
Contributor

This has been rebased to remove the offending yarn.lock inclusion -- if you modify it please pull this branch first and replace your local branch

@wldcordeiro

Copy link
Copy Markdown
Contributor Author

@codehag I pulled changes, rebased onto next and had to revert the yarn.lock entirely because even removing my dep and regenerating caused the error in yarn check

@codehag

codehag commented Jul 26, 2017

Copy link
Copy Markdown
Contributor

@wldcordeiro try this:

  • go to master
  • delete your local branch
  • checkout your local branch again

this will give you a clean version

I suspect that you still have the old yarn.lock file and that is what is causing the troubles. It is building on CI now, and also locally for me

@wldcordeiro

wldcordeiro commented Jul 26, 2017

Copy link
Copy Markdown
Contributor Author

@codehag @jasonLaster with the changes you've made I think this is ready. I have nothing else I need to modify. There are some changes in the PR though that seem to have come from elsewhere. 🙁

@wldcordeiro

wldcordeiro commented Jul 28, 2017

Copy link
Copy Markdown
Contributor Author

Okay I think now the rebase madness is done.

commit 8ac8235004fb08a1bb0ab43c2f2e704f88ef52b3 (HEAD -> animate-modal, origin/animate-modal)
Author: Wellington Cordeiro <wellington@wellingtoncordeiro.com>
Date:   Tue Jul 25 16:14:25 2017 -0600

    Adjust animation to use Photon recommendations.

commit d59b66d7cdd6d34b7a118d984d466b5772d40e55
Author: Jason Laster <jason.laster.11@gmail.com>
Date:   Tue Jul 25 16:52:08 2017 -0400

    drop duplicate close handler

commit f0a64aba8325f13f8f69dc3b45886f7c031c6633
Author: Wellington Cordeiro <wellington@wellingtoncordeiro.com>
Date:   Tue Jul 25 12:45:55 2017 -0600

    Remove react-transition-group and just do the animation via the enabled prop and CSS

commit f333e84d4f27fdd8e72689ce8ce2421850c3bf43
Author: Jason Laster <jason.laster.11@gmail.com>
Date:   Tue Jul 25 12:33:25 2017 -0400

    fixup yarn

commit d6000c260a7b2dc13041e3c07460f6c44e6ecb50
Author: codehag <yulia.startsev@gmail.com>
Date:   Tue Jul 25 17:54:49 2017 +0200

    make flow happy

commit dcebe99b0ab1585c83a0abaf81f380284201d31d
Author: Wellington Cordeiro <wellington@wellingtoncordeiro.com>
Date:   Mon Jul 24 13:11:30 2017 -0600

    Use z-index rather than pointer-events to move the .modal-wrapper

commit c2fc6b3b88719dcdfc45ce93b3ff05bd1414ca6c
Author: Wellington Cordeiro <wellington@wellingtoncordeiro.com>
Date:   Fri Jul 28 01:06:39 2017 -0600

    Animate symbol modal using react-transition-group

@codehag codehag merged commit 829954d into firefox-devtools:next Jul 28, 2017
@wldcordeiro wldcordeiro deleted the animate-modal branch July 28, 2017 15:44
@wldcordeiro

Copy link
Copy Markdown
Contributor Author

The commit log here leaves evidence that I'm a time traveler. 😆

jasonLaster pushed a commit that referenced this pull request Jul 28, 2017
* Animate symbol modal using react-transition-group

* Use z-index rather than pointer-events to move the .modal-wrapper

* fixup yarn

* Remove react-transition-group and just do the animation via the enabled prop and CSS

* Adjust animation to use Photon recommendations.

* drop duplicate close handler

* make flow happy
jasonLaster pushed a commit to jasonLaster/debugger.html that referenced this pull request Aug 1, 2017
* Animate symbol modal using react-transition-group

* Use z-index rather than pointer-events to move the .modal-wrapper

* fixup yarn

* Remove react-transition-group and just do the animation via the enabled prop and CSS

* Adjust animation to use Photon recommendations.

* drop duplicate close handler

* make flow happy
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants