OfficeDev / Office-Samples

Scenario-focused sample add-ins that help you get started with building Office add-in.
MIT License
9 stars 12 forks source link

devkit: multiple UI prompts when running web-worker sample #100

Open davidchesnut opened 1 week ago

davidchesnut commented 1 week ago

After using the devkit to create a project from the Excel-Add-in-Custom-Function-Using-WebWorker there are multiple UI prompts that are not documented and are confusing.

To Reproduce

On Windows 11.

Steps to reproduce the behavior:

  1. Use the devkit to create a new project from Excel-Add-in-Custom-Function-Using-WebWorker.
  2. Choose "Preview your Office Add-in" and Excel (Edge Chromium)

At this point you will see the following popup window in VS Code. image

When the web server is running that prompt goes away. This could be confusing to a developer thinking they should click on something.

Next the terminal window will show: image Should we document this?

Next you will see the following popup from Windows 11. image

When you click OK Excel finally shows the task pane.

The custom functions do not work. So the sample is broken.

When you close Excel you see the following prompt in VS Code image

Again confusing if the developer should do anything but it goes away once debugger is shut down.

hermanwenhe commented 6 days ago

This bug occurred recently. Considering we didn't update office-addin-scripts packages lately, it might be from the update of VSCode or even Windows. Can you use Dev Kit to create an new add-in template and see if it occurs? If so, it should be a bug to yeoman template (the options in "create new add-in" all come from yo-office branch of our templates) or office-addin-debugging package.

hermanwenhe commented 6 days ago

@Rick-Kirkham @darrelmiller Pls help look at this issue. Recently I got multiple feedbacks from different people in different hosts (Word/Excel) about this UI prompt. Both through samples and yo-office templates. It looks like the preLaunchTask "Debug XXX Desktop" does not exit correctly, which hangs the execution of launch "XXX Desktop (Edge Chrominum)".

Rick-Kirkham commented 6 days ago

@Rick-Kirkham @darrelmiller Pls help look at this issue. Recently I got multiple feedbacks from different people in different hosts (Word/Excel) about this UI prompt. Both through samples and yo-office templates. It looks like the preLaunchTask "Debug XXX Desktop" does not exit correctly, which hangs the execution of launch "XXX Desktop (Edge Chrominum)".

Did you mean to mention @millerds ?

Rick-Kirkham commented 6 days ago

The WebView Stop on Load prompt is normal. All sideloading docs should tell users to expect it.

hermanwenhe commented 5 days ago

The WebView Stop on Load prompt is normal. All sideloading docs you tell users to expect it.

Stop on load prompt is normal. The weird one is the "Waiting for preLaunchTask"

millerds commented 5 days ago

"Waiting for preLaunchTask" is a VS Code dialog. I have not noticed this dialog before and it's possibly a recent add by VS Code, but you've have to look at their changes to be sure when it was added. Seems like anytime a pre and post action isn't instantaneous these will display and our process (setting up dev-server, (un)registering the add-in, launching the host, etc.) does take a little bit of time. We need to do these things and don't control VS Code behavior (note the same dialog don't show when running 'npm run start').

The extra terminals have been there for as long as I've worked on these and we haven't received any complaint about them before. Some of this behavior is controlled by the tasks.json properties "presentation" nodes, but it partly controlled by VS Code and how it runs tasks. The output from the commands being run as part of the pre and post process is put in the alternate terminal windows so as not to clutter the main terminal window when it's open. This is controlled by VS Code.

I think we need to be careful how much we try and document VS Code behavior (these things will happen no office projects as well) vs. things specific to add-ins projects. Aside from potentially inflating our own documentation, we could easily get out of sync with VS Code.