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

Fix <HotkeyDialog /> exit animation #221

Merged
merged 19 commits into from
Dec 2, 2016
Merged

Fix <HotkeyDialog /> exit animation #221

merged 19 commits into from
Dec 2, 2016

Conversation

cmslewis
Copy link
Contributor

PR checklist

  • New bugfix

What changes did you make?

Animate the <HotkeyDialog>'s exit transition, per the default <Dialog /> behavior, rather than hiding the dialog immediately.

after

Is there anything you'd like reviewers to focus on?

The DOM is getting cleared and repopulated appropriately with each call to show()/hide():
after-2

But worth investigating more: are we leaking memory with each successive invocation to ReactDOM.render? Do we need to explicitly delete the old instance of the rendered element?

@blueprint-bot
Copy link

Try 1s wait

Preview: docs Coverage: core | datetime

@blueprint-bot
Copy link

Add explanatory comment to the dialog unit test

Preview: docs | table Coverage: core | datetime

@blueprint-bot
Copy link

Merge branch 'master' into cl/hotkey-dialog

Preview: docs Coverage: core | datetime

@cmslewis cmslewis removed their assignment Nov 29, 2016
@cmslewis
Copy link
Contributor Author

@themadcreator can you take a look at this? want to make sure everything looks good by your eyes, since you were the author.

Copy link
Contributor

@themadcreator themadcreator left a comment

Choose a reason for hiding this comment

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

Some minor changes requested

public showing = false;

private container: HTMLElement;
private component: React.Component<any, React.ComponentState>;
Copy link
Contributor

Choose a reason for hiding this comment

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

this is saved off in render but never used AFAICT, so might as well remove it

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done 👍

if (this.container == null) {
this.container = this.getContainer();
}
const element = this.renderComponent();
Copy link
Contributor

Choose a reason for hiding this comment

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

inline this in the next line

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done 👍

@blueprint-bot
Copy link

Fix nits per PR comments

Preview: docs
Coverage: core | datetime

@cmslewis
Copy link
Contributor Author

cmslewis commented Dec 1, 2016

@themadcreator changes addressed. LMK if this looks good now.

Copy link
Contributor

@giladgray giladgray left a comment

Choose a reason for hiding this comment

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

this looks great, just waiting for bill. and one thing about tests that would be great to fix

@@ -114,19 +114,32 @@ describe("Hotkeys", () => {
});

it("triggers hotkey dialog with \"?\"", (done) => {
// this test takes awhile. the hotkey dialog is supposed to take 100ms
Copy link
Contributor

Choose a reason for hiding this comment

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

ugh we really want to avoid unavoidably long tests like this, it just slows the whole thing down.

a better approach would be to assert that props are what you'd expect via the enzyme wrapper, rather than waiting for the DOM to catch up.

Copy link
Contributor

Choose a reason for hiding this comment

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

not only does it slow the test suite down -- it also introduces flakiness because these timeouts are dependent on things like CPU load. I would probably prefer to skip this test until we have test-friendly minimal dialogs

Copy link
Contributor

Choose a reason for hiding this comment

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

@cmslewis please change to it.skip(...) to ignore this test and file an issue to track refactoring it.

Copy link
Contributor Author

@cmslewis cmslewis Dec 2, 2016

Choose a reason for hiding this comment

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

Filed #294

@adidahiya adidahiya modified the milestone: 1.2.0 Dec 2, 2016
@blueprint-bot
Copy link

Edit test to not check for hiding behavior (takes too long)

Preview: docs | table
Coverage: core | datetime

@giladgray giladgray merged commit d381dbb into master Dec 2, 2016
@giladgray giladgray deleted the cl/hotkey-dialog branch December 2, 2016 20:27
@llorca llorca mentioned this pull request Dec 2, 2016
@cmslewis cmslewis restored the cl/hotkey-dialog branch December 6, 2016 00:10
@adidahiya adidahiya deleted the cl/hotkey-dialog branch December 6, 2016 18:53
greglo pushed a commit to greglo/blueprint that referenced this pull request Dec 12, 2016
* Fix HotkeyDialog's closing transition

* Edit test to not check for hiding behavior (takes too long)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants