New+ Feature - Option to hide the built-in New context menu (37545 and 37946)
Summary of the Pull Request
New+ Add the option to hide the built-in New context menu via settings
Note: This setting requires PowerToys to be run as Administrator as it relies on updating the registry
PR Checklist
- [x] Closes: #37545 and #37946
- [ ] Communication: I've discussed this with core contributors already. If work hasn't been agreed, this work might be rejected
- [X] Tests: Added/updated and all pass
- [X] Localization: All end user facing strings can be localized
- [n/a] Dev docs: Added/updated
- [n/a] New binaries: Added on the required places
- [n/a] JSON for signing for new binaries
- [n/a] WXS for installer for new binaries and localization folder
- [n/a] YML for CI pipeline for new test projects
- [n/a] YML for signed pipeline
- [X] Documentation updated: If checked, please file a pull request on [our docs repo] -- Doc PR coming (https://github.com/MicrosoftDocs/windows-uwp/tree/docs/hub/powertoys) and link it here: #xxx
Detailed Description of the Pull Request / Additional comments
- Includes updates to PowerToys settings to update the registry to enable/disable the built-in New context menu
- Updated installer to reenable New context menu on uninstall
Validation Steps Performed
Windows 11 x64 and Windows 11 ARM64
- Settings UI
- Non elevated mode
- Elevated mode
- New+ enabled
- New+ disabled
Windows 10 x64 NOT tested. Do not have a Windows 10 key with me
Windows 11 x64, Non-elevated, New+ Disabled
Windows 11 x64, Non-elevated, New+ Enabled
Windows 11 x64, Elevated, New+ Enabled
Updated property notification per feedback
@check-spelling-bot Report
:red_circle: Please review
See the :open_file_folder: files view, the :scroll:action log, or :memo: job summary for details.
Unrecognized words (1)
GC'd
These words are not needed and should be removed
DEFT iextn localappdata msvsmon OTHERUNZOOM OTHERZOOM PARENTCLOSING PARENTOPENING pswd SCROLLCHILDREN SHELLEXTENSION SHELLNEWVALUE SHGFIICON SHGFILARGEICON TGM VARENUMSome files were automatically ignored :see_no_evil:
These sample patterns would exclude them:
^\Q.pipelines/272MSSharedLibSN2048.snk\E$
^src/modules/ZoomIt/ZoomIt/ZoomIt\.idc$
You should consider adding them to:
.github/actions/spell-check/excludes.txt
File matching is via Perl regular expressions.
To check these files, more of their words need to be in the dictionary than not. You can use patterns.txt to exclude portions, add items to the dictionary (e.g. by adding them to allow.txt), or fix typos.
To accept these unrecognized words as correct, update file exclusions, and remove the previously acknowledged and now absent words, you could run the following commands
... in a clone of the [email protected]:cgaarden/PowerToys.git repository
on the New+feature-37545-option-to-disable-existing-new branch (:information_source: how do I use this?):
curl -s -S -L 'https://raw.githubusercontent.com/check-spelling/check-spelling/c635c2f3f714eec2fcf27b643a1919b9a811ef2e/apply.pl' |
perl - 'https://github.com/microsoft/PowerToys/actions/runs/15583608046/attempts/1' &&
git commit -m 'Update check-spelling metadata'
Warnings :warning: (4)
See the :open_file_folder: files view, the :scroll:action log, or :memo: job summary for details.
| :warning: Warnings | Count |
|---|---|
| :warning: binary-file | 1 |
| :warning: ignored-expect-variant | 2 |
| :warning: no-newline-at-eof | 2 |
| :warning: single-line-file | 1 |
See :warning: Event descriptions for more information.
If the flagged items are :exploding_head: 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.txtfile 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.txtfile.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.
Hi @shuaiyuanxx and @moooyo
Wanted to check-in and see if you had any ideas or feedback?
Kind regards, Christian
I have no idea on this toy...I didn't touch this part before, any suggestion? @shuaiyuanxx
I will trigger a official build for per-user installer and test it, I afraid if the per-user installer could restore as expect as the per-user will not have UAC popup
Tested the per-user installer but it couldn’t restore the built-in New context menu:
The machine-level installer works fine since it uses UAC to elevate permissions.
Questions and Suggestions
-
Registry Effectiveness When we remove/restore the registry, does it take effect in real time, or does it require restarting explorer.exe? If it is not real-time effective (especially on restore), then we should not enable this feature yet.
-
Settings Integration We should introduce this option into the settings (JSON). Without this, DSC and backup/restore for the setting will not work. dllMain for Peek also doesn’t know how to handle it if GPO disables New+ — in that case, the setting should also be restored.
-
Documentation Update We should update the Peek developer readme to mention disaster recovery steps. The guidance is on how to restore the setting in case PowerToys cannot start or is gone for unknown reason.