PowerToys icon indicating copy to clipboard operation
PowerToys copied to clipboard

Awake vNext - `NOBLE_SIX_02162023`

Open dend opened this issue 2 years ago • 33 comments

Summary of the Pull Request

Implements quality-of-life improvements for Awake.

PR Checklist

  • [X] Communication: I've discussed this with core contributors already. If work hasn't been agreed, this work might be rejected
  • [ ] Tests: Added/updated and all pass
  • [ ] Localization: All end user facing strings can be localized
  • [ ] Dev docs: Added/updated
  • [ ] Documentation updated: If checked, please file a pull request on our docs repo and link it here: #xxx

dend avatar Feb 17 '23 23:02 dend

Idea: since a time interval and a specific date/time both boil down to a specific point in time, do you think it's possible to (in the background) use one and the same setting?

@JayOWay - I mean, kinda? Today what I am doing is using Reactive Extensions (Rx) to set up the proper timer that is either a point-in-time (date/time) or interval. There is an interesting scenario here that we need to be cognizant of that Rx should handle automatically - clock changes.

If I set the interval to 15 minutes, I will get my 15 minutes and that's it. If I set the clock to 12:30PM and then I go ahead and change the clock, I'd want Awake to be able to recognize the time and either end or extend the session.

dend avatar Feb 20 '23 19:02 dend

@dend is this ready for review and are the linked issues here everything included in this pr?

crutkas avatar Feb 22 '23 05:02 crutkas

@crutkas lemme take a pass at the view model refactor, and then :shipit:

dend avatar Feb 22 '23 22:02 dend

@check-spelling-bot Report

:red_circle: Please review

See the :open_file_folder: files view or the :scroll:action log for details.

Unrecognized words (1)

overriden

Previously acknowledged words that are now absent AMF Bson chromaticities depsjsonpath DONTRESOLVEDLLREFERENCES handlerroutine LOADLIBRARYASDATAFILE Unstub XControl :arrow_right:
To accept :heavy_check_mark: these unrecognized words as correct and remove the previously acknowledged and now absent words, run the following commands

... in a clone of the [email protected]:dend/PowerToys.git repository on the main branch (:information_source: how do I use this?):

curl -s -S -L 'https://raw.githubusercontent.com/check-spelling/check-spelling/v0.0.21/apply.pl' |
perl - 'https://github.com/microsoft/PowerToys/actions/runs/4248459060/attempts/1'
Available :books: dictionaries could cover words not in the :blue_book: dictionary

This includes both expected items (2180) from .github/actions/spell-check/expect.txt and unrecognized words (1)

Dictionary Entries Covers
cspell:cpp/src/cpp.txt 30216 123
cspell:win32/src/win32.txt 53509 118
cspell:python/src/python/python-lib.txt 3873 31
cspell:php/php.txt 2597 16
cspell:node/node.txt 1768 13
cspell:typescript/typescript.txt 1211 12
cspell:python/src/python/python.txt 453 10
cspell:java/java.txt 7642 10
cspell:aws/aws.txt 218 8
cspell:python/src/common/extra.txt 741 7

Consider adding them using (in .github/workflows/spelling2.yml):

      with:
        extra_dictionaries:
          cspell:cpp/src/cpp.txt
          cspell:win32/src/win32.txt
          cspell:python/src/python/python-lib.txt
          cspell:php/php.txt
          cspell:node/node.txt
          cspell:typescript/typescript.txt
          cspell:python/src/python/python.txt
          cspell:java/java.txt
          cspell:aws/aws.txt
          cspell:python/src/common/extra.txt

To stop checking additional dictionaries, add:

      with:
        check_extra_dictionaries: ''
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 23 '23 01:02 github-actions[bot]

@check-spelling-bot Report

:red_circle: Please review

See the :open_file_folder: files view or the :scroll:action log for details.

Unrecognized words (1)

Cloneable

Previously acknowledged words that are now absent AMF Bson chromaticities depsjsonpath DONTRESOLVEDLLREFERENCES handlerroutine LOADLIBRARYASDATAFILE Unstub XControl :arrow_right:
To accept :heavy_check_mark: these unrecognized words as correct and remove the previously acknowledged and now absent words, run the following commands

