Add progress/result window to the Bug Report flow with a GitHub issue shortcut - #48980
Conversation
Replace the silent 30s wait + end-of-run message box with a small native window that shows an animated 'Generating bug report...' state while PowerToys.BugReportTool.exe runs. When it finishes, the window shows where the .zip was saved and offers 'Open folder' and 'Report on GitHub' actions. The GitHub action opens the prefilled bug_report.yml issue template and reveals the .zip in Explorer so the user can drag it into the issue (GitHub has no API to pre-attach files to an issue). The window is shared by both triggers (tray menu + Settings) since it lives in the runner, uses the canonical foreground-steal recipe so it surfaces even when launched from Settings, and adds no WinUI/binary payload. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The failed/done header could be a long localized sentence; give it a two-line height and a slightly larger window so it wraps instead of being clipped at the window edge. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR improves the Runner’s Bug Report experience by adding a lightweight native (Win32) progress/result window around PowerToys.BugReportTool.exe, including shortcuts to reveal the generated .zip and open the GitHub bug-report issue template.
Changes:
- Replaces the previous hidden execution + message box with a native progress/result dialog that stays open after generation.
- Adds dialog UI strings to Runner resources and wires the dialog into the existing Bug Report flow.
- Updates Runner project files to compile the new dialog implementation.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/runner/runner.vcxproj.filters | Adds the new dialog .cpp/.h to the project filters. |
| src/runner/runner.vcxproj | Includes bug_report_dialog.cpp/.h in the Runner build. |
| src/runner/Resources.resx | Adds localized strings for the progress/result dialog UI. |
| src/runner/bug_report.cpp | Switches bug report launch to run_bug_report_dialog(...) and uses a callback to clear running state. |
| src/runner/bug_report_dialog.h | Declares the dialog entry point and callback contract. |
| src/runner/bug_report_dialog.cpp | Implements the modeless Win32 dialog, tool process execution, and result handling. |
|
Niels Laute (@niels9001) Nice! Could an indeterminate progress bar be added while the tool is working? Just to visualize that work is in progress -- with the Close button, it looks like a message box, and some people won't read the fine print before clicking. |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Comments suppressed due to low confidence (1)
src/runner/bug_report.cpp:67
- When launch_bug_report() is called while a report is already running, the else-branch notifies observers with isRunning=false. This can incorrectly clear the tray/menu/settings “running” indicators even though the existing bug report is still in progress.
else
{
notify_observers(false);
}
|
Jiří Polášek (@jiripolasek) Thanks! I looked into this — a real (marquee) progress bar would mean pulling Common Controls v6 into the runner, and I'd rather not take on that process-wide dependency just for this dialog. The header already animates the "Generating…" dots, so there's a live indicator that work is happening. I'll keep it as-is for now. |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Suppressed comments (3)
src/runner/bug_report_dialog.cpp:455
FindNewestReportcan report an old archive as the result of this run. The Bug Report tool logs tar/rename failures without propagating all of them (tools/BugReportTool/BugReportTool/ZipTools/zipfolder.cpp:45-52), so it can exit with code 0 even when no new ZIP was created; this unrestricted lookup then selects any previousPowerToysReport_*.zipand enables both actions for the wrong file. Snapshot the matching files before launch (or require a write time/name created after launch) and only accept a newly created archive.
const std::wstring zip = (exitCode == 0) ? FindNewestReport(desktop) : std::wstring{};
src/runner/bug_report_dialog.cpp:353
- The runner is PerMonitorV2-aware, but the dialog is permanently laid out using system DPI and the primary monitor work area, with no
WM_DPICHANGEDrelayout. On mixed-DPI systems it opens on the primary monitor rather than beside the invoking Settings window, and moving it to another monitor leaves the custom-sized controls/fonts at the old scale. Initialize from the foreground monitor's work area/DPI and handleWM_DPICHANGEDto rebuild or relayout the controls.
st.dpi = GetDpiForSystem();
src/runner/bug_report_dialog.cpp:484
- This unconditional clear can erase a newer dialog's handle. After this window is destroyed, another launch can observe the stale invalid HWND, create/store its own window, and then this older thread reaches this line and stores
nullptr; subsequent launches can create additional dialogs. Clear only if the atomic still contains this window's handle.
g_dialogWnd.store(nullptr);
| std::error_code ec; | ||
| for (const auto& entry : fs::directory_iterator(folder, ec)) | ||
| { |
Summary of the Pull Request
Adds a small, native progress/result window to the Bug Report flow so users get feedback while the report is generated and a one-click path to file a GitHub issue.
Previously, triggering "Report bug" (from the tray menu or Settings → General) ran
PowerToys.BugReportTool.exehidden for ~30 seconds with no feedback at all, then popped a plain message box. Many users then had to manually find the.zipand figure out where to file the issue.Now the runner shows a lightweight window that:
.zipwas saved (…\Desktop\PowerToysReport_<timestamp>.zip) in a read-only, copyable field..zipin Explorer) and Report on GitHub (opens the prefilledbug_report.ymlissue template and reveals the.zipso it can be dragged into the issue).Recording.2026-06-28.140652.mp4
PR Checklist
src/runner/Resources.resxand loaded viaGET_RESOURCE_STRING.bug_report_dialog.cpp/.hcompile into the existingPowerToys.exe(runner). No new WinUI app or DLL, so no signing/WXS/CI changes required.Detailed Description of the Pull Request / Additional comments
src/runner/bug_report_dialog.{h,cpp}implement the window as plain Win32 (no Common Controls v6 dependency, no managed/WinUI payload), so it works for both entry points since it lives in the runner.bug_report.cppnow callsrun_bug_report_dialog(...)instead of the silent run + message box. The "running" state (observed by Settings) is cleared as soon as the tool process exits, so the result window can stay open without keeping the Settings button spinning. A guard re-focuses an already-open window instead of starting a second report.AttachThreadInputforeground recipe so it reliably surfaces even when launched from Settings (a different foreground process), and gets a taskbar button so it stays findable during the ~30s run.PowerToysReport_*.zipin the Desktop folder after the tool exits (the tool names the file internally with a timestamp).Validation Steps Performed
.zippath with working Open folder and Report on GitHub buttons..zipin Explorer and Report on GitHub opens the prefilledbug_report.ymlissue template with the.ziphighlighted for drag-and-drop.runner(ARM64, Debug) clean; verified end-to-end on a high-DPI display.