Skip to content
This repository was archived by the owner on Sep 6, 2021. It is now read-only.

Show reason why live preview was cancelled #2178

Closed
wants to merge 11 commits into from

Conversation

DennisKehrig
Copy link
Contributor

Fixes #1697

@ghost ghost assigned njx Nov 21, 2012
@njx
Copy link

njx commented Nov 26, 2012

Hi Dennis--in a time crunch right now so we probably won't get to this till next sprint. Thanks!

@DennisKehrig
Copy link
Contributor Author

I just rebased this onto master, I hope Github reflects this soon...

@DennisKehrig
Copy link
Contributor Author

"The command "git checkout -qf cc564489a918a8d13a4a644dfb15f5be0b928ec5" failed and exited with 128 during checkout."

Anything I can do?

@DennisKehrig
Copy link
Contributor Author

My Chrome is now at 25.0.1364.97 m and sends the dispatched event! Rebased the pull request onto master.

@DennisKehrig
Copy link
Contributor Author

Rebased

@DennisKehrig
Copy link
Contributor Author

Rebased once more - should another be necessary, I'll wait until prompted.

@njx
Copy link

njx commented Mar 19, 2013

Sorry I haven't gotten back to this. Will try to work on it this sprint.

@DennisKehrig
Copy link
Contributor Author

Cool, thanks! Did another rebase anyway, to get rid of my unnecessary dealing with the Chinese translation + Windows git issues.

@njx
Copy link

njx commented Mar 20, 2013

Finally getting around to this. The error really helps, and I like the basic interaction. However, I ran into a problematic scenario: if the live preview browser overlaps the Brackets window (which is likely on a laptop, especially if you make it bigger in order to use the dev tools), and you spend a little time in the dev tools before switching back to Brackets, you'll never see the twipsy because it fades out before you switch back. We should make it so that if the Brackets window isn't active when the twipsy comes up, it doesn't fade out until after Brackets becomes active again. Could you look into making that change?

@DennisKehrig
Copy link
Contributor Author

Sounds reasonable, I'll look into it!

Conflicts:
	src/LiveDevelopment/LiveDevelopment.js
	src/LiveDevelopment/main.js
… when the live preview has been cancelled in Chrome
@DennisKehrig
Copy link
Contributor Author

@njx Done! Note that I put the window focus detection into twipsy-mod. I first wanted to add it to ViewUtils, but this would have made the jQuery module dependent on it. This way it seemed cleaner - until some other part of the system needs the same. Also I tried it via document.hasFocus() but that returned true even when the Brackets window was not the foreground window.

@@ -301,6 +301,8 @@ define(function Inspector(require, exports, module) {
* -> Inspector.domain.command()
*/
function init(theConfig) {
var result = new $.Deferred();
Copy link

Choose a reason for hiding this comment

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

Looks like this is never used.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, overlooked this when refactoring

@njx
Copy link

njx commented Apr 5, 2013

Detailed review done. The only substantive issue is the one about the error showing up when the user turns off Live Preview him/herself--we should fix that before merging. Otherwise, looks good.

@DennisKehrig
Copy link
Contributor Author

@njx: Thanks for the review! I think it's new behaviour that the popup also appears when the user closes live preview... could be a timing issue where we close the tab before we (would have) cut the connection ourselves.

@DennisKehrig
Copy link
Contributor Author

Hmmm. It appears that usually we are still connected after the window closes, so we do close the connection ourselves. Yet the popup appears. Maybe something changed on Chrome's end.
But it's good that it's this way around, it allows us to set a flag in some way before disconnecting, so we can ignore the detached event in that stage.

@DennisKehrig
Copy link
Contributor Author

Another thing that should be added is a popup if we close the connection ourselves because the user navigates away from the page. On the other hand we might rethink that; if I accidentally click a click and navigate back right away, I'd prefer live preview to still be active.

@njx
Copy link

njx commented May 4, 2013

Hey Dennis--since it's my fault this has been sitting around so long, I went ahead and rebased it onto current master, and added a fix so the twipsy goes to the left of the icon since the toolbar's on the right now. I pushed that up in #3715, so closing this one.

@njx njx closed this May 4, 2013
@DennisKehrig
Copy link
Contributor Author

@njx: Wonderful, I'm sure I will smile when I unsuspectedly see the popup for the first time :)
Thank you!

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.

Take advantage of Chromium reason code for why dev tools connection was aborted
2 participants