... in a clone of the [email protected]:dend/PowerToys.git repository on the main branch (:information_source: how do I use this?):

curl -s -S -L 'https://raw.githubusercontent.com/check-spelling/check-spelling/v0.0.21/apply.pl' |
perl - 'https://github.com/microsoft/PowerToys/actions/runs/4248720846/attempts/1'
Available :books: dictionaries could cover words not in the :blue_book: dictionary

This includes both expected items (2180) from .github/actions/spell-check/expect.txt and unrecognized words (1)

Dictionary Entries Covers
cspell:cpp/src/cpp.txt 30216 122
cspell:win32/src/win32.txt 53509 118
cspell:python/src/python/python-lib.txt 3873 31
cspell:php/php.txt 2597 16
cspell:node/node.txt 1768 13
cspell:typescript/typescript.txt 1211 12
cspell:python/src/python/python.txt 453 10
cspell:java/java.txt 7642 10
cspell:aws/aws.txt 218 8
cspell:python/src/common/extra.txt 741 7

Consider adding them using (in .github/workflows/spelling2.yml):

      with:
        extra_dictionaries:
          cspell:cpp/src/cpp.txt
          cspell:win32/src/win32.txt
          cspell:python/src/python/python-lib.txt
          cspell:php/php.txt
          cspell:node/node.txt
          cspell:typescript/typescript.txt
          cspell:python/src/python/python.txt
          cspell:java/java.txt
          cspell:aws/aws.txt
          cspell:python/src/common/extra.txt

To stop checking additional dictionaries, add:

      with:
        check_extra_dictionaries: ''
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 23 '23 02:02 github-actions[bot]

Not sure if all of it is because of this PR, but... At first I tried to run/debug PowerToys.Settings and, even after Clean Solution, it broke with

Exception thrown: 'System.ArgumentOutOfRangeException' in System.Private.CoreLib.dll
Exception thrown: 'System.Reflection.TargetInvocationException' in System.Private.CoreLib.dll
Exception thrown: 'System.Reflection.TargetInvocationException' in System.Private.CoreLib.dll

Running/debugging only the Awake project gives me a cmd-like window and no tray icon. Am I doing something wrong?

Jay-o-Way avatar Feb 25 '23 14:02 Jay-o-Way

@Jay-o-Way I get the same when trying to open Awake settings page

stefansjfw avatar Feb 27 '23 08:02 stefansjfw

@check-spelling-bot Report

:red_circle: Please review

See the :open_file_folder: files view or the :scroll:action log for details.

Unrecognized words (1)

Cloneable

Previously acknowledged words that are now absent AMF Bson chromaticities depsjsonpath DONTRESOLVEDLLREFERENCES handlerroutine LOADLIBRARYASDATAFILE Unstub XControl :arrow_right:
To accept :heavy_check_mark: these unrecognized words as correct and remove the previously acknowledged and now absent words, run the following commands

... in a clone of the [email protected]:dend/PowerToys.git repository on the main branch (:information_source: how do I use this?):

curl -s -S -L 'https://raw.githubusercontent.com/check-spelling/check-spelling/v0.0.21/apply.pl' |
perl - 'https://github.com/microsoft/PowerToys/actions/runs/4288172780/attempts/1'
Available :books: dictionaries could cover words not in the :blue_book: dictionary

This includes both expected items (2180) from .github/actions/spell-check/expect.txt and unrecognized words (1)

Dictionary Entries Covers
cspell:cpp/src/cpp.txt 30216 122
cspell:win32/src/win32.txt 53509 118
cspell:python/src/python/python-lib.txt 3873 31
cspell:php/php.txt 2597 16
cspell:node/node.txt 1768 13
cspell:typescript/typescript.txt 1211 12
cspell:python/src/python/python.txt 453 10
cspell:java/java.txt 7642 10
cspell:aws/aws.txt 218 8
cspell:python/src/common/extra.txt 741 7

Consider adding them using (in .github/workflows/spelling2.yml):

      with:
        extra_dictionaries:
          cspell:cpp/src/cpp.txt
          cspell:win32/src/win32.txt
          cspell:python/src/python/python-lib.txt
          cspell:php/php.txt
          cspell:node/node.txt
          cspell:typescript/typescript.txt
          cspell:python/src/python/python.txt
          cspell:java/java.txt
          cspell:aws/aws.txt
          cspell:python/src/common/extra.txt

