PowerToys icon indicating copy to clipboard operation
PowerToys copied to clipboard

[RegPreview] Init with header and add NEW button

Open htcfreek opened this issue 9 months ago • 4 comments

Summary of the Pull Request

This PR improves Registry preview to allow pasting registry keys and values without writing the file header manually.

This is done by adding the following changes:

  1. Init the editor with only the registry file header if no file is opened.
  2. Adding a new button that resets the app to the "init without file" state.

image

PR Checklist

  • [x] Closes: #36872
  • [x] 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
  • [ ] Dev docs: Added/updated
  • [ ] New binaries: Added on the required places
  • [ ] Documentation updated: If checked, please file a pull request on our docs repo and link it here: #xxx

Detailed Description of the Pull Request / Additional comments

Validation Steps Performed

Run local build and validate the behavior.

htcfreek avatar Feb 25 '25 12:02 htcfreek

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

initilize

These words are not needed and should be removed ahk AMPROPERTY AMPROPSETID Breadcrumb CDEF comdef ddf devenum DEVMON DEVSOURCE DGR DIIRFLAG dshow DVH DVHD DVSD DVSL EData ERole fdw FILEINFOSIG Filtergraph Filterx HCERTSTORE IKs iljxck IYUV KSPROPERTY lcb ldx lld LONGLONG LTRB majortype makecab MEDIASUBTYPE mediatype mfplat mic mjpg Msimg msiquery ORAW outpin overlaywindow PAUDIO PINDIR Pnp ppmt previouscamera PROPBAG propvarutil reencode reencoded REFGUID REGFILTER REGFILTERPINS REGPINTYPES regsvr shmem sizeread stl strsafe strutil subquery SYNCMFT TMPVAR vcdl vdi vid VIDCAP VIDEOINFOHEADER vih webcam wistd WVC

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 [email protected]:htcfreek/PowerToys.git repository on the PT_RegPrevHeader branch (:information_source: how do I use this?):

curl -s -S -L 'https://raw.githubusercontent.com/check-spelling/check-spelling/v0.0.24/apply.pl' |
perl - 'https://github.com/microsoft/PowerToys/actions/runs/13521178350/attempts/1'

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 Feb 25 '25 12:02 github-actions[bot]

Quick comment, going back to the days of Office unifying their menu/toolbars: does it make sense to have New after Reload or should it be first in the toolbar, as many apps have "New, Open, Save, Save As" under File and the toolbar for this app is very much a File menu. Just horizontally.

randyrants avatar Mar 10 '25 01:03 randyrants

Good question. My idea was that open is the more often use case. But we can switch.

htcfreek avatar Mar 10 '25 07:03 htcfreek

Not a firm opinion - just an opinion. Wondering what others think too.

randyrants avatar Mar 10 '25 19:03 randyrants

Can someone please review this that we get the other PR ready.

cc: @zhaopy536

htcfreek avatar Apr 01 '25 08:04 htcfreek

Can someone please review this that we get the other PR ready.

cc: @zhaopy536

good job! reviewing

zhaopy536 avatar Apr 02 '25 05:04 zhaopy536

Can someone please review this that we get the other PR ready.

cc: @zhaopy536

good job! reviewing

@zhaopy536 Thank you. Can you approve and merge?

htcfreek avatar Apr 02 '25 07:04 htcfreek

Can someone please review this that we get the other PR ready. cc: @zhaopy536

good job! reviewing

@zhaopy536 Thank you. Can you approve and merge?

Hi, team is doing a 0.90 fix release these days, and cannot merge PR for the time being.

zhaopy536 avatar Apr 02 '25 15:04 zhaopy536

Good question. My idea was that open is the more often use case. But we can switch.

I vote for 'New, Open, Reload' order align w/ other apps. there is no copy/paste support before, so Open is the only option.

jamrobot avatar Apr 04 '25 22:04 jamrobot

overall looks good to me, please let me know if comments make sense to you. thanks for adding 'New' function to RegPreview.

jamrobot avatar Apr 04 '25 22:04 jamrobot

@jamrobot Requested changes are done. Please review.

htcfreek avatar Apr 06 '25 14:04 htcfreek

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

NEWFILEHEADER

These words are not needed and should be removed APPICONREFERENCE APPPUBLISHER cdn CREATETHREAD CREATEWINDOW DDEAPPLICATION DDECOMMAND DDEIFEXEC DDETOPIC DEFAULTTOFOLDER DEFAULTTOSTAR DELEGATEEXECUTE DROPTARGET flaticon fpvm gifv HSSH IGNOREBASECLASS INVALIDCALL INVALIDINDEX libraryincludes mdpvm NOFIXUPS NOOPEN NOREMAPCLSID NOTRUNCATE NOUSERSETTINGS QUICKTIP REGISTERCLASSEX REMAPRUNDLL searchtext SHELLEXTENSION SHELLNEWVALUE SHNAMEMAPPING sourced TILEINFO TMPVAR videourl WANTMAPPINGHANDLE xdoc youtube

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 [email protected]:htcfreek/PowerToys.git repository on the PT_RegPrevHeader branch (:information_source: how do I use this?):

curl -s -S -L 'https://raw.githubusercontent.com/check-spelling/check-spelling/v0.0.24/apply.pl' |
perl - 'https://github.com/microsoft/PowerToys/actions/runs/14293682212/attempts/1'

Errors (2)

See the :open_file_folder: files view, the :scroll:action log, or :memo: job summary for details.

:x: Errors Count
:x: ignored-expect-variant 3
:warning: no-newline-at-eof 1

See :x: 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 Apr 06 '25 14:04 github-actions[bot]

ping @jamrobot for review

htcfreek avatar Apr 10 '25 19:04 htcfreek

@crutkas Can you please take a look? Seems that @jamrobot doesn't have the time to review.

htcfreek avatar Apr 16 '25 17:04 htcfreek

@htcfreek if @jamrobot cant take a look before I do, I’ll do it on Monday. I tried but the day got away from me and I won’t be in a position where I can today.

crutkas avatar Apr 18 '25 13:04 crutkas

/azp run

zhaopy536 avatar Apr 21 '25 06:04 zhaopy536

Azure Pipelines successfully started running 1 pipeline(s).

azure-pipelines[bot] avatar Apr 21 '25 06:04 azure-pipelines[bot]