-
-
Notifications
You must be signed in to change notification settings - Fork 41
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
Forbid from displaying pop-up windows during image export #66
Conversation
@JamesCropcho @etpinard shall we add |
Can someone please tell me what |
@etpinard My understanding is that when |
src/app/runner/coerce-opts.js
Outdated
@@ -15,7 +15,7 @@ function coerceOpts (_opts = {}) { | |||
const opts = {} | |||
|
|||
opts.debug = !!_opts.debug | |||
opts._browserWindowOpts = {} | |||
opts._browserWindowOpts = { show: false } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably best to set show: opts.debug
for debugging purposes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, I have done this.
Yep, good catch 🎣 |
Okay, I have done this. I did not do so initially because @jmmease claimed he did not. It is there now. |
src/component/plotly-graph/render.js
Outdated
@@ -154,7 +154,8 @@ function toPDF (imgData, imgOpts, bgColor) { | |||
return new Promise((resolve, reject) => { | |||
let win = remote.createBrowserWindow({ | |||
width: wPx, | |||
height: hPx | |||
height: hPx, | |||
show: false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@etpinard Okay, I have addressed all createBrowserWindow()
calls, as well as leveraged opts.debug
.
I am unsure if my changes are sound. May they please be evaluated?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I won't have time to test this out today. Hopefully tomorrow morning.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello, @etpinard. I was wondering if you managed to evaluate these aforementioned changes of mine, which by own admission, I am unsure if they are sound.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No. But looks like @jmmease did.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@etpinard It does not appear to me, at least, as though @jmmease did. Rather, he appears to have manually tested Image-Exporter's functionality. If that will suffice for you, of course at your discretion you need not perform the evaluation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well from #66 (comment) and #66 (comment) you agreed to incorporate a few more things in this PR, correct?
I'll test this out when all the pieces are here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that is correct, @etpinard. I am working on it now, in fact, and I can happily replicate some of @jmmease's examples of behavior.
I fear I am being unclear. I'm saying that when I made these referenced changes I felt like I was on very unsure footing. This concern is independent of the manually-testable behavior of the my changes.
Once again, you may perform only manual functionality testing at your discretion, of course. I'm replying to you here, to ensure that you're doing so with the understanding of where I was coming from.
I will continue to work on this pull request and I will strive to continue to make progress.
… should set show: opts.debug."
When I perform a png conversion from the command line I see no window
But for a PDF I still get a window
If I hardcode Is there anything I should do from the command line to cause |
I have two additional related suggestions for your consideration in this PR @JamesCropcho @jackparmer @etpinard @chriddyp
On Windows and Linux, setting this to Note: I'm on OS X so I can't test this directly, as the dock is not considered a taskbar (See below)
Note: I believe these settings only take effect after the application is bundled, so I don't expect it to change the behavior of running Thanks for considering. I know I'm being a perfectionist here :-) |
Great finds @jmmease ! @JamesCropcho can you please incorporate Jon's feedback into this PR? |
@jackparmer Yes, certainly. I will do so. |
…efined` as true. This commit performs like casting to a Boolean.
…window from displaying in the taskbar, which I believe to be desirable for making image export a seamless experience for Windows and Linux Python/R users. I think this change would just involve adding the skipTaskbar option everywhere the show option is added."
…lectron-userland/electron-builder#1456) to add "extendInfo": {"LSUIElement": 1} to the top-level mac configuration settings"
@jackparmer I have incorporated all of Jon's feedback into this PR, as per your request. @jmmease, could you kindly examine my recent commits and ensure they adhere to both the letter and spirit of your proposals? |
Everything is working well on OS X. No windows popup during export to at least Also, I merged this branch with #63, called I looked through the code, and my only comment is I'm curious if there was a reason not to include Can someone on Linux/Windows confirm that the electron application doesn't show (or even flicker) in the taskbar during export of cc: @jackparmer @etpinard |
I've noticed that running the AppImage version now prints out the message:
I don't remember this happening before. |
Thank you for your review, Jon.
Presumably
I am fine with that, if everyone else is. |
@JamesCropcho Yes, I see that now. Thanks for explaining. I too noticed an error/warning message (I can't reproduce it at the moment). For me, it only occurred the very first time I ran the command after building it, and it didn't appear to interfere with the export itself. That doesn't trouble me personally. So this lgtm. Thanks to all for being open to my feedback (and for choosing to open source this in the first place!). I'm really excited to have this on the Python side, it fills in a missing piece that has prevented some people (perhaps many people) from settling on plotly.py as their primary visualization library. |
This is looking amazing. It might be nice to ask someone to test this out on Windows before merging this thing. Does anyone know someone with access to a Windows machine? |
@etpinard I am able to dual-boot into Windows 10 Pro on my development machine, and I can perform specific tests in that environment upon request. I do not believe I have Git, Powershell or other such tooling present, however. |
@JamesCropcho I'd merge this PR into #63 and test the Windows installer that AppVeyor builds. |
@n-riesco Could you give me a command(s) you'd like me to execute, specifying which shell to do so in, and optionally specify anything in particular I should look for? |
@JamesCropcho First, you need a JSON file that defines a plotly chart (I used this one. After running the Windows installer, I'm guessing, an executable named
Ping me on slack if you need more help. |
@n-riesco I will use the build at https://ci.appveyor.com/project/JamesCropcho/image-exporter/build/0.1.270/artifacts, and the JSON file you suggested. I hope to report back to you within the hour. |
Hello @n-riesco, I'll recap what happened here. I ran the installer. I got this: ...however all was otherwise seemingly okay., The installation did not add an executable to the path, at least in the out-of-box Command Prompt. I still found the executable, and ran it. It worked, even if I had to press
I then ran a command analogous to your recommendation:
Sadly, the command seems to have not created no output file, (nor any in-terminal output no displayed above). I must offer the caveat, that I really do not know Windows well at all. In hindsight, I'm not suitable to test these things, because I could have done wrong some complete beginners' mistake. Still, here is my report. |
@JamesCropcho Does it work with other formats? svg? png? |
@n-riesco I experienced identical behavior when attempting to create PNG and SVG output. |
Ok well, we probably don't have to have a working Windows executable for our @JamesCropcho would you mind merge |
… should set show: opts.debug."
…efined` as true. This commit performs like casting to a Boolean.
…window from displaying in the taskbar, which I believe to be desirable for making image export a seamless experience for Windows and Linux Python/R users. I think this change would just involve adding the skipTaskbar option everywhere the show option is added."
…lectron-userland/electron-builder#1456) to add "extendInfo": {"LSUIElement": 1} to the top-level mac configuration settings"
…er into forbid-popup-windows
Happily. I have done as requested. |
OK @JamesCropcho not sure what happened when you merge |
Hold on. I'm seeing changes from #63 in https://github.com/plotly/image-exporter/pull/63/files This will mess up our commit history. @JamesCropcho can you open up a another PR with just the changes you made in |
I believe I did successfully merge master. As always, if there's some different way you'd like me to do something, let me know. More to the point of your request: okay, I have found that this is the commit on this branch/PR which is immediately prior the merge commit: f81ff05. Next I have found the diff of that revision of that branch relative to
All are in Manually reverting the changes in package.json in a branch off this revision mentioned at the top, the difference between that and my new branch is indeed just the package.json changes: f81ff05...just-changes-in-src-from-forbid-popup-windows The PR as described above has been created, at #72. |
Yes you did. But you also added 7 commits with no new content in the process. |
Okay, please pardon me there. Ironically, due to a recent uptick in concern about signal in revision history, I decided to rebase rather than merge, to avoid creating the merge commit. Again ironically, it sounds like that would have in fact been the cleaner method. |
Ironically, you find adding 7 commits new-content-less commits better for revision history than one single merge commit. Moreover, please never rebase (and |
@etpinard Will do!
Please pardon again: by the "that" I refer to above, I'm trying to say the merge (your way) would have been cleaner than a rebase (my way) after all. |
Hello,
This pull requested created at the behest of @jackparmer (at #65 (comment)).
cc: @jmmease @etpinard @n-riesco
How does it look?
―James