To stop checking additional dictionaries, add:

      with:
        check_extra_dictionaries: ''
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 28 '23 00:02 github-actions[bot]

Not sure if all of it is because of this PR, but... At first I tried to run/debug PowerToys.Settings and, even after Clean Solution, it broke with

Exception thrown: 'System.ArgumentOutOfRangeException' in System.Private.CoreLib.dll
Exception thrown: 'System.Reflection.TargetInvocationException' in System.Private.CoreLib.dll
Exception thrown: 'System.Reflection.TargetInvocationException' in System.Private.CoreLib.dll

Running/debugging only the Awake project gives me a cmd-like window and no tray icon. Am I doing something wrong?

@Jay-o-Way @stefansjfw I am trying to reproduce this issue and so far no luck. Also trying different configurations (with/without the Awake config file). Will keep this thread posted on the investigation.

dend avatar Feb 28 '23 00:02 dend

@check-spelling-bot Report

:red_circle: Please review

See the :open_file_folder: files view or the :scroll:action log for details.

Unrecognized words (1)

Cloneable

Previously acknowledged words that are now absent Akrotiri Aktobe Andreanof appxpackage Aqtobe Atikokan Atyrau Avanc Bashkortostan Bayan Belarus Bson Burkina Buryatia Cabo Caiguna Choibalsan Chukotka Chuuk Clipperton Cocklebiddy Comoros corewebview Cunha Danmarkshavn datatemplate DONTRESOLVEDLLREFERENCES enumerationoptions Eswatini Eucla Faroe Futuna getancestor getasynckeystate globalassemblycache handlerroutine Heure Hovd HWHEEL inputdev ipreviewhandler Ittoqqortoormiit ivirtualdesktopmanager Ivoire Khakassia Khanty Khovd Kitts Krai Kwango Kwilu Kyrgyzstan Kyzylorda LEFTDOWN LEFTUP LOADLIBRARYASDATAFILE Luhansk Maarten Macquarie Magadan Mangere Mangystau Mansi Marquesas Mato MCDT MCST menurc MIDDLEDOWN MIDDLEUP Mishkeegogamang Moldova Mongala Mundrabilla MYTZ Navassa navigatetostring Ndombe NOCOALESCE nonpackaged Noronha Nunavut Nusa oledbcommand oledbconnection Pitcairn Pohnpei Primorsky queryfocus registerhotkey resourcemanager RIGHTDOWN RIGHTUP Roamable Rothera Schd secauthz securityoverview shemptyrecyclebina SPACEBAR Srednekolymsk Sul Suri sysinfo Tajikistan Tenggara timezones tostring Transnistria Tshuapa Tuva TValue uapmanifestschema Udmurtia uiauto Ulaanbaatar UMsg Unstub Urville Uvs VIRTUALDESK virtualkey winauto winmsg winuser wtypes WVk XControl XDOWN XUP Yamalia Zabaykalsky Zonev :arrow_right:
Some files were automatically ignored

These sample patterns would exclude them:

^\Qsrc/modules/MouseUtils/MouseJumpUI/MainForm.resx\E$

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 :heavy_check_mark: these unrecognized words as correct and remove the previously acknowledged and now absent words, run the following commands

... in a clone of the [email protected]:dend/PowerToys.git repository on the update-resx branch (:information_source: how do I use this?):

curl -s -S -L 'https://raw.githubusercontent.com/check-spelling/check-spelling/v0.0.21/apply.pl' |
perl - 'https://github.com/microsoft/PowerToys/actions/runs/4288308245/attempts/1'
Available :books: dictionaries could cover words not in the :blue_book: dictionary

This includes both expected items (2198) from .github/actions/spell-check/expect.txt and unrecognized words (1)

Dictionary Entries Covers
cspell:cpp/src/cpp.txt 30216 119
cspell:win32/src/win32.txt 53509 116
cspell:python/src/python/python-lib.txt 3873 29
cspell:php/php.txt 2597 16
cspell:node/node.txt 1768 13
cspell:typescript/typescript.txt 1211 12
cspell:python/src/python/python.txt 453 10
cspell:java/java.txt 7642 10
cspell:aws/aws.txt 218 8
cspell:python/src/common/extra.txt 741 7

