PowerToys icon indicating copy to clipboard operation
PowerToys copied to clipboard

New+ Feature - Option to hide the built-in New context menu (37545 and 37946)

Open cgaarden opened this issue 6 months ago • 9 comments

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
  • [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

  1. Includes updates to PowerToys settings to update the registry to enable/disable the built-in New context menu
  2. Updated installer to reenable New context menu on uninstall

Validation Steps Performed

Windows 11 x64 and Windows 11 ARM64

  1. Settings UI
  2. Non elevated mode
  3. Elevated mode
  4. New+ enabled
  5. New+ disabled

Windows 10 x64 NOT tested. Do not have a Windows 10 key with me

Windows 11 x64, Non-elevated, New+ Disabled image

Windows 11 x64, Non-elevated, New+ Enabled image

image

Windows 11 x64, Elevated, New+ Enabled image

image

cgaarden avatar Jun 01 '25 17:06 cgaarden

Updated property notification per feedback

cgaarden avatar Jun 11 '25 11:06 cgaarden

@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 VARENUM

Some 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.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.

github-actions[bot] avatar Jun 11 '25 11:06 github-actions[bot]

Hi @shuaiyuanxx and @moooyo

Wanted to check-in and see if you had any ideas or feedback?

Kind regards, Christian

cgaarden avatar Aug 16 '25 16:08 cgaarden

I have no idea on this toy...I didn't touch this part before, any suggestion? @shuaiyuanxx

moooyo avatar Aug 19 '25 07:08 moooyo

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

lei9444 avatar Aug 20 '25 07:08 lei9444

Tested the per-user installer but it couldn’t restore the built-in New context menu: image

The machine-level installer works fine since it uses UAC to elevate permissions.

lei9444 avatar Aug 21 '25 07:08 lei9444

Questions and Suggestions

  1. 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.

  2. 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.

  3. 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.

yeelam-gordon avatar Sep 05 '25 01:09 yeelam-gordon