Skip to content

Shortcut Guide V2 - #40834

Merged
Niels Laute (niels9001) merged 192 commits into
mainfrom
feature/shortcutguidev2
May 21, 2026
Merged

Niels Laute (niels9001) merged 192 commits into
mainfrom
feature/shortcutguidev2

Conversation

@noraa-junker

@noraa-junker Noraa Junker (noraa-junker) commented Jul 27, 2025 •

Copy link
Copy Markdown
Collaborator

Summary of the Pull Request

shortcutguidev2.mp4

PR Checklist

Detailed Description of the Pull Request / Additional comments

Work for future PRs:

  • Localization of built-in shortcut files
  • Further customization (we can wait on user feedback for that)
  • Reimplement holding windows key
  • Search bar
Images
Recording.2025-10-27.211717.mp4
image image image image

Validation Steps Performed

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@noraa-junker

Copy link
Copy Markdown
Collaborator Author

Niels Laute (@niels9001) Although the spell checker reports errors, the CI check actually passes so this could be merged

@lei9444
leileizhang (lei9444) enabled auto-merge (squash) May 21, 2026 06:55
@github-actions

This comment has been minimized.

@yeelam-gordon

Copy link
Copy Markdown
Contributor

A couple of practices worth checking before merge:

1. Telemetry regression (0 ETW events in V2 vs. 2 in V1)

V1 emits two ETW events via src/modules/ShortcutGuide/ShortcutGuide/trace.cpp:

  • ShortcutGuide_GuideSession — duration + close type
  • ShortcutGuide_Settings — hotkey, opacity, theme, disabled apps, win-key timing

V2 wires up the plumbing but never actually emits anything. ShortcutGuideModuleInterface/dllmain.cpp still calls send_settings_telemetry(), which spawns the UI with the telemetry argument:

cpp virtual void send_settings_telemetry() override { Logger::trace(""Send settings telemetry""); if (!StartProcess(L""telemetry"")) { ... } }

…but ShortcutGuide.Ui/Program.cs just logs and exits without calling TraceLoggingWrite:

csharp if (args.Length >= 2 && args[1] == ""telemetry"") { // Telemetry-only invocation: send settings telemetry and exit silently. Logger.LogInfo(""Telemetry mode requested. Exiting.""); return; }

Result: no session or settings telemetry from V2. Worth porting at least the two existing events so dashboards/data-driven decisions don't go dark.

2. Mixing WPF and WinUI 3 in the UI process

ShortcutGuide.Ui/Program.cs pulls in using System.Windows; and uses System.Windows.MessageBox.Show(...) from inside what is otherwise a WinUI 3 / Windows App SDK app. The MessageBox call also runs before the WinUI dispatcher is created, which means it blocks the launching thread (the module interface's process-start path) on a WPF modal.

Suggest replacing with a WinUI ContentDialog (or just logging + early exit) to avoid pulling WPF into the WinUI3 process and to avoid blocking the spawning thread on startup error.

@noraa-junker

Copy link
Copy Markdown
Collaborator Author

Gordon Lam (@yeelam-gordon) For 1, does readding the same telemetry events make sense regarding that this Shortcut Guide works very differently from the old one?

For 2, This messagebox is only shown in very rare occasions and it does not matter if it blocks WinUi, because the program exits right after that anyway.

- Add ShortcutGuideSettingsEvent and ShortcutGuideSessionEvent ETW events
  matching V1's ShortcutGuide_Settings and ShortcutGuide_GuideSession events
- Wire send_settings_telemetry to actually emit settings via managed telemetry
- Track session duration and close type in MainWindow, emit on close
- Replace System.Windows.MessageBox with Logger.LogError (removes WPF from
  this WinUI 3 process; the error was invisible to users anyway since the
  process is background-launched by the module interface)
- Add ManagedTelemetry project reference

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@MuyuanMS

Copy link
Copy Markdown
Contributor

Addressed telemetry regression and WPF dependency in bc1fdbe:

  1. Telemetry regression fixed — V2 now emits both ETW events that V1 had:

    • \ShortcutGuide_Settings\ (hotkey, theme, disabled apps) — emitted when the module interface calls \send_settings_telemetry()\
    • \ShortcutGuide_GuideSession\ (duration, close type) — emitted when the main window closes
  2. WPF MessageBox removed — Replaced \System.Windows.MessageBox.Show()\ with \Logger.LogError()\ + early exit. This removes PresentationFramework from the WinUI 3 process (the error message was invisible to users anyway since the process is background-launched by the module interface).

@github-actions

Copy link
Copy Markdown

check-spelling-bot Report

🔴 Please review

See the 📂 files view, the 📜action log, 👼 SARIF report, or 📝 job summary for details.

Unrecognized words (4)

DWRITE
LWIN
VCENTER
VREDRAW

These words are not needed and should be removed ABlocked AClient AColumn ACR ADate ADifferent AHybrid ALarger AModifier ANull AOklab APeriod ARandom ARemapped ASingle ASUS bck BNumber BOklab BVal BValue CAtl CCom CContext CDeclaration CElems Chunghwa CImage CMock CPower CSearch CSettings CSOT CStyle CTest CVal CVirtual DArchitectures DComposition defaulttonearest diu DSVG dwrite EAccess EFile EInvalid ENot EProvider ESettings FErase FInc FMask FNumber FRestore GNumber GValue Hann HHmmssfff Hostx HPhysical HSpeed HSync HVal HValue HWP IPREVIEW ITHUMBNAIL IVO kdc LExit LPCFHOOKPROC LPrivate LReader LUMA LVal lwin MMdd MRT MSHCTX MSHLFLAGS Nanjing newcolor NLog oldcolor outsourced PBlob PElems PHL pinboard PStr PToy QDS RAlt RAquadrant rectp RKey RNumber scanled suntimes Tianma UBreak UCallback UError UFlags UHash UMax UMin unsubscribes UOffset UType vcenter VDesktop vredraw VSpeed VSync WBounds WClass workerw WReserved XAxis XButton XDeployment XDimension XDocument XElement XFile XIncrement XLoc XNamespace XPels XPixel XPos XResource XSpeed XStr XTimer YAxis YDimension YIncrement YPels YPos YResolution YSpeed YStr YTimer

To accept these unrecognized words as correct and remove the previously acknowledged and now absent words, you could run the following commands

... in a clone of the git@github.com:microsoft/PowerToys.git repository
on the feature/shortcutguidev2 branch (ℹ️ how do I use this?):

curl -s -S -L 'https://raw.githubusercontent.com/check-spelling/check-spelling/cfb6f7e75bbfc89c71eaa30366d0c166f1bd9c8c/apply.pl' |
perl - 'https://github.com/microsoft/PowerToys/actions/runs/26222650830/attempts/1' &&
git commit -m 'Update check-spelling metadata'

OR

To have the bot accept them for you, comment in the PR quoting the following line:
check-spelling-bot apply updates.

If the flagged items are 🤯 false positives

If items relate to a ...

  • binary file (or some other file you wouldn't want to check at all).

    Please add a file path to the excludes.txt file matching the containing file.

    File paths are Perl 5 Regular Expressions - you can test yours before committing to verify it will match your files.

    ^ refers to the file's path from the root of the repository, so ^README\.md$ would exclude README.md (on whichever branch you're using).

  • well-formed pattern.

    If you can write a pattern that would match it,
    try adding it to the patterns.txt file.

    Patterns are Perl 5 Regular Expressions - you can test yours before committing to verify it will match your lines.

    Note that patterns can't match multiline strings.

@noraa-junker

Copy link
Copy Markdown
Collaborator Author
image

The number to keyboard letter does not seem to work anymore.

@niels9001

Copy link
Copy Markdown
Collaborator
image The number to keyboard letter does not seem to work anymore.

Lets address in a follow up pr!

@niels9001
Niels Laute (niels9001) merged commit 9699d8a into main May 21, 2026
16 checks passed
@niels9001
Niels Laute (niels9001) deleted the feature/shortcutguidev2 branch May 21, 2026 15:27
Boliang Zhang (LegendaryBlair) added a commit that referenced this pull request May 22, 2026
## Summary

Fixes the **stable** signed release pipeline failure (Dart build
[`147590319`](https://microsoft.visualstudio.com/Dart/_build/results?buildId=147590319))
at the *"Verify all binaries are signed and versioned"* task on both
`Build Release_x64` and `Build Release_arm64`:

```
Not Signed: + …\extractedMachineMsi\File\WinUI3ApplicationsFiles_File_YamlDotNet.dll
```

## Root cause

PR #40834 (*Shortcut Guide V2*) added a `YamlDotNet` `PackageReference`
to:

- `src/modules/ShortcutGuide/ShortcutGuide.Ui/ShortcutGuide.Ui.csproj`
-
`src/modules/ShortcutGuide/ShortcutGuide.IndexYmlGenerator/ShortcutGuide.IndexYmlGenerator.csproj`

Both projects publish into `WinUI3Apps\`, so `YamlDotNet.dll` is
harvested into the MSI by
`installer/PowerToysSetupVNext/generateAllFileComponents.ps1`. The PR
updated `ESRPSigning_core.json` for its own new binaries but missed this
3rd-party transitive dependency, so ESRP never signs it and
`.pipelines/versionAndSignCheck.ps1` correctly fails the build.

## Fix

One additive line to `.pipelines/ESRPSigning_core.json`, placing
`WinUI3Apps\YamlDotNet.dll` next to the other 3rd-party `WinUI3Apps\`
entries (`Google.Apis.*`, `Google.GenAI.dll`, `ReverseMarkdown.dll`,
`SharpCompress.dll`, …).

## Validation

- `git diff` shows exactly one additive line.
- File still parses as valid JSON (`ConvertFrom-Json` round-trip OK).
- Both ShortcutGuide csprojs target
`$(Platform)\$(Configuration)\WinUI3Apps`, so a single
`WinUI3Apps\YamlDotNet.dll` entry covers all uses.

## Follow-up

After merge to `main`, cherry-pick / merge into `stable` so build
`147590319` can be re-queued and the 0.100 release pipeline can proceed.

Co-authored-by: Copilot <Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Boliang Zhang (LegendaryBlair) added a commit that referenced this pull request May 25, 2026
…48058)

## Summary

Fixes the **stable** signed release pipeline failure (Dart build
[`147621162`](https://microsoft.visualstudio.com/Dart/_build/results?buildId=147621162))
at the *"Verify all binaries are signed and versioned"* task:

```
Not Signed: + …\extractedMachineMsi\File\BaseApplicationsFiles_File_PowerAccent.Common.dll
```

## Root cause

PR #47211 (*"[Quick Accent] Move language data to PowerAccent.Common
library, refactor"*) introduced the new managed library:

- `src/modules/poweraccent/PowerAccent.Common/PowerAccent.Common.csproj`

`PowerAccent.Common.dll` is referenced by both `PowerAccent.Core` (ships
in the installer root) and `PowerToys.Settings` (ships in WinUI3Apps;
deduplicated against root by `generateAllFileComponents.ps1`). The DLL
is harvested into the MSI's `BaseApplicationsFiles` component group, but
the PR did not update `.pipelines/ESRPSigning_core.json`, so ESRP never
signs it and `versionAndSignCheck.ps1` correctly fails the build.

This is the same kind of omission that PR #48050 fixed for
`YamlDotNet.dll` introduced by #40834 — a new managed library shipping
in the MSI without a matching signing config entry.

## Fix

One additive line in `.pipelines/ESRPSigning_core.json`, placing
`"PowerAccent.Common.dll"` inside the existing alphabetized PowerAccent
block (next to `PowerAccent.Core.dll`).

```diff
             "PowerAccent.Core.dll",
+            "PowerAccent.Common.dll",
             "PowerToys.PowerAccent.dll",
```

## Validation

- `git diff` shows exactly one additive line.
- File still parses as valid JSON (`ConvertFrom-Json` round-trip OK).
- Audited the full file list of PR #47211: `PowerAccent.Common.dll` is
the only new shippable assembly it added (the other new project,
`PowerAccent.Common.UnitTests`, is a test project and is not included in
the installer).
- Dedup logic in
`installer/PowerToysSetupVNext/generateAllFileComponents.ps1` keeps only
the root copy when WinUI3Apps and root copies are byte-identical, so a
single root-level entry is sufficient.

## Follow-up

After merge to `main`, cherry-pick / merge into `stable` to unblock the
0.100 release pipeline. This is the third (and hopefully final) PR in
the 0.100 release-pipeline unblock sequence, after #48050 (sign
`YamlDotNet.dll`) and #48054 (remove duplicate
`QuickAccent_SelectedLanguage_Greek_Polytonic` resource).

Co-authored-by: Copilot <Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@Yarden-zamir

Copy link
Copy Markdown

This is awesome! It's much more powerful than the last one or any alternatives. It is a bit slow though, can anyone implement caching or give us the ability to get the old one back?

@niels9001

Copy link
Copy Markdown
Collaborator

This is awesome! It's much more powerful than the last one or any alternatives. It is a bit slow though, can anyone implement caching or give us the ability to get the old one back?

We are working on performance and making it better!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

0.100 Product-Shortcut Guide Refers to the Shortcut Guide PowerToy

Projects

None yet

Development

Successfully merging this pull request may close these issues.