Consider adding them using (in .github/workflows/spelling2.yml):

      with:
        extra_dictionaries:
          cspell:cpp/src/cpp.txt
          cspell:win32/src/win32.txt
          cspell:python/src/python/python-lib.txt
          cspell:php/php.txt
          cspell:node/node.txt
          cspell:typescript/typescript.txt
          cspell:python/src/python/python.txt
          cspell:java/java.txt
          cspell:aws/aws.txt
          cspell:python/src/common/extra.txt

To stop checking additional dictionaries, add:

      with:
        check_extra_dictionaries: ''
Warnings (1)

See the :open_file_folder: files view or the :scroll:action log for details.

:information_source: Warnings Count
:information_source: noisy-file 1

See :information_source: 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 Feb 28 '23 00:02 github-actions[bot]

Latest change makes some improvements to settings scaffolding. @Jay-o-Way @stefansjfw could you please pull the latest and rebuild the project to see if the issue persists?

dend avatar Feb 28 '23 01:02 dend

@dend Debug/run both Projects yields the exact same result for me. Doing a full build of the Solution, and then looking at Settings, shows not the latest changes: image

Or - next attempt: ========== Rebuild All: 146 succeeded, 2 failed, 0 skipped ========== with 217 errors... 🤷‍♂️

Jay-o-Way avatar Feb 28 '23 13:02 Jay-o-Way

@Jay-o-Way could you please try cleaning/deleting compiled binaries and then rebuilding? I cannot reproduce the full build errors - sound like potentially something is missing in your local PR clone? Can you screenshot some of the build errors along with the list of projects that failed?

dend avatar Feb 28 '23 18:02 dend

Okay @dend

  • I emptied the local PowerToys\x64 folder
  • I clicked "Checkout with GitHub" and opened Visual Studio with this pr/branch
  • I Ran/Debug the Settings project, and it break when opening the Awake page
    Exception thrown: 'System.ArgumentOutOfRangeException' in System.Private.CoreLib.dll
    Exception thrown: 'System.Reflection.TargetInvocationException' in System.Private.CoreLib.dll
    Exception thrown: 'System.Reflection.TargetInvocationException' in System.Private.CoreLib.dll
    
  • Then I clicked Build Solution and got errors about my RAM/PageFile ☹ -- this was a one-time thing
    118>c1xx : error C3859: Failed to create virtual memory for PCH
    118>c1xx : message : the system returned code 1455: Het wisselbestand is te klein voor het voltooien van deze bewerking.
    118>c1xx : message : please visit https://aka.ms/pch-help for more details
    118>c1xx : fatal  error C1076: compiler limit: internal heap limit reached
    
    Result = Build: 144 succeeded, 4 failed
  • Then I opened PowerToys.exe in the Debug folder. It also crashes on the Awake page. Toggling on/off via the new pop-up window gives me the Awake icon in the systray, but I can't get a menu - or anything - from it.

Jay-o-Way avatar Mar 03 '23 17:03 Jay-o-Way

Oh, and if you want to know all the errors/warnings I get: image

Jay-o-Way avatar Mar 03 '23 17:03 Jay-o-Way

Jay, something is off, the CI would fail then if the analyzers were failing. My suggestion would be is to delete the folder and clone again.

crutkas avatar Mar 03 '23 17:03 crutkas

@crutkas @dend I did as you suggested. Deleted the entire project on my computer. Cloned again. Opened GitHug Desktop and Visual Studio through this pr/branch. Ran a Debug on PowerToys Settings and it breaks with the exact same info as mentioned above. My Output: output debug PowerToys.Settings project.txt

Note The main branch works good!

I'm lost 🤷‍♂️

Jay-o-Way avatar Mar 03 '23 19:03 Jay-o-Way

@crutkas I actually think @Jay-o-Way is running into the same issue I was - it's not that the code is bad, it's that the compiler can't seem to allocate the memory to fully compile the solution. You can see that from the error they shared earlier:

