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

feat(ripple): Implement subset of improved interaction response guide… #363

Closed

Conversation

cristobalchao
Copy link
Contributor

feat(ripple): Implement subset of improved interaction response guidelines for ripple

Resolves #190

@cristobalchao cristobalchao force-pushed the feat/implement-improved-interaction-guidelines-new branch from 148a0ec to 0947879 Compare February 28, 2017 19:12
@cristobalchao cristobalchao force-pushed the feat/implement-improved-interaction-guidelines-new branch 2 times, most recently from 3e110bf to d65cf1b Compare March 1, 2017 00:01
@cristobalchao cristobalchao requested a review from sgomes March 1, 2017 22:47
Copy link
Contributor

@traviskaufman traviskaufman left a comment

Choose a reason for hiding this comment

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

I think that these changes need some tests to go along with them to cover the new logic introduced in the source file

@@ -146,12 +148,20 @@ export default class MDCRippleFoundation extends MDCFoundation {

activationState.isActivated = true;
activationState.isProgrammatic = e === null;
activationState.isTimeoutDeactivated = false;
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this, as well as isProgrammatic, need to be added to the return value of defaultActivationState_()

activationState.activationEvent = e;
activationState.wasActivatedByPointer = activationState.isProgrammatic ? false : (
e.type === 'mousedown' || e.type === 'touchstart' || e.type === 'pointerdown'
);

activationState.activationStartTime = Date.now();

activationState.deactivationTimeout = setTimeout(() => {
Copy link
Contributor

Choose a reason for hiding this comment

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

same comment as above

@cristobalchao cristobalchao force-pushed the feat/implement-improved-interaction-guidelines-new branch from d65cf1b to 7eceb51 Compare March 2, 2017 00:47
@cristobalchao
Copy link
Contributor Author

All issues addressed PTAL

Copy link
Contributor

@traviskaufman traviskaufman left a comment

Choose a reason for hiding this comment

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

Will there be any updates to the unbounded ripple interaction? I don't see any changes to its UX, nor do I see any tests for the unbounded deactivation classes.

@@ -101,6 +101,43 @@ testFoundation('runs deactivation UX on public deactivate() call', ({foundation,
td.verify(adapter.addClass(cssClasses.FG_BOUNDED_ACTIVE_FILL));
});

testFoundation('runs deactivation UX mousedown pressed for longer than deactivation timeout',
Copy link
Contributor

Choose a reason for hiding this comment

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

so for both of these, the tests will actually exit before the setTimeout() code is executed. This is because the tests execute synchronously, so by the time that setTimeout code runs, the test will be finished and any exceptions will be swallowed.

To prevent this, you can use lolex, which we use in our codebase to mock JS timers. You can see examples of this in the following tests:

mockRaf.flush();

setTimeout(() => {
td.verify(adapter.removeClass(cssClasses.BG_ACTIVE));
Copy link
Contributor

Choose a reason for hiding this comment

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

Not exactly sure how these tests are different from the ones above...

Should this be verifying that these adapter methods are not called before DEACTIVATION_TIMEOUT_MS?

@cristobalchao
Copy link
Contributor Author

cristobalchao commented Mar 8, 2017

All issues addressed PTAL

@@ -53,4 +53,5 @@ export const numbers = {
UNBOUNDED_TRANSFORM_DURATION_MS: 200,
PADDING: 10,
INITIAL_ORIGIN_SCALE: 0.6,
DEACTIVATION_TIMEOUT_MSL: 200,
Copy link
Contributor

@traviskaufman traviskaufman Mar 9, 2017

Choose a reason for hiding this comment

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

looks like this should be named DEACTIVATION_TIMEOUT_MS instead of DEACTIVATION_TIMEOUT_MSL

cristobalchao@google.com and others added 11 commits March 10, 2017 11:55
The "Make Indeterminate" button in the JS checkbox demo is currently not
working because the "indeterminate" property is being set on the
checkbox _root_ element, rather than the native instance. This commit
fixes that.

Skipping TravisCI as this is a change to the demo only.

[ci skip]
- Update scripts/pre-release.sh with correct publish command
- Update CONTRIBUTING.md releasing section with guidance on what to do
  when a release goes awry.

[ci skip]
@googlebot
Copy link

So there's good news and bad news.

👍 The good news is that everyone that needs to sign a CLA (the pull request submitter and all commit authors) have done so. Everything is all good there.

😕 The bad news is that it appears that one or more commits were authored by someone other than the pull request submitter. We need to confirm that they're okay with their commits being contributed to this project. Please have them confirm that here in the pull request.

Note to project maintainer: This is a terminal state, meaning the cla/google commit status will not change from this state. It's up to you to confirm consent of the commit author(s) and merge this pull request when appropriate.

@cristobalchao cristobalchao deleted the feat/implement-improved-interaction-guidelines-new branch March 14, 2017 22:25
@cristobalchao cristobalchao restored the feat/implement-improved-interaction-guidelines-new branch March 14, 2017 22:25
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.

5 participants