118>c1xx : error C3859: Failed to create virtual memory for PCH
118>c1xx : message : the system returned code 1455: Het wisselbestand is te klein voor het voltooien van deze bewerking.
118>c1xx : message : please visit https://aka.ms/pch-help for more details
118>c1xx : fatal  error C1076: compiler limit: internal heap limit reached

dend avatar Mar 04 '23 00:03 dend

@dend sorry if i was not clear enough, but it explicitly breaks at a breakpoint, throwing exceptions. You can see that from the errors I shared earlier. To repeat myself: the main branch is good. Hope I dont need to repeat the same thing again.

Jay-o-Way avatar Mar 04 '23 07:03 Jay-o-Way

Besides that... https://github.com/microsoft/PowerToys/blob/ca4e378881f1c02587a6e59f9ee0a9d5d3d2907f/src/settings-ui/Settings.UI/Views/AwakePage.xaml#L58-L59 "Expiation" is an existing word, but it means something very different

Jay-o-Way avatar Mar 04 '23 13:03 Jay-o-Way

On the typo - will fix it. Regarding the rest of the build @Jay-o-Way - if you clean the solution, no breakpoints, and then re-build the whole thing, does it succeed? Not running, just fully re-building.

dend avatar Mar 06 '23 15:03 dend

Well, did that today. Building the whole thing works. Opening the Awake page in Settings, fails. Build PT output, 7th mrch.txt

Jay-o-Way avatar Mar 07 '23 11:03 Jay-o-Way

@jaimecbernardo @crutkas @stefansjfw could you please test and try reproducing the Awake settings page issue? Doesn't seem like I can repro it on my end.

dend avatar Mar 07 '23 17:03 dend

@jaimecbernardo @crutkas @stefansjfw could you please test and try reproducing the Awake settings page issue? Doesn't seem like I can repro it on my end.

I can reproduce this. Trying to navigate to Awake page crashes the settings app (both when running runner and the settings app directly)

stefansjfw avatar Mar 08 '23 10:03 stefansjfw

@stefansjfw is this after pulling the latest changes and doing a full (clean) rebuild?

dend avatar Mar 08 '23 17:03 dend

@stefansjfw is this after pulling the latest changes and doing a full (clean) rebuild?

Yes.

  • pulled the code
  • git clean -xfd
  • built the solution from VS

stefansjfw avatar Mar 08 '23 17:03 stefansjfw

@stefansjfw sorry, not Git clean - clean from VS, then full rebuild. I am going to be fiddling with the code later to see if I can repro the scenario. Can you share the logs for Awake in the meantime (see inside %LOCALAPPDATA%/Microsoft/PowerToys)?

dend avatar Mar 08 '23 17:03 dend

Here is what I see when I go to the Awake screen in the latest branch, so logs would be helpful to diagnose any of the issues you might have @Jay-o-Way @stefansjfw

Awake settings screen

dend avatar Mar 08 '23 17:03 dend

@dend Here's a zip with all the folders from that directory: PT logs (to investigate Awake).zip Note that clicking "Report bug" from the tray menu of a 0.0.1 build doesn't do anything. Output from the runner isn't more helpful than

Exception thrown: 'System.ArgumentOutOfRangeException' in System.Private.CoreLib.dll
Exception thrown: 'System.Reflection.TargetInvocationException' in System.Private.CoreLib.dll
Exception thrown: 'System.Reflection.TargetInvocationException' in System.Private.CoreLib.dll

[thinking out loud]

  • I think that this new version is searching for data that the old settings (file/data) does not hold. The <DatePicker> and <TimePicker> in the XAML file ask for ExpirationDateTime and ExpirationTime (resp.) but that data (=?awake_expire_at) does not exist in settings.json. In addition to if (!File.Exists(settingsPath)) there should also be a check for the fields.
{"properties":{"awake_keep_display_on":false,"awake_mode":0,"awake_hours":0,"awake_minutes":0,"tray_times":{}},"name":"Awake","version":"1.0"}

image

  • Or... ViewModel.ExpirationTime is not defined in AwakeProperties.cs?

Jay-o-Way avatar Mar 09 '23 14:03 Jay-o-Way

@dend What is the exact data in your settings.json? (specifically looking for expirationDateTime)

Jay-o-Way avatar Mar 09 '23 15:03 Jay-o-Way