mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-12-30 08:56:33 +01:00
Compare commits
2 Commits
leilzh/tim
...
user/yeela
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9d4d1bf383 | ||
|
|
2a051e9c67 |
98
.github/actions/spell-check/candidate.patterns
vendored
98
.github/actions/spell-check/candidate.patterns
vendored
@@ -1,9 +1,6 @@
|
||||
# D2D
|
||||
#D?2D
|
||||
|
||||
# Repeated letters
|
||||
\b([a-z])\g{-1}{2,}\b
|
||||
|
||||
# marker to ignore all code on line
|
||||
^.*/\* #no-spell-check-line \*/.*$
|
||||
# marker to ignore all code on line
|
||||
@@ -13,9 +10,6 @@
|
||||
# cspell inline
|
||||
^.*\b[Cc][Ss][Pp][Ee][Ll]{2}:\s*[Dd][Ii][Ss][Aa][Bb][Ll][Ee]-[Ll][Ii][Nn][Ee]\b
|
||||
|
||||
# copyright
|
||||
Copyright (?:\([Cc]\)|)(?:[-\d, ]|and)+(?: [A-Z][a-z]+ [A-Z][a-z]+,?)+
|
||||
|
||||
# patch hunk comments
|
||||
^@@ -\d+(?:,\d+|) \+\d+(?:,\d+|) @@ .*
|
||||
# git index header
|
||||
@@ -24,9 +18,6 @@ index (?:[0-9a-z]{7,40},|)[0-9a-z]{7,40}\.\.[0-9a-z]{7,40}
|
||||
# file permissions
|
||||
['"`\s][-bcdLlpsw](?:[-r][-w][-Ssx]){2}[-r][-w][-SsTtx]\+?['"`\s]
|
||||
|
||||
# css fonts
|
||||
\bfont(?:-family|):[^;}]+
|
||||
|
||||
# css url wrappings
|
||||
\burl\([^)]+\)
|
||||
|
||||
@@ -38,7 +29,7 @@ index (?:[0-9a-z]{7,40},|)[0-9a-z]{7,40}\.\.[0-9a-z]{7,40}
|
||||
# data url in quotes
|
||||
([`'"])data:(?:[^ `'"].*?|)(?:[A-Z]{3,}|[A-Z][a-z]{2,}|[a-z]{3,}).*\g{-1}
|
||||
# data url
|
||||
\bdata:[-a-zA-Z=;:/0-9+_]*,\S*
|
||||
\bdata:[-a-zA-Z=;:/0-9+]*,\S*
|
||||
|
||||
# https/http/file urls
|
||||
#(?:\b(?:https?|ftp|file)://)[-A-Za-z0-9+&@#/*%?=~_|!:,.;]+[-A-Za-z0-9+&@#/*%=~_|]
|
||||
@@ -77,8 +68,6 @@ magnet:[?=:\w]+
|
||||
|
||||
# Amazon
|
||||
\bamazon\.com/[-\w]+/(?:dp/[0-9A-Z]+|)
|
||||
# AWS ARN
|
||||
arn:aws:[-/:\w]+
|
||||
# AWS S3
|
||||
\b\w*\.s3[^.]*\.amazonaws\.com/[-\w/&#%_?:=]*
|
||||
# AWS execute-api
|
||||
@@ -105,8 +94,6 @@ vpc-\w+
|
||||
\bgoogle-analytics\.com/collect.[-0-9a-zA-Z?%=&_.~]*
|
||||
# Google APIs
|
||||
\bgoogleapis\.(?:com|dev)/[a-z]+/(?:v\d+/|)[a-z]+/[-@:./?=\w+|&]+
|
||||
# Google Artifact Registry
|
||||
\.pkg\.dev(?:/[-\w]+)+(?::[-\w]+|)
|
||||
# Google Storage
|
||||
\b[-a-zA-Z0-9.]*\bstorage\d*\.googleapis\.com(?:/\S*|)
|
||||
# Google Calendar
|
||||
@@ -142,8 +129,6 @@ themes\.googleusercontent\.com/static/fonts/[^/\s"]+/v\d+/[^.]+.
|
||||
\bscholar\.google\.com/citations\?user=[A-Za-z0-9_]+
|
||||
# Google Colab Research Drive
|
||||
\bcolab\.research\.google\.com/drive/[-0-9a-zA-Z_?=]*
|
||||
# Google Cloud regions
|
||||
(?:us|(?:north|south)america|europe|asia|australia|me|africa)-(?:north|south|east|west|central){1,2}\d+
|
||||
|
||||
# GitHub SHAs (api)
|
||||
\bapi.github\.com/repos(?:/[^/\s"]+){3}/[0-9a-f]+\b
|
||||
@@ -182,12 +167,6 @@ GHSA(?:-[0-9a-z]{4}){3}
|
||||
# GitLab commits
|
||||
\bgitlab\.[^/\s"]*/(?:[^/\s"]+/){2}commits?/[0-9a-f]+\b
|
||||
|
||||
# #includes
|
||||
^\s*#include\s*(?:<.*?>|".*?")
|
||||
|
||||
# #pragma lib
|
||||
^\s*#pragma comment\(lib, ".*?"\)
|
||||
|
||||
# binance
|
||||
accounts\.binance\.com/[a-z/]*oauth/authorize\?[-0-9a-zA-Z&%]*
|
||||
|
||||
@@ -240,7 +219,7 @@ accounts\.binance\.com/[a-z/]*oauth/authorize\?[-0-9a-zA-Z&%]*
|
||||
\bmedium\.com/@?[^/\s"]+/[-\w]+
|
||||
|
||||
# microsoft
|
||||
\b(?:https?://|)(?:(?:(?:blogs|download\.visualstudio|docs|msdn2?|research)\.|)microsoft|blogs\.msdn)\.co(?:m|\.\w\w)/[-_a-zA-Z0-9()=./%]*
|
||||
\b(?:https?://|)(?:(?:download\.visualstudio|docs|msdn2?|research)\.microsoft|blogs\.msdn)\.com/[-_a-zA-Z0-9()=./%]*
|
||||
# powerbi
|
||||
\bapp\.powerbi\.com/reportEmbed/[^"' ]*
|
||||
# vs devops
|
||||
@@ -414,7 +393,7 @@ ipfs://[0-9a-zA-Z]{3,}
|
||||
\bgetopts\s+(?:"[^"]+"|'[^']+')
|
||||
|
||||
# ANSI color codes
|
||||
(?:\\(?:u00|x)1[Bb]|\\03[1-7]|\x1b|\\u\{1[Bb]\})\[\d+(?:;\d+)*m
|
||||
(?:\\(?:u00|x)1[Bb]|\x1b|\\u\{1[Bb]\})\[\d+(?:;\d+|)m
|
||||
|
||||
# URL escaped characters
|
||||
%[0-9A-F][A-F](?=[A-Za-z])
|
||||
@@ -450,14 +429,10 @@ sha\d+:[0-9a-f]*?[a-f]{3,}[0-9a-f]*
|
||||
# pki (base64)
|
||||
LS0tLS1CRUdJT.*
|
||||
|
||||
# C# includes
|
||||
^\s*using [^;]+;
|
||||
|
||||
# uuid:
|
||||
\b[0-9a-fA-F]{8}-(?:[0-9a-fA-F]{4}-){3}[0-9a-fA-F]{12}\b
|
||||
# hex digits including css/html color classes:
|
||||
(?:[\\0][xX]|\\u\{?|[uU]\+|#x?|%23|&H)[0-9_a-fA-FgGrR]*?[a-fA-FgGrR]{2,}[0-9_a-fA-FgGrR]*(?:[uUlL]{0,3}|[iu]\d+)\b
|
||||
|
||||
(?:[\\0][xX]|\\u|[uU]\+|#x?|%23)[0-9_a-fA-FgGrR]*?[a-fA-FgGrR]{2,}[0-9_a-fA-FgGrR]*(?:[uUlL]{0,3}|[iu]\d+)\b
|
||||
# integrity
|
||||
integrity=(['"])(?:\s*sha\d+-[-a-zA-Z=;:/0-9+]{40,})+\g{-1}
|
||||
|
||||
@@ -475,10 +450,7 @@ integrity=(['"])(?:\s*sha\d+-[-a-zA-Z=;:/0-9+]{40,})+\g{-1}
|
||||
Name\[[^\]]+\]=.*
|
||||
|
||||
# IServiceProvider / isAThing
|
||||
(?:(?:\b|_|(?<=[a-z]))I|(?:\b|_)(?:nsI|isA))(?=(?:[A-Z][a-z]{2,})+(?:[A-Z\d]|\b))
|
||||
|
||||
# python
|
||||
#\b(?i)py(?!gments|gmy|lon|ramid|ro|th)(?=[a-z]{2,})
|
||||
(?:\b|_)(?:(?:ns|)I|isA)(?=(?:[A-Z][a-z]{2,})+(?:[A-Z\d]|\b))
|
||||
|
||||
# crypt
|
||||
(['"])\$2[ayb]\$.{56}\g{-1}
|
||||
@@ -492,14 +464,17 @@ Name\[[^\]]+\]=.*
|
||||
# machine learning (?)
|
||||
#\b(?i)ml(?=[a-z]{2,})
|
||||
|
||||
# python
|
||||
#\b(?i)py(?!gments|gmy|lon|ramid|ro|th)(?=[a-z]{2,})
|
||||
|
||||
# scrypt / argon
|
||||
\$(?:scrypt|argon\d+[di]*)\$\S+
|
||||
|
||||
# go.sum
|
||||
\bh1:\S+
|
||||
|
||||
# imports
|
||||
^import\s+(?:(?:static|type)\s+|)(?:[\w.]|\{\s*\w*?(?:,\s*(?:\w*|\*))+\s*\})+
|
||||
# scala imports
|
||||
^import (?:[\w.]|\{\w*?(?:,\s*(?:\w*|\*))+\})+
|
||||
|
||||
# scala modules
|
||||
#("[^"]+"\s*%%?\s*){2,3}"[^"]+"
|
||||
@@ -508,13 +483,13 @@ Name\[[^\]]+\]=.*
|
||||
image: [-\w./:@]+
|
||||
|
||||
# Docker images
|
||||
^\s*(?i)FROM\s+\S+:\S+(?:\s+AS\s+\S+|)
|
||||
^\s*FROM\s+\S+:\S+(?:\s+AS\s+\S+|)
|
||||
|
||||
# `docker images` REPOSITORY TAG IMAGE ID CREATED SIZE
|
||||
\s*\S+/\S+\s+\S+\s+[0-9a-f]{8,}\s+\d+\s+(?:hour|day|week)s ago\s+[\d.]+[KMGT]B
|
||||
|
||||
# Intel intrinsics
|
||||
_mm\d*_(?!dd)\w+
|
||||
_mm_(?!dd)\w+
|
||||
|
||||
# Input to GitHub JSON
|
||||
content: (['"])[-a-zA-Z=;:/0-9+]*=\g{-1}
|
||||
@@ -548,7 +523,7 @@ content: (['"])[-a-zA-Z=;:/0-9+]*=\g{-1}
|
||||
# javascript replace regex
|
||||
\.replace\(/[^/\s"]{3,}/[gim]*\s*,
|
||||
# assign regex
|
||||
= /[^*].*?(?:[a-z]{3,}|[A-Z]{3,}|[A-Z][a-z]{2,}).*/[gim]*(?=\W|$)
|
||||
= /[^*].*?(?:[a-z]{3,}|[A-Z]{3,}|[A-Z][a-z]{2,}).*/[gi]?(?=\W|$)
|
||||
# perl regex test
|
||||
[!=]~ (?:/.*/|m\{.*?\}|m<.*?>|m([|!/@#,;']).*?\g{-1})
|
||||
|
||||
@@ -562,7 +537,7 @@ perl(?:\s+-[a-zA-Z]\w*)+
|
||||
#(?:\d|\bh)to(?!ken)(?=[a-z])|to(?=[adhiklpun]\()
|
||||
|
||||
# Go regular expressions
|
||||
regexp?\.MustCompile\((?:`[^`]*`|".*"|'.*')\)
|
||||
regexp?\.MustCompile\(`[^`]*`\)
|
||||
|
||||
# regex choice
|
||||
\(\?:[^)]+\|[^)]+\)
|
||||
@@ -610,7 +585,7 @@ urn:shemas-jetbrains-com
|
||||
# xcode
|
||||
|
||||
# xcodeproject scenes
|
||||
(?:Controller|destination|(?:first|second)Item|ID|id)="\w{3}-\w{2}-\w{3}"
|
||||
(?:Controller|destination|ID|id)="\w{3}-\w{2}-\w{3}"
|
||||
|
||||
# xcode api botches
|
||||
customObjectInstantitationMethod
|
||||
@@ -625,33 +600,27 @@ PrependWithABINamepsace
|
||||
\.fa-[-a-z0-9]+
|
||||
|
||||
# bearer auth
|
||||
(['"])[Bb]ear[e][r] .{3,}?\g{-1}
|
||||
(['"])[Bb]ear[e][r] .*?\g{-1}
|
||||
|
||||
# bearer auth
|
||||
\b[Bb]ear[e][r]:? [-a-zA-Z=;:/0-9+.]{3,}
|
||||
\b[Bb]ear[e][r]:? [-a-zA-Z=;:/0-9+.]+
|
||||
|
||||
# basic auth
|
||||
(['"])[Bb]asic [-a-zA-Z=;:/0-9+]{3,}\g{-1}
|
||||
|
||||
# basic auth
|
||||
: [Bb]asic [-a-zA-Z=;:/0-9+.]{3,}
|
||||
|
||||
# base64 encoded content
|
||||
#([`'"])[-a-zA-Z=;:/0-9+]{3,}=\g{-1}
|
||||
# base64 encoded content in xml/sgml
|
||||
>[-a-zA-Z=;:/0-9+]{3,}=</
|
||||
# base64 encoded content, possibly wrapped in mime
|
||||
#(?:^|[\s=;:?])[-a-zA-Z=;:/0-9+]{50,}(?:[\s=;:?]|$)
|
||||
(?:^|[\s=;:?])[-a-zA-Z=;:/0-9+]{50,}(?:[\s=;:?]|$)
|
||||
# base64 encoded json
|
||||
\beyJ[-a-zA-Z=;:/0-9+]+
|
||||
# base64 encoded pkcs
|
||||
#\bMII[-a-zA-Z=;:/0-9+]+
|
||||
|
||||
# uuencoded
|
||||
#[!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_]{40,}
|
||||
\bMII[-a-zA-Z=;:/0-9+]+
|
||||
|
||||
# DNS rr data
|
||||
#(?:\d+\s+){3}(?:[-+/=.\w]{2,}\s*){1,2}
|
||||
(?:\d+\s+){3}(?:[-+/=.\w]{2,}\s*){1,2}
|
||||
|
||||
# encoded-word
|
||||
=\?[-a-zA-Z0-9"*%]+\?[BQ]\?[^?]{0,75}\?=
|
||||
@@ -660,7 +629,7 @@ PrependWithABINamepsace
|
||||
\bnumer\b(?=.*denom)
|
||||
|
||||
# Time Zones
|
||||
\b(?:Africa|Atlantic|America|Antarctica|Arctic|Asia|Australia|Europe|Indian|Pacific)(?:/[-\w]+)+
|
||||
\b(?:Africa|Atlantic|America|Antarctica|Asia|Australia|Europe|Indian|Pacific)(?:/\w+)+
|
||||
|
||||
# linux kernel info
|
||||
^(?:bugs|flags|Features)\s+:.*
|
||||
@@ -700,13 +669,13 @@ systemd.*?running in system mode \([-+].*\)$
|
||||
TeX/AMS
|
||||
|
||||
# File extensions
|
||||
#\*\.[+\w]+,
|
||||
\*\.[+\w]+,
|
||||
|
||||
# eslint
|
||||
"varsIgnorePattern": ".+"
|
||||
|
||||
# nolint
|
||||
nolint:\s*[\w,]+
|
||||
nolint:\w+
|
||||
|
||||
# Windows short paths
|
||||
[/\\][^/\\]{5,6}~\d{1,2}(?=[/\\])
|
||||
@@ -714,9 +683,6 @@ nolint:\s*[\w,]+
|
||||
# Windows Resources with accelerators
|
||||
\b[A-Z]&[a-z]+\b(?!;)
|
||||
|
||||
# signed off by
|
||||
(?i)Signed-off-by: .*
|
||||
|
||||
# cygwin paths
|
||||
/cygdrive/[a-zA-Z]/(?:Program Files(?: \(.*?\)| ?)(?:/[-+.~\\/()\w ]+)*|[-+.~\\/()\w])+
|
||||
|
||||
@@ -749,31 +715,29 @@ W/"[^"]+"
|
||||
|
||||
# Compiler flags (Unix, Java/Scala)
|
||||
# Use if you have things like `-Pdocker` and want to treat them as `docker`
|
||||
#(?:^|[\t ,>"'`=(#])-(?:(?:J-|)[DPWXY]|[Llf])(?=[A-Z]{2,}|[A-Z][a-z]|[a-z]{2,})
|
||||
#(?:^|[\t ,>"'`=(])-(?:(?:J-|)[DPWXY]|[Llf])(?=[A-Z]{2,}|[A-Z][a-z]|[a-z]{2,})
|
||||
|
||||
# Compiler flags (Windows / PowerShell)
|
||||
# This is a subset of the more general compiler flags pattern.
|
||||
# It avoids matching `-Path` to prevent it from being treated as `ath`
|
||||
#(?:^|[\t ,"'`=(#])-(?:[DPL](?=[A-Z]{2,})|[WXYlf](?=[A-Z]{2,}|[A-Z][a-z]|[a-z]{2,}))
|
||||
#(?:^|[\t ,"'`=(])-(?:[DPL](?=[A-Z]{2,})|[WXYlf](?=[A-Z]{2,}|[A-Z][a-z]|[a-z]{2,}))
|
||||
|
||||
# Compiler flags (linker)
|
||||
,-B
|
||||
|
||||
# Library prefix
|
||||
# e.g., `lib`+`archive`, `lib`+`raw`, `lib`+`unwind`
|
||||
# (ignores some words that happen to start with `lib`)
|
||||
(?:\b|_)[Ll]ib(?:re(?=office)|)(?!era[lt]|ero|erty|rar(?:i(?:an|es)|y))(?=[a-z])
|
||||
|
||||
# iSCSI iqn (approximate regex)
|
||||
\biqn\.[0-9]{4}-[0-9]{2}(?:[\.-][a-z][a-z0-9]*)*\b
|
||||
# libraries
|
||||
(?:\b|_)lib(?:re(?=office)|)(?!era[lt]|ero|erty|rar(?:i(?:an|es)|y))(?=[a-z])
|
||||
|
||||
# WWNN/WWPN (NAA identifiers)
|
||||
\b(?:0x)?10[0-9a-f]{14}\b|\b(?:0x|3)?[25][0-9a-f]{15}\b|\b(?:0x|3)?6[0-9a-f]{31}\b
|
||||
|
||||
# iSCSI iqn (approximate regex)
|
||||
\biqn\.[0-9]{4}-[0-9]{2}(?:[\.-][a-z][a-z0-9]*)*\b
|
||||
|
||||
# curl arguments
|
||||
\b(?:\\n|)curl(?:\.exe|)(?:\s+-[a-zA-Z]{1,2}\b)*(?:\s+-[a-zA-Z]{3,})(?:\s+-[a-zA-Z]+)*
|
||||
# set arguments
|
||||
\b(?:bash|sh|set)(?:\s+[-+][abefimouxE]{1,2})*\s+[-+][abefimouxE]{3,}(?:\s+[-+][abefimouxE]+)*
|
||||
\b(?:bash|sh|set)(?:\s+-[abefimouxE]{1,2})*\s+-[abefimouxE]{3,}(?:\s+-[abefimouxE]+)*
|
||||
# tar arguments
|
||||
\b(?:\\n|)g?tar(?:\.exe|)(?:(?:\s+--[-a-zA-Z]+|\s+-[a-zA-Z]+|\s[ABGJMOPRSUWZacdfh-pr-xz]+\b)(?:=[^ ]*|))+
|
||||
# tput arguments -- https://man7.org/linux/man-pages/man5/terminfo.5.html -- technically they can be more than 5 chars long...
|
||||
|
||||
45
.github/actions/spell-check/excludes.txt
vendored
45
.github/actions/spell-check/excludes.txt
vendored
@@ -73,9 +73,7 @@
|
||||
\.qm$
|
||||
\.s$
|
||||
\.sig$
|
||||
\.snk$
|
||||
\.so$
|
||||
\.stl$
|
||||
\.svgz?$
|
||||
\.sys$
|
||||
\.tar$
|
||||
@@ -92,41 +90,40 @@
|
||||
\.xz$
|
||||
\.zip$
|
||||
^\.github/actions/spell-check/
|
||||
^\.github/workflows/spelling\d*\.yml$
|
||||
^\.gitmodules$
|
||||
^\Q.github/workflows/spelling2.yml\E$
|
||||
^\Q.pipelines/272MSSharedLibSN2048.snk\E$
|
||||
^\Q.pipelines/ESRPSigning_core.json\E$
|
||||
^\Qdoc/devdocs/localization.md\E$
|
||||
^\Qsrc/common/ManagedCommon/ColorFormatHelper.cs\E$
|
||||
^\Qsrc/common/notifications/BackgroundActivatorDLL/cpp.hint\E$
|
||||
^\Qsrc/modules/cmdpal/doc/initial-sdk-spec/list-elements-mock-002.pdn\E$
|
||||
^\Qsrc/modules/colorPicker/ColorPickerUI/Assets/ColorPicker/colorPicker.cur\E$
|
||||
^\Qsrc/modules/colorPicker/ColorPickerUI/Shaders/GridShader.cso\E$
|
||||
^\Qsrc/modules/MouseUtils/MouseJump.Common/NativeMethods/User32/UI/WindowsAndMessaging/User32.SYSTEM_METRICS_INDEX.cs\E$
|
||||
^\Qsrc/modules/MouseUtils/MouseJumpUI/MainForm.resx\E$
|
||||
^\Qsrc/modules/MouseWithoutBorders/App/Form/frmAbout.cs\E$
|
||||
^\Qsrc/modules/MouseWithoutBorders/App/Form/frmInputCallback.resx\E$
|
||||
^\Qsrc/modules/MouseWithoutBorders/App/Form/frmLogon.resx\E$
|
||||
^\Qsrc/modules/MouseWithoutBorders/App/Form/frmMatrix.resx\E$
|
||||
^\Qsrc/modules/MouseWithoutBorders/App/Form/frmMessage.resx\E$
|
||||
^\Qsrc/modules/MouseWithoutBorders/App/Form/frmMouseCursor.resx\E$
|
||||
^\Qsrc/modules/MouseWithoutBorders/App/Form/frmScreen.resx\E$
|
||||
^\Qsrc/modules/MouseWithoutBorders/ModuleInterface/generateSecurityDescriptor.h\E$
|
||||
^\Qsrc/modules/peek/Peek.Common/NativeMethods.txt\E$
|
||||
^\Qsrc/modules/previewpane/SvgPreviewHandler/SvgHTMLPreviewGenerator.cs\E$
|
||||
^\Qsrc/modules/previewpane/UnitTests-StlThumbnailProvider/HelperFiles/sample.stl\E$
|
||||
^\Qtools/project_template/ModuleTemplate/resource.h\E$
|
||||
^doc/devdocs/akaLinks\.md$
|
||||
^NOTICE\.md$
|
||||
^src/common/CalculatorEngineCommon/exprtk\.hpp$
|
||||
^src/common/ManagedCommon/ColorFormatHelper\.cs$
|
||||
^src/common/notifications/BackgroundActivatorDLL/cpp\.hint$
|
||||
^src/common/sysinternals/Eula/
|
||||
^src/modules/cmdpal/doc/initial-sdk-spec/list-elements-mock-002\.pdn$
|
||||
^src/modules/colorPicker/ColorPickerUI/Shaders/GridShader\.cso$
|
||||
^src/modules/launcher/Plugins/Microsoft\.PowerToys\.Run\.Plugin\.TimeDate/Properties/
|
||||
^src/modules/MouseUtils/MouseJumpUI/MainForm\.resx$
|
||||
^src/modules/MouseWithoutBorders/App/.*/NativeMethods\.cs$
|
||||
^src/modules/MouseWithoutBorders/App/Form/.*\.Designer\.cs$
|
||||
^src/modules/MouseWithoutBorders/App/Form/.*\.resx$
|
||||
^src/modules/MouseWithoutBorders/App/Form/frmAbout\.cs$
|
||||
^src/modules/MouseWithoutBorders/App/Form/frmInputCallback\.resx$
|
||||
^src/modules/MouseWithoutBorders/App/Form/frmLogon\.resx$
|
||||
^src/modules/MouseWithoutBorders/App/Form/frmMatrix\.resx$
|
||||
^src/modules/MouseWithoutBorders/App/Form/frmMessage\.resx$
|
||||
^src/modules/MouseWithoutBorders/App/Form/frmMouseCursor\.resx$
|
||||
^src/modules/MouseWithoutBorders/App/Form/frmScreen\.resx$
|
||||
^src/modules/MouseWithoutBorders/App/Helper/.*\.resx$
|
||||
^src/modules/MouseWithoutBorders/ModuleInterface/generateSecurityDescriptor\.h$
|
||||
^src/modules/peek/Peek.Common/NativeMethods\.txt$
|
||||
^src/modules/previewpane/SvgPreviewHandler/SvgHTMLPreviewGenerator\.cs$
|
||||
^src/modules/previewpane/UnitTests-MarkdownPreviewHandler/HelperFiles/MarkdownWithHTMLImageTag\.txt$
|
||||
^src/modules/registrypreview/RegistryPreviewUILib/Controls/HexBox/.*$
|
||||
^src/modules/ZoomIt/ZoomIt/ZoomIt\.idc$
|
||||
^src/Monaco/
|
||||
^tools/project_template/ModuleTemplate/resource\.h$
|
||||
^src/common/sysinternals/Eula/
|
||||
^tools/Verification scripts/Check preview handler registration\.ps1$
|
||||
ignore$
|
||||
^src/modules/registrypreview/RegistryPreviewUILib/Controls/HexBox/.*$
|
||||
^src/common/CalculatorEngineCommon/exprtk\.hpp$
|
||||
|
||||
233
.github/actions/spell-check/expect.txt
vendored
233
.github/actions/spell-check/expect.txt
vendored
File diff suppressed because it is too large
Load Diff
313
.github/actions/spell-check/line_forbidden.patterns
vendored
313
.github/actions/spell-check/line_forbidden.patterns
vendored
@@ -8,31 +8,6 @@
|
||||
# you might not want to check in code where you skip all the other tests.
|
||||
#\bfit\(
|
||||
|
||||
# English does not use a hyphen between adverbs and nouns
|
||||
# https://twitter.com/nyttypos/status/1894815686192685239
|
||||
(?:^|\s)[A-Z]?[a-z]+ly-(?=[a-z]{3,})(?:[.,?!]?\s|$)
|
||||
|
||||
# Smart quotes should match
|
||||
\s’[^.?!‘’]+’[^.?!‘’]+‘[^.?!‘’]+’|\s‘[^.?!‘’]+’[^.?!‘’]+’[^.?!‘’]+’|\s”[^.?!“”]+”[^.?!“”]+“[^.?!“”]+”|\s“[^.?!“”]+”[^.?!“”]+”[^.?!“”]+”
|
||||
|
||||
# Don't use `requires that` + `to be`
|
||||
# https://twitter.com/nyttypos/status/1894816551435641027
|
||||
\brequires that \w+\b[^.]+to be\b
|
||||
|
||||
# A fully parenthetical sentence’s period goes inside the parentheses, not outside.
|
||||
# https://twitter.com/nyttypos/status/1898844061873639490
|
||||
\([A-Z][a-z]{2,}(?: [a-z]+){3,}\)\.\s
|
||||
|
||||
# Complete sentences shouldn't be in the middle of another sentence as a parenthetical.
|
||||
(?<!\.)(?<!\betc)\.\),
|
||||
|
||||
# Complete sentences in parentheticals should not have a space before the period.
|
||||
\s\.\)(?!.*\}\})
|
||||
|
||||
# This probably indicates Mojibake https://en.wikipedia.org/wiki/Mojibake
|
||||
# You probably should try to unbake this content
|
||||
Ã(?:Â[¤¶¥]|[£¢])|Ã
|
||||
|
||||
# Should be `HH:MM:SS`
|
||||
\bHH:SS:MM\b
|
||||
|
||||
@@ -49,74 +24,18 @@
|
||||
# Should be `a priori` or `and prior`
|
||||
(?i)(?<!posteriori)\sand priori\s
|
||||
|
||||
# Should be `a`
|
||||
\san (?=(?:[b-df-gj-npqtv-xz]|h(?!our|tml|ttp)|r(?!c\b)|s(?!sh|vg))[a-z])
|
||||
|
||||
# Articles generally shouldn't be used without a noun and a verb
|
||||
# - Perhaps you're missing a verb between the noun and the second article.
|
||||
# - Or, perhaps you should remove the first verb and treat the intervening word as a verb?
|
||||
# - In some cases you should add a `,` between the noun and the second article.
|
||||
\s(?:an?|the(?! action))\s(?!way|wh|how\b)[A-Za-z][a-z]+[a-qs-z]\s(?:a(?! bit)n?|the)\s
|
||||
|
||||
# Should only be one of `a`, `an`, or `the`
|
||||
\b(?:(?:an?|the)\s+){2,}\b
|
||||
|
||||
# Should be a list `something, a second thing, or a third thing` or `something, a thing to do a thing`
|
||||
# -- This rule is experimental, if you find it has a high false-positive rate, please let the maintainer know
|
||||
#(?:^|[?!.] )[^()?!;,.]+, a(?:\s+(?!to\b)\w+)+?\s+an?\b
|
||||
|
||||
# Should only be `are` or `can`, not both
|
||||
\b(?:(?:are|can)\s+){2,}\b
|
||||
|
||||
# Should probably be `ABCDEFGHIJKLMNOPQRSTUVWXYZ`
|
||||
(?i)(?!ABCDEFGHIJKLMNOPQRSTUVWXYZ)ABC[A-Z]{21}YZ
|
||||
|
||||
# Should be `an`
|
||||
#(?<!\b[Ii] |\.)\bam\b
|
||||
|
||||
# Should be `anymore`
|
||||
\bany more[,.]
|
||||
|
||||
# Should be `Ask`
|
||||
(?:^|[.?]\s+)As\s+[A-Z][a-z]{2,}\s[^.?]*?(?:how|if|wh\w+)\b
|
||||
|
||||
# Should be `at one fell swoop`
|
||||
# and only when talking about killing, not some other completion
|
||||
# Act 4 Scene 3, Macbeth
|
||||
# https://www.opensourceshakespeare.org/views/plays/play_view.php?WorkID=macbeth&Act=4&Scene=3&Scope=scene
|
||||
\bin one fell s[lw]?oop\b
|
||||
|
||||
# Should be `'`
|
||||
(?i)\b(?:(?:i|s?he|they|what|who|you)[`"]ll|(?:are|ca|did|do|does|ha[ds]|have|is|should|were|wo|would)n[`"]t|(?:s?he|let|that|there|what|where|who)[`"]s|(?:i|they|we|what|who|you)[`"]ve)\b
|
||||
|
||||
# Should be `background` / `intro text` / `introduction` / `prologue` unless it's a brand or relates to _subterfuge_
|
||||
(?i)\bpretext\b
|
||||
|
||||
# Should be `bearer`
|
||||
\b(?<=the )burden(?= of bad news\b)
|
||||
|
||||
# Should be `bona`
|
||||
# unless talking about bones
|
||||
\bbone(?= fide\b)
|
||||
|
||||
# Should be `branches`
|
||||
# ... unless it's really about the meal that replaces breakfast and lunch.
|
||||
\b[Bb]runches\b
|
||||
(?i)\b(?:(?:i|s?he|they|what|who|you)"ll|(?:are|ca|did|do|does|ha[ds]|have|is|should|were|wo|would)n"t|(?:s?he|let|that|there|what|where|who)"s|(?:i|they|we|what|who|you)"ve)\b
|
||||
|
||||
# Should be `briefcase`
|
||||
\bbrief-case\b
|
||||
|
||||
# Should be `by far` or `far and away`
|
||||
\bby far and away\b
|
||||
|
||||
# Should be `by and large`
|
||||
\bby in large\b
|
||||
|
||||
# Should be `bytes`
|
||||
# unless talking about sports where a team gets to skip a game, or
|
||||
# saying `goodbyes` (even this is questionable)
|
||||
(?<!\\)\bbyes\b
|
||||
|
||||
# Should be `can, not only ..., ... also...`
|
||||
\bcan not only.*can also\b
|
||||
|
||||
@@ -127,10 +46,7 @@
|
||||
# > In formal writing and where contractions are frowned upon, use `cannot`.
|
||||
# > It is possible to write `can not`, but you generally find it only as part of some other construction, such as `not only . . . but also.`
|
||||
# - if you encounter such a case, add a pattern for that case to patterns.txt.
|
||||
\b[Cc]an not\b(?! only\b)
|
||||
|
||||
# Should be `chart`
|
||||
(?i)\bhelm\b.*\bchard\b
|
||||
\b[Cc]an not\b
|
||||
|
||||
# Do not use `(click) here` links
|
||||
# For more information, see:
|
||||
@@ -140,49 +56,19 @@
|
||||
# * https://heyoka.medium.com/dont-use-click-here-f32f445d1021
|
||||
(?i)(?:>|\[)(?:(?:click |)here|this(?=\]\([^\)]+:/)|link|(?:read |)more(?!</value))(?:</|\]\()
|
||||
|
||||
# Including "image of" or "picture of" in alt text is unnecessary.
|
||||
\balt=['"](?:an? |)(?:image|picture) of
|
||||
|
||||
# Alt text should be short
|
||||
\balt=(?:'[^']{126,}'|"[^"]{126,}")
|
||||
|
||||
# Should be `effect`
|
||||
(?<=\btake )affect\b
|
||||
|
||||
# Should be `-endian`
|
||||
\b(?i)(?<=big|little) endian\b
|
||||
|
||||
# Should be `equals` to `is equal to`
|
||||
\bequals to\b
|
||||
|
||||
# Should be `ECMA` 262 (JavaScript)
|
||||
(?i)\bTS\/EMCA\b|\bEMCA(?: \d|\s*Script)|\bEMCA\b(?=.*\bTS\b)
|
||||
|
||||
# Should be `ECMA` 340 (Near Field Communications)
|
||||
(?i)EMCA[- ]340
|
||||
|
||||
# Should be `fall back`
|
||||
\bfallback(?= to)\b
|
||||
|
||||
# Should be `for`, `for, to` or `to`
|
||||
\b(?:for to|to for)\b
|
||||
|
||||
# Should be `GitHub`
|
||||
(?<![&*.]|// |\b(?:from|import|type) )\bGithub\b(?![{()])
|
||||
|
||||
# Should be `GitLab`
|
||||
(?<![&*.]|// |\b(?:from|import|type) )\bGitlab\b(?![{()])
|
||||
|
||||
# Should be `heartrending` unless talking about drawing hearts
|
||||
\b(?i)heart[- ]rendering\b(?![^.?!]*(?:hearts|quirk))
|
||||
|
||||
# Should probably be `https://`...
|
||||
# Markdown generally doesn't assume that links are to urls
|
||||
\]\(www\.\w
|
||||
|
||||
# Should be `intents and purposes`
|
||||
(?<=[Ff]or all )intensive purposes\b
|
||||
|
||||
# Should be `JavaScript`
|
||||
\bJavascript\b
|
||||
|
||||
@@ -198,14 +84,11 @@
|
||||
# Should be `RabbitMQ`
|
||||
\bRabbitmq\b
|
||||
|
||||
# Should be `TensorFlow`
|
||||
\bTensorflow\b
|
||||
|
||||
# Should be `TypeScript`
|
||||
\bTypescript\b
|
||||
|
||||
# Should be `another`
|
||||
\ban[- ]other(?!-)\b
|
||||
\ban[- ]other\b
|
||||
|
||||
# Should be `case-(in)sensitive`
|
||||
\bcase (?:in|)sensitive\b
|
||||
@@ -225,14 +108,11 @@
|
||||
# Should be `here-in`, `the`, `them`, `this`, `these` or reworded in some other way
|
||||
\bthe here(?:\.|,| (?!and|defined))
|
||||
|
||||
# Should be `going to bed` or `going to a bad`
|
||||
\bgoing to bad(?!-)\b
|
||||
|
||||
# Should be `greater than`
|
||||
#\bhigher than\b
|
||||
\bhigher than\b
|
||||
|
||||
# Should be `ID` (unless it's a flag/property)
|
||||
#(?<![-\.])\bId\b(?![(])
|
||||
# Should be `ID`
|
||||
#\bId\b
|
||||
|
||||
# Should be `in front of`
|
||||
\bin from of\b
|
||||
@@ -245,26 +125,14 @@
|
||||
# Should be `use`
|
||||
\sin used by\b
|
||||
|
||||
# Should be `in-depth` if used as an adjective (but `in depth` when used as an adverb)
|
||||
\bin depth\s(?!rather\b)\w{6,}
|
||||
|
||||
# Should be `in-flight` or `on the fly` (unless actually talking about airline flights)
|
||||
\bon[- ]flight\b(?!=\s+(?:(?:\w{2}|)\d+|availability|booking|computer|data|delay|departure|management|performance|radar|reservation|scheduling|software|status|ticket|time|type|.*(?:hotel|taxi)))
|
||||
|
||||
# Should be `is obsolete`
|
||||
\bis obsolescent\b
|
||||
|
||||
# Should be `it's` or `its`
|
||||
(?<![.'])\bits['’]
|
||||
\bits['’]
|
||||
|
||||
# Should be `its`
|
||||
\bit's(?= (?:child|only purpose|own(?:er|)|parent|sibling)\b)
|
||||
|
||||
# Should be `for its` (possessive) or `because it is`
|
||||
\bfor it(?:'s| is)\b
|
||||
|
||||
# Should be `lends`
|
||||
\bleads(?= credence)
|
||||
\bit's(?= own\b)
|
||||
|
||||
# Should be `log in`
|
||||
\blogin to the
|
||||
@@ -272,34 +140,12 @@
|
||||
# Should be `long-standing`
|
||||
\blong standing\b
|
||||
|
||||
# Should be `lose`
|
||||
(?<=\bwill )loose\b
|
||||
|
||||
# `apt-key` is deprecated
|
||||
# ... instead you should be writing a pair of files:
|
||||
# ... * the gpg key added to a distinct key ring file based on your project/distro/key...
|
||||
# ... * the sources.list in a district file -- not simply appended to `/etc/apt/sources.list` -- (there is a newer format [DEB822](https://manpages.debian.org/bookworm/dpkg-dev/deb822.5.en.html)) that references the gpg key.
|
||||
# Consider:
|
||||
# ````sh
|
||||
# curl http://download.something.example.com/$DISTRO/Release.key | \
|
||||
# gpg --dearmor --yes --output /usr/share/keyrings/something-distro.gpg
|
||||
# echo "deb [signed-by=/usr/share/keyrings/something-distro.gpg] http://download.something.example.com/repositories/home:/$DISTRO ./" \
|
||||
# >> /etc/apt/sources.list.d/something-distro.list
|
||||
# ````
|
||||
\bapt-key add\b
|
||||
|
||||
# Should be `nearby`
|
||||
\bnear by\b
|
||||
|
||||
# Should probably be a person named `Nick` or the abbreviation `NIC`
|
||||
\bNic\b
|
||||
|
||||
# Should be `not supposed`
|
||||
\bsupposed not\b
|
||||
|
||||
# Should be `Once this` or `On this` or even `One that`. Rarely `One, this`
|
||||
[?!.] One this\b
|
||||
|
||||
# Should probably be `much more`
|
||||
\bmore much\b
|
||||
|
||||
@@ -307,10 +153,7 @@
|
||||
\bperform it's\b
|
||||
|
||||
# Should be `opt-in`
|
||||
(?<!\scan|for)(?<!\smust)(?<!\sif)\sopt in\s
|
||||
|
||||
# Should be `out-of-date` if acting as an adjective before a noun
|
||||
\bout of date(?= \w{3,}\b)
|
||||
(?<!\scan|for)(?<!\sif)\sopt in\s
|
||||
|
||||
# Should be `less than`
|
||||
\bless then\b
|
||||
@@ -327,89 +170,24 @@
|
||||
# Should be `on the other hand`
|
||||
\b(?i)on another hand\b
|
||||
|
||||
# Reword to `on at runtime` or `enabled at launch`
|
||||
# The former if you mean it can be changed dynamically.
|
||||
# The latter if you mean that it can be changed without recompiling but not after the program starts.
|
||||
\bswitched on runtime\b
|
||||
|
||||
# Should be `Of course,`
|
||||
[?.!]\s+Of course\s(?=[-\w\s]+[.?;!,])
|
||||
|
||||
# Most people only have two hands. Reword.
|
||||
\b(?i)on the third hand\b
|
||||
|
||||
# Should be `Open Graph`
|
||||
# unless talking about a specific Open Graph implementation:
|
||||
# - Java
|
||||
# - Node
|
||||
# - Py
|
||||
# - Ruby
|
||||
\bOpenGraph\b
|
||||
|
||||
# Should be `OpenShift`
|
||||
\bOpenshift\b
|
||||
|
||||
# Should be `otherwise`
|
||||
\bother[- ]wise\b
|
||||
|
||||
# Should be `; otherwise` or `. Otherwise`
|
||||
# https://study.com/learn/lesson/otherwise-in-a-sentence.html
|
||||
, [Oo]therwise\b
|
||||
|
||||
# Should probably be `Otherwise,`
|
||||
(?<=\. )Otherwise\s
|
||||
|
||||
# Should be `or (more|less)`
|
||||
\bore (?:more|less)\b
|
||||
|
||||
# Should be `or`
|
||||
\b(?i)true of .*false\b
|
||||
|
||||
# Should be `pale`
|
||||
\b(?<=beyond the )pail\b
|
||||
|
||||
# Should be reworded.
|
||||
# `passthrough` is an adjective
|
||||
# `pass-through` could be a noun
|
||||
# `pass through` would be a verb phrase
|
||||
\b(?i)passthrough(?= an?\b)
|
||||
|
||||
# Should be `rather than`
|
||||
\brather then\b
|
||||
|
||||
# Should be `Red Hat`
|
||||
\bRed[Hh]at\b
|
||||
|
||||
# Should be `regardless, ...` or `regardless of (whether)`
|
||||
\b[Rr]egardless if you\b
|
||||
|
||||
# Should be `self-signed`
|
||||
\bself signed\b
|
||||
|
||||
# Should be `SendGrid`
|
||||
\bSendgrid\b
|
||||
|
||||
# Should be `set up` (`setup` is a noun / `set up` is a verb)
|
||||
\b[Ss]etup(?= (?:an?|the)\b)
|
||||
|
||||
# Should be `state`
|
||||
\bsate(?=\b|[A-Z])|(?<=[a-z])Sate(?=\b|[A-Z])|(?<=[A-Z]{2})Sate(?=\b|[A-Z])
|
||||
|
||||
# Should be `this`
|
||||
\b[Tt]oday(?= morning\b)
|
||||
|
||||
# Should be `let's` or `let us`
|
||||
\b[Ll]ets (?=throw\.)
|
||||
|
||||
# Should be `no longer needed`
|
||||
\bno more needed\b(?! than\b)
|
||||
|
||||
# Should be `<see|look> below for the`
|
||||
(?i)\bfind below the\b
|
||||
|
||||
# Should be `then any` unless there's a comparison before the `,`
|
||||
, than any\b
|
||||
|
||||
# Should be `did not exist`
|
||||
\bwere not existent\b
|
||||
|
||||
@@ -419,18 +197,9 @@
|
||||
# Should be `nonexistent`
|
||||
\b[Nn]o[nt][- ]existent\b
|
||||
|
||||
# Should be `our`
|
||||
\bspending out time\b
|
||||
|
||||
# Should be `@brief` / `@details` / `@param` / `@return` / `@retval`
|
||||
(?:^\s*|(?:\*|//|/*)\s+`)[\\@](?:breif|(?:detail|detials)|(?:params(?!\.)|prama?)|ret(?:uns?)|retvl)\b
|
||||
|
||||
# Should be `more than` or `more, then`
|
||||
\bmore then\b
|
||||
|
||||
# Should be `Pipeline`/`pipeline`
|
||||
(?:(?<=\b|[A-Z])p|P)ipeLine(?:\b|(?=[A-Z]))
|
||||
|
||||
# Should be `preexisting`
|
||||
[Pp]re[- ]existing
|
||||
|
||||
@@ -446,9 +215,6 @@
|
||||
# Should be `prerequisite`
|
||||
[Pp]re[- ]requisite
|
||||
|
||||
# Should be `QuickTime`
|
||||
\bQuicktime\b
|
||||
|
||||
# Should be `recently changed` or `recent changes`
|
||||
[Rr]ecent changed
|
||||
|
||||
@@ -458,30 +224,14 @@
|
||||
# Should be `reentrant`
|
||||
[Rr]e[- ]entrant
|
||||
|
||||
# Should be `room for`
|
||||
\brooms for (?!lease|rent|sale)
|
||||
|
||||
# Should be `socioeconomic`
|
||||
# https://dictionary.cambridge.org/us/dictionary/english/socioeconomic
|
||||
socio-economic
|
||||
|
||||
# Should be `strong suit`
|
||||
\b(?:my|his|her|their) strong suite\b
|
||||
|
||||
# Should probably be `temperatures` unless actually talking about thermal drafts (things birds may fly on)
|
||||
\bthermals\b
|
||||
|
||||
# Should be `there are` or `they are` (or `they're`)
|
||||
(?i)\btheir are\b
|
||||
|
||||
# Should be `understand`
|
||||
\bunder stand\b
|
||||
|
||||
# Should be `URI` or `uri` unless it refers to a person named `Uri` (or a flag)
|
||||
#(?<![-\.])\bUri\b(?![(])
|
||||
|
||||
# Should be `true`
|
||||
(?i)(?<![\[\]()])\brue(?:= or false)
|
||||
# Should be `URI` or `uri` unless it refers to a person named `Uri`
|
||||
#(?<!\.)\bUri\b(?![(])
|
||||
|
||||
# Should be `it uses is`
|
||||
/\bis uses is\b/
|
||||
@@ -495,43 +245,12 @@ socio-economic
|
||||
# Should be `where`
|
||||
\bwere they are\b
|
||||
|
||||
# Should be `why`
|
||||
, way(?= is [^.]*\?)
|
||||
|
||||
# should be `vCenter`
|
||||
\bV[Cc]enter\b
|
||||
|
||||
# Should be `VM`
|
||||
\bVm\b
|
||||
|
||||
# Should be `walkthrough(s)`
|
||||
\bwalk-throughs?\b
|
||||
|
||||
# Should be `want`
|
||||
\bdon't ant\b
|
||||
|
||||
# Should be `we'll`
|
||||
\bwe 'll\b
|
||||
|
||||
# Should be `week`
|
||||
# unless you're really talking about people or pointers
|
||||
\bevery weak[.,?!]
|
||||
|
||||
# Should be `well`
|
||||
\b[Yy]ou(?:'re| are) doing good\b
|
||||
|
||||
# Should be `whereas`
|
||||
\bwhere as\b
|
||||
|
||||
# Should be `WinGet`
|
||||
\bWinget\b
|
||||
|
||||
# Should be `without` (unless `out` is a modifier of the next word)
|
||||
\bwith out\b(?!-)
|
||||
|
||||
# Should be `work around`
|
||||
\b[Ww]orkaround(?= an?\b)
|
||||
|
||||
# Should be `workarounds`
|
||||
#\bwork[- ]arounds\b
|
||||
|
||||
@@ -548,15 +267,15 @@ socio-economic
|
||||
\b(?:coarse|fine) grained\b
|
||||
|
||||
# Homoglyph (Cyrillic) should be `A`/`B`/`C`/`E`/`H`/`I`/`I`/`J`/`K`/`M`/`O`/`P`/`S`/`T`/`Y`
|
||||
# It's possible that your content is intentionally mixing Cyrillic and Latin scripts, but if it isn't, you definitely want to correct this.
|
||||
# It's possible that your content is intentionally mixing Cyrllic and Latin scripts, but if it isn't, you definitely want to correct this.
|
||||
(?<=[A-Z]{2})[АВСЕНІӀЈКМОРЅТУ]|[АВСЕНІӀЈКМОРЅТУ](?=[A-Z]+(?:\b|[a-z]+)|[a-z]+(?:[^a-z]|$))
|
||||
|
||||
# Homoglyph (Cyrillic) should be `a`/`b`/`c`/`e`/`o`/`p`/`x`/`y`
|
||||
# It's possible that your content is intentionally mixing Cyrillic and Latin scripts, but if it isn't, you definitely want to correct this.
|
||||
[авсеорху](?=[A-Za-z]{2,})|(?<=[A-Za-z]{2})[авсеорху]|(?<=[A-Za-z])[авсеорху](?=[A-Za-z])
|
||||
# Homoglyph (Cyrillic) should be `a`/`b`/`e`
|
||||
# It's possible that your content is intentionally mixing Cyrllic and Latin scripts, but if it isn't, you definitely want to correct this.
|
||||
[аве](?=[A-Za-z]{2,})|(?<=[A-Za-z]{2})[аве]|(?<=[A-Za-z])[аве](?=[A-Za-z])
|
||||
|
||||
# Should be `neither/nor` -- or reword
|
||||
#(?<!do )\bnot\b([^.?!"/(](?!neither|,.*?,))+\bnor\b
|
||||
#(?!<do )\bnot\b([^.?!"/(](?!neither|,.*?,))+\bnor\b
|
||||
|
||||
# Should be `neither/nor` (plus rewording the beginning)
|
||||
# This is probably a double negative...
|
||||
|
||||
218
.github/actions/spell-check/patterns.txt
vendored
218
.github/actions/spell-check/patterns.txt
vendored
@@ -1,36 +1,31 @@
|
||||
# See https://github.com/check-spelling/check-spelling/wiki/Configuration-Examples:-patterns
|
||||
|
||||
# Gaelic
|
||||
Gàidhlig
|
||||
# #includes
|
||||
^\s*#include\s*(?:<.*?>|".*?")
|
||||
|
||||
Ov_erwrite
|
||||
# #pragma lib
|
||||
^\s*#pragma comment\(lib, ".*?"\)
|
||||
|
||||
# languageHashTable
|
||||
"\w+(?:-\w+|)"\s+=\s+@\(".*"\)
|
||||
|
||||
# Regular expression with `\b`
|
||||
\\b(?=[a-z]\S*\{)
|
||||
# wikipedia
|
||||
\b\w\w\.wikipedia\.org/wiki/[-\w%.#]+
|
||||
|
||||
# long lorem
|
||||
L"Lorem.*"
|
||||
# css fonts
|
||||
\bfont-family:[^;}]+
|
||||
|
||||
# .github/policies/resourceManagement.yml
|
||||
pattern: '.*'
|
||||
|
||||
# tabs in c#
|
||||
\$"\\t
|
||||
|
||||
# Hexadecimal character pattern in code
|
||||
\\x[0-9a-fA-F]{4}
|
||||
|
||||
fontFamily": ".*"
|
||||
|
||||
D[23]D(?=[A-Z][a-z])
|
||||
(?<=[a-z])3D(?=[A-Z])
|
||||
|
||||
\.monitorId = \{ .*\}
|
||||
|
||||
json::value\(L"\S+"
|
||||
\\x[0-9a-fA-F][0-9a-fA-F]
|
||||
|
||||
# windows line breaks in strings
|
||||
\\r\\n(?=[A-Za-z])
|
||||
\\r\\n
|
||||
|
||||
# power shell gallery website
|
||||
\bpowershellgallery.com/[-_a-zA-Z0-9()=./%]*
|
||||
@@ -40,22 +35,9 @@ L?(["']|[-<({>]|\b)[0-9a-fA-F]{8}-(?:[0-9a-fA-F]{4}-){3}[0-9a-fA-F]{10,12}(?:\g{
|
||||
|
||||
(?:L"[abAB]+", ){3}L"[abAB]+"
|
||||
|
||||
\. (?: @[-A-Za-z\d]+\b(?!\.[A-Z]),?)+
|
||||
|
||||
auto deviceId = L".*"
|
||||
deviceId(?:\.id|) = L".*"
|
||||
|
||||
StringComparer.OrdinalIgnoreCase\) \{.*\}
|
||||
|
||||
# namespaces
|
||||
\b[a-z]+::
|
||||
|
||||
"Author": ".+"
|
||||
|
||||
(?:Include|Link)=".*?"
|
||||
|
||||
# You could ignore `xmlns`, but it's probably better to enforce rules about them...
|
||||
#\s(?:xmlns:[a-z]+(?:[A-Z][a-z]+|)=|[a-z]+(?:[A-Z][a-z]+):(?=[a-z]+=))
|
||||
# hit-count: 1 file-count: 1
|
||||
# marker to ignore all code on line
|
||||
^.*/\* #no-spell-check-line \*/.*$
|
||||
|
||||
# UnitTests
|
||||
\[DataRow\(.*\)\]
|
||||
@@ -68,135 +50,142 @@ StringComparer.OrdinalIgnoreCase\) \{.*\}
|
||||
|
||||
# Automatically suggested patterns
|
||||
|
||||
# hit-count: 5402 file-count: 1339
|
||||
# hit-count: 3715 file-count: 992
|
||||
# IServiceProvider / isAThing
|
||||
(?:(?:\b|_|(?<=[a-z]))[IT]|(?:\b|_)(?:nsI|isA))(?=(?:[A-Z][a-z]{2,})+(?:[A-Z\d]|\b))
|
||||
(?:\b|_)(?:(?:ns|)I|isA)(?=(?:[A-Z][a-z]{2,})+(?:[A-Z\d]|\b))
|
||||
|
||||
# hit-count: 2073 file-count: 842
|
||||
# #includes
|
||||
^\s*#include\s*(?:<.*?>|".*?")
|
||||
# hit-count: 404 file-count: 42
|
||||
# base64 encoded content, possibly wrapped in mime
|
||||
(?:^|[\s=;:?])[-a-zA-Z=;:/0-9+]{50,}(?:[\s=;:?]|$)
|
||||
|
||||
# hit-count: 1639 file-count: 855
|
||||
# C# includes
|
||||
^\s*using [^;]+;
|
||||
|
||||
# hit-count: 1491 file-count: 693
|
||||
# microsoft
|
||||
\b(?:https?://|)(?:(?:(?:blogs|download\.visualstudio|docs|msdn2?|research)\.|)microsoft|blogs\.msdn)\.co(?:m|\.\w\w)/[-_a-zA-Z0-9()=./%]*
|
||||
|
||||
# hit-count: 398 file-count: 133
|
||||
# hex digits including css/html color classes:
|
||||
(?:[\\0][xX]|\\u\{?|[uU]\+|#x?|%23|&H)[0-9_a-fA-FgGrR]*?[a-fA-FgGrR]{2,}[0-9_a-fA-FgGrR]*(?:[uUlL]{0,3}|[iu]\d+)\b
|
||||
|
||||
# hit-count: 339 file-count: 146
|
||||
# hit-count: 402 file-count: 160
|
||||
# hex runs
|
||||
\b[0-9a-fA-F]{16,}\b
|
||||
|
||||
# hit-count: 253 file-count: 100
|
||||
# hit-count: 337 file-count: 110
|
||||
# hex digits including css/html color classes:
|
||||
(?:[\\0][xX]|\\u|[uU]\+|#x?|%23)[0-9_a-fA-FgGrR]*?[a-fA-FgGrR]{2,}[0-9_a-fA-FgGrR]*(?:[uUlL]{0,3}|[iu]\d+)\b
|
||||
|
||||
# hit-count: 311 file-count: 43
|
||||
# D2D
|
||||
D?2D(?!efault)
|
||||
|
||||
# hit-count: 272 file-count: 75
|
||||
# GitHub SHAs (markdown)
|
||||
(?:\[`?[0-9a-f]+`?\]\(https:/|)/(?:www\.|)github\.com(?:/[^/\s"]+){2,}(?:/[^/\s")]+)(?:[0-9a-f]+(?:[-0-9a-zA-Z/#.]*|)\b|)
|
||||
|
||||
# hit-count: 241 file-count: 37
|
||||
# hit-count: 146 file-count: 27
|
||||
# version suffix <word>v#
|
||||
(?:(?<=[A-Z]{2})V|(?<=[a-z]{2}|[A-Z]{2})v)\d+(?:\b|(?=[a-zA-Z_]))
|
||||
|
||||
# hit-count: 141 file-count: 6
|
||||
# Contributor / Project
|
||||
\[[^\]\s]+\]\(https://github\.com/[^)]+\)(?: -(?: [A-Z]\S+)+|)|\[[^\]]+\]\(https://github\.com/(?:[^/\s"]+/?){1,2}\)
|
||||
|
||||
https://github.com/(?:[-\w]+/?){1,2}
|
||||
|
||||
# hit-count: 131 file-count: 125
|
||||
# Repeated letters
|
||||
\b([a-z])\g{-1}{2,}\b
|
||||
|
||||
# hit-count: 99 file-count: 97
|
||||
# hit-count: 105 file-count: 103
|
||||
# w3
|
||||
\bw3\.org/[-0-9a-zA-Z/#.]+
|
||||
|
||||
# hit-count: 59 file-count: 11
|
||||
# hit-count: 94 file-count: 6
|
||||
# Contributor
|
||||
\[[^\]]+\]\(https://github\.com/[^/\s"]+/?\)
|
||||
|
||||
RegExp\(([`'"]).*?\g{-1}\)|(?:escapes|regEx):\s*(?:/.*/|([`'"]).*?\g{-1})|return/.*?/
|
||||
|
||||
# hit-count: 65 file-count: 38
|
||||
# regex choice
|
||||
\(\?:[^)]+\|[^)]+\)
|
||||
|
||||
# hit-count: 37 file-count: 14
|
||||
# Markdown anchor links
|
||||
\(#\S*?[a-zA-Z]\S*?\)
|
||||
|
||||
# hit-count: 29 file-count: 23
|
||||
# hit-count: 33 file-count: 5
|
||||
# base64 encoded pkcs
|
||||
\bMII[-a-zA-Z=;:/0-9+]+
|
||||
|
||||
# hit-count: 28 file-count: 22
|
||||
# stackexchange -- https://stackexchange.com/feeds/sites
|
||||
\b(?:askubuntu|serverfault|stack(?:exchange|overflow)|superuser).com/(?:questions/\w+/[-\w]+|a/)
|
||||
|
||||
# hit-count: 24 file-count: 11
|
||||
# Library prefix
|
||||
# e.g., `lib`+`archive`, `lib`+`raw`, `lib`+`unwind`
|
||||
# (ignores some words that happen to start with `lib`)
|
||||
(?:\b|_)[Ll]ib(?:re(?=office)|)(?!era[lt]|ero|erty|rar(?:i(?:an|es)|y))(?=[a-z])
|
||||
# hit-count: 14 file-count: 3
|
||||
# node packages
|
||||
(["'])@[^/'" ]+/[^/'" ]+\g{-1}
|
||||
|
||||
# hit-count: 20 file-count: 2
|
||||
# hit-count: 13 file-count: 1
|
||||
# Intel intrinsics
|
||||
_mm\d*_(?!dd)\w+
|
||||
_mm_(?!dd)\w+
|
||||
|
||||
# hit-count: 15 file-count: 8
|
||||
# hit-count: 11 file-count: 5
|
||||
# URL escaped characters
|
||||
%[0-9A-F][A-F](?=[A-Za-z])
|
||||
|
||||
# hit-count: 9 file-count: 5
|
||||
# Wikipedia
|
||||
\ben\.wikipedia\.org/wiki/[-\w%.#]+
|
||||
|
||||
# hit-count: 14 file-count: 10
|
||||
# hit-count: 5 file-count: 4
|
||||
# vs devops
|
||||
\bvisualstudio.com(?::443|)/[-\w/?=%&.]*
|
||||
|
||||
# hit-count: 8 file-count: 2
|
||||
# copyright
|
||||
Copyright (?:\([Cc]\)|)(?:[-\d, ]|and)+(?: [A-Z][a-z]+ [A-Z][a-z]+,?)+
|
||||
# hit-count: 5 file-count: 4
|
||||
# Alternatively, if you're using check-spelling v0.0.25+, and you would like to _check_ the Non-English content for spelling errors, you can. For information on how to do so, see:
|
||||
# https://docs.check-spelling.dev/Feature:-Configurable-word-characters.html#unicode
|
||||
[a-zA-Z]*[ÀÁÂÃÄÅÆČÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝßàáâãäåæčçèéêëìíîïðñòóôõöøùúûüýÿĀāŁłŃńŅņŒœŚśŠšŜŝŸŽžź][a-zA-Z]{3}[a-zA-ZÀÁÂÃÄÅÆČÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝßàáâãäåæčçèéêëìíîïðñòóôõöøùúûüýÿĀāŁłŃńŅņŒœŚśŠšŜŝŸŽžź]*|[a-zA-Z]{3,}[ÀÁÂÃÄÅÆČÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝßàáâãäåæčçèéêëìíîïðñòóôõöøùúûüýÿĀāŁłŃńŅņŒœŚśŠšŜŝŸŽžź]|[ÀÁÂÃÄÅÆČÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝßàáâãäåæčçèéêëìíîïðñòóôõöøùúûüýÿĀāŁłŃńŅņŒœŚśŠšŜŝŸŽžź][a-zA-Z]{3,}
|
||||
|
||||
# hit-count: 8 file-count: 1
|
||||
# css fonts
|
||||
\bfont(?:-family|):[^;}]+
|
||||
# hit-count: 4 file-count: 4
|
||||
# microsoft
|
||||
\b(?:https?://|)(?:(?:(?:blogs|download\.visualstudio|developer|docs|learn|msdn2?|research)\.|)microsoft|blogs\.msdn)\.co(?:m|\.\w\w)/[-_a-zA-Z0-9()=./%#]*
|
||||
|
||||
aka\.ms/[a-zA-Z0-9]+
|
||||
|
||||
# hit-count: 8 file-count: 1
|
||||
# kubernetes crd patterns
|
||||
^\s*pattern: .*$
|
||||
|
||||
# hit-count: 5 file-count: 3
|
||||
# URL escaped characters
|
||||
%[0-9A-F][A-F](?=[A-Za-z])
|
||||
|
||||
# hit-count: 3 file-count: 3
|
||||
# githubusercontent
|
||||
/[-a-z0-9]+\.githubusercontent\.com/[-a-zA-Z0-9?&=_\/.]*
|
||||
|
||||
# hit-count: 2 file-count: 2
|
||||
# medium
|
||||
\bmedium\.com/@?[^/\s"]+/[-\w:/*.]+
|
||||
# hit-count: 3 file-count: 2
|
||||
# css url wrappings
|
||||
\burl\([^)]+\)
|
||||
|
||||
# hit-count: 3 file-count: 1
|
||||
# kubernetes crd patterns
|
||||
^\s*pattern: .*$
|
||||
|
||||
# hit-count: 3 file-count: 1
|
||||
# Lorem
|
||||
# Update Lorem based on your content (requires `ge` and `w` from https://github.com/jsoref/spelling; and `review` from https://github.com/check-spelling/check-spelling/wiki/Looking-for-items-locally )
|
||||
# grep '^[^#].*lorem' .github/actions/spelling/patterns.txt|perl -pne 's/.*i..\?://;s/\).*//' |tr '|' "\n"|sort -f |xargs -n1 ge|perl -pne 's/^[^:]*://'|sort -u|w|sed -e 's/ .*//'|w|review -
|
||||
# Warning, while `(?i)` is very neat and fancy, if you have some binary files that aren't proper unicode, you might run into:
|
||||
# ... Operation "substitution (s///)" returns its argument for non-Unicode code point 0x1C19AE (the code point will vary).
|
||||
# ... You could manually change `(?i)X...` to use `[Xx]...`
|
||||
# ... or you could add the files to your `excludes` file (a version after 0.0.19 should identify the file path)
|
||||
(?:(?:\w|\s|[,.])*\b(?i)(?:amet|consectetur|cursus|dolor|eros|ipsum|lacus|libero|ligula|lorem|magna|neque|nulla|suscipit|tempus)\b(?:\w|\s|[,.])*)
|
||||
|
||||
# hit-count: 3 file-count: 1
|
||||
# libraries
|
||||
(?:\b|_)lib(?:re(?=office)|)(?!era[lt]|ero|erty|rar(?:i(?:an|es)|y))(?=[a-z])
|
||||
|
||||
# hit-count: 2 file-count: 1
|
||||
# While you could try to match `http://` and `https://` by using `s?` in `https?://`, sometimes there
|
||||
# YouTube url
|
||||
\b(?:(?:www\.|)youtube\.com|youtu.be)/(?:channel/|embed/|user/|playlist\?list=|watch\?v=|v/|)[-a-zA-Z0-9?&=_%]*
|
||||
|
||||
# hit-count: 2 file-count: 1
|
||||
# hit-count: 1 file-count: 1
|
||||
# GHSA
|
||||
GHSA(?:-[0-9a-z]{4}){3}
|
||||
|
||||
# hit-count: 1 file-count: 1
|
||||
# GitHub actions
|
||||
\buses:\s+[-\w.]+/[-\w./]+@[-\w.]+
|
||||
|
||||
# hit-count: 1 file-count: 1
|
||||
# curl arguments
|
||||
\b(?:\\n|)curl(?:\.exe|)(?:\s+-[a-zA-Z]{1,2}\b)*(?:\s+-[a-zA-Z]{3,})(?:\s+-[a-zA-Z]+)*
|
||||
# medium
|
||||
\bmedium\.com/@?[^/\s"]+/[-\w]+
|
||||
|
||||
# hit-count: 1 file-count: 1
|
||||
# sha-... -- uses a fancy capture
|
||||
(\\?['"]|")[0-9a-f]{40,}\g{-1}
|
||||
|
||||
# hit-count: 1 file-count: 1
|
||||
# tar arguments
|
||||
\b(?:\\n|)g?tar(?:\.exe|)(?:(?:\s+--[-a-zA-Z]+|\s+-[a-zA-Z]+|\s[ABGJMOPRSUWZacdfh-pr-xz]+\b)(?:=[^ ]*|))+
|
||||
|
||||
# #pragma lib
|
||||
^\s*#pragma comment\(lib, ".*?"\)
|
||||
|
||||
# UnitTests
|
||||
\[DataRow\(.*\)\]
|
||||
|
||||
# AdditionalDependencies
|
||||
<AdditionalDependencies>.*<
|
||||
|
||||
# the last line of mimetype="application/x-microsoft.net.object.bytearray.base64" things in .resx files
|
||||
^\s*[-a-zA-Z=;:/0-9+]*[-a-zA-Z;:/0-9+][-a-zA-Z=;:/0-9+]*=$
|
||||
|
||||
RegExp\(@?([`'"]).*?\g{-1}\)|(?:escapes|regEx):\s*(?:/.*/|([`'"]).*?\g{-1})|return/.*?/
|
||||
|
||||
# Questionably acceptable forms of `in to`
|
||||
# Personally, I prefer `log into`, but people object
|
||||
# https://www.tprteaching.com/log-into-log-in-to-login/
|
||||
@@ -205,16 +194,13 @@ RegExp\(@?([`'"]).*?\g{-1}\)|(?:escapes|regEx):\s*(?:/.*/|([`'"]).*?\g{-1})|retu
|
||||
# to opt in
|
||||
\bto opt in\b
|
||||
|
||||
# pass(ed|ing) in
|
||||
\bpass(?:ed|ing) in\b
|
||||
|
||||
# acceptable duplicates
|
||||
# ls directory listings
|
||||
[-bcdlpsw](?:[-r][-w][-SsTtx]){3}[\.+*]?\s+\d+\s+\S+\s+\S+\s+[.\d]+(?:[KMGT]|)\s+
|
||||
# mount
|
||||
\bmount\s+-t\s+(\w+)\s+\g{-1}\b
|
||||
# C types and repeated CSS values
|
||||
\s(auto|buffalo|center|div|inherit|long|LONG|none|normal|solid|thin|transparent|very)(?:\s\g{-1})+\s
|
||||
\s(auto|buffalo|center|div|inherit|long|LONG|none|normal|solid|thin|transparent|very)(?: \g{-1})+\s
|
||||
# C enum and struct
|
||||
\b(?:enum|struct)\s+(\w+)\s+\g{-1}\b
|
||||
# go templates
|
||||
@@ -246,11 +232,9 @@ _SILENCE_STDEXT_ARR_ITERS_DEPRECATION_WARNING
|
||||
# ignore long runs of a single character:
|
||||
\b([A-Za-z])\g{-1}{3,}\b
|
||||
|
||||
# hit-count: 1 file-count: 1
|
||||
# Amazon
|
||||
\bamazon\.com/[-\w]+/(?:dp/[0-9A-Z]+|)[^"'\s]+
|
||||
\bamazon\.com/[-\w]+/(?:dp/[0-9A-Z]+|)
|
||||
|
||||
# hit-count: 3 file-count: 3
|
||||
# imgur
|
||||
\bimgur\.com/[^.]+
|
||||
|
||||
|
||||
12
.github/actions/spell-check/reject.txt
vendored
12
.github/actions/spell-check/reject.txt
vendored
@@ -1,17 +1,8 @@
|
||||
^attache$
|
||||
^bellows?$
|
||||
^bellow$
|
||||
benefitting
|
||||
occurences?
|
||||
^dependan.*
|
||||
^develope$
|
||||
^developement$
|
||||
^developpe
|
||||
^Devers?$
|
||||
^devex
|
||||
^devide
|
||||
^Devinn?[ae]
|
||||
^devisal
|
||||
^devisor
|
||||
^diables?$
|
||||
^oer$
|
||||
Sorce
|
||||
@@ -19,5 +10,4 @@ Sorce
|
||||
^Teh$
|
||||
^untill$
|
||||
^untilling$
|
||||
^venders?$
|
||||
^wether.*
|
||||
|
||||
41
.github/workflows/spelling2.yml
vendored
41
.github/workflows/spelling2.yml
vendored
@@ -105,7 +105,7 @@ jobs:
|
||||
report-timing: 1
|
||||
warnings: bad-regex,binary-file,deprecated-feature,ignored-expect-variant,large-file,limited-references,no-newline-at-eof,noisy-file,non-alpha-in-dictionary,token-is-substring,unexpected-line-ending,whitespace-in-dictionary,minified-file,unsupported-configuration,no-files-to-check,unclosed-block-ignore-begin,unclosed-block-ignore-end
|
||||
experimental_apply_changes_via_bot: 1
|
||||
use_sarif: 1
|
||||
use_sarif: ${{ (!github.event.pull_request || (github.event.pull_request.head.repo.full_name == github.repository)) && 1 }}
|
||||
check_extra_dictionaries: ""
|
||||
dictionary_source_prefixes: >
|
||||
{
|
||||
@@ -113,28 +113,37 @@ jobs:
|
||||
}
|
||||
extra_dictionaries: |
|
||||
cspell:software-terms/softwareTerms.txt
|
||||
cspell:cpp/stdlib-c.txt
|
||||
cspell:cpp/stdlib-cpp.txt
|
||||
cspell:filetypes/filetypes.txt
|
||||
cspell:php/php.txt
|
||||
cspell:dart/dart.txt
|
||||
cspell:dotnet/dotnet.txt
|
||||
cspell:powershell/powershell.txt
|
||||
cspell:csharp/csharp.txt
|
||||
cspell:cpp/stdlib-c.txt
|
||||
cspell:lorem-ipsum/dictionary.txt
|
||||
cspell:python/python/python-lib.txt
|
||||
cspell:node/node.txt
|
||||
cspell:golang/go.txt
|
||||
cspell:npm/npm.txt
|
||||
cspell:php/php.txt
|
||||
cspell:fullstack/fullstack.txt
|
||||
cspell:css/css.txt
|
||||
cspell:java/java.txt
|
||||
cspell:typescript/typescript.txt
|
||||
cspell:html/html.txt
|
||||
cspell:r/r.txt
|
||||
cspell:aws/aws.txt
|
||||
cspell:dotnet/dotnet.txt
|
||||
cspell:swift/swift.txt
|
||||
cspell:node/node.txt
|
||||
cspell:dart/dart.txt
|
||||
cspell:django/django.txt
|
||||
cspell:python/python/python.txt
|
||||
cspell:powershell/powershell.txt
|
||||
cspell:npm/npm.txt
|
||||
cspell:golang/go.txt
|
||||
cspell:cpp/compiler-msvc.txt
|
||||
cspell:csharp/csharp.txt
|
||||
cspell:html/html.txt
|
||||
cspell:java/java.txt
|
||||
cspell:aws/aws.txt
|
||||
cspell:typescript/typescript.txt
|
||||
cspell:cpp/lang-keywords.txt
|
||||
cspell:python/common/extra.txt
|
||||
cspell:scala/scala.txt
|
||||
cspell:shell/shell-all-words.txt
|
||||
cspell:css/css.txt
|
||||
cspell:r/r.txt
|
||||
cspell:java/java-terms.txt
|
||||
cspell:cpp/stdlib-cerrno.txt
|
||||
cspell:k8s/k8s.txt
|
||||
|
||||
comment-push:
|
||||
name: Report (Push)
|
||||
|
||||
@@ -11,13 +11,14 @@
|
||||
"PowerToys.ActionRunner.exe",
|
||||
"PowerToys.Update.exe",
|
||||
"PowerToys.BackgroundActivatorDLL.dll",
|
||||
|
||||
"Notifications.dll",
|
||||
"os-detection.dll",
|
||||
"PowerToys.exe",
|
||||
"PowerToys.FilePreviewCommon.dll",
|
||||
"PowerToys.Interop.dll",
|
||||
"Tools\\PowerToys.BugReportTool.exe",
|
||||
"StylesReportTool\\PowerToys.StylesReportTool.exe",
|
||||
|
||||
"Telemetry.dll",
|
||||
"CalculatorEngineCommon.dll",
|
||||
"PowerToys.ManagedTelemetry.dll",
|
||||
"PowerToys.ManagedCommon.dll",
|
||||
@@ -32,7 +33,7 @@
|
||||
"PowerToys.AlwaysOnTopModuleInterface.dll",
|
||||
|
||||
"PowerToys.CmdNotFoundModuleInterface.dll",
|
||||
|
||||
"PowerToys.CmdNotFound.dll",
|
||||
|
||||
"PowerToys.ColorPicker.dll",
|
||||
"PowerToys.ColorPickerUI.dll",
|
||||
@@ -53,7 +54,7 @@
|
||||
"PowerToys.Awake.exe",
|
||||
"PowerToys.Awake.dll",
|
||||
|
||||
|
||||
"fancyzones.dll",
|
||||
"PowerToys.FancyZonesEditor.exe",
|
||||
"PowerToys.FancyZonesEditor.dll",
|
||||
"PowerToys.FancyZonesEditorCommon.dll",
|
||||
@@ -135,7 +136,7 @@
|
||||
"PowerToys.PowerLauncher.dll",
|
||||
"PowerToys.PowerLauncher.exe",
|
||||
"PowerToys.PowerLauncher.Telemetry.dll",
|
||||
|
||||
"Wox.dll",
|
||||
"Wox.Infrastructure.dll",
|
||||
"Wox.Plugin.dll",
|
||||
"RunPlugins\\Calculator\\Microsoft.PowerToys.Run.Plugin.Calculator.dll",
|
||||
@@ -274,16 +275,16 @@
|
||||
"Mono.Cecil.Pdb.dll",
|
||||
"Mono.Cecil.Rocks.dll",
|
||||
"Newtonsoft.Json.dll",
|
||||
|
||||
"Newtonsoft.Json.Bson.dll",
|
||||
"NLog.dll",
|
||||
"HtmlAgilityPack.dll",
|
||||
"Markdig.Signed.dll",
|
||||
"HelixToolkit.dll",
|
||||
"HelixToolkit.Core.Wpf.dll",
|
||||
"Mages.Core.dll",
|
||||
|
||||
"JetBrains.Annotations.dll",
|
||||
"NLog.Extensions.Logging.dll",
|
||||
|
||||
"getfilesiginforedist.dll",
|
||||
"concrt140_app.dll",
|
||||
"msvcp140_1_app.dll",
|
||||
"msvcp140_2_app.dll",
|
||||
@@ -293,8 +294,22 @@
|
||||
"vcomp140_app.dll",
|
||||
"vcruntime140_1_app.dll",
|
||||
"vcruntime140_app.dll",
|
||||
|
||||
"WinUI3Apps\\CommunityToolkit.Labs.WinUI.SettingsControls.dll",
|
||||
"UnicodeInformation.dll",
|
||||
"Vanara.Core.dll",
|
||||
"Vanara.PInvoke.ComCtl32.dll",
|
||||
"Vanara.PInvoke.Cryptography.dll",
|
||||
"Vanara.PInvoke.Gdi32.dll",
|
||||
"Vanara.PInvoke.Kernel32.dll",
|
||||
"Vanara.PInvoke.Ole.dll",
|
||||
"Vanara.PInvoke.Rpc.dll",
|
||||
"Vanara.PInvoke.Security.dll",
|
||||
"Vanara.PInvoke.Shared.dll",
|
||||
"Vanara.PInvoke.Shell32.dll",
|
||||
"Vanara.PInvoke.ShlwApi.dll",
|
||||
"Vanara.PInvoke.User32.dll",
|
||||
"WinUI3Apps\\clrcompression.dll",
|
||||
"WinUI3Apps\\Microsoft.Graphics.Canvas.Interop.dll",
|
||||
"Microsoft.Web.WebView2.Core.dll",
|
||||
"Microsoft.Web.WebView2.WinForms.dll",
|
||||
"Microsoft.Web.WebView2.Wpf.dll",
|
||||
@@ -321,7 +336,7 @@
|
||||
"Testably.Abstractions.FileSystem.Interface.dll",
|
||||
"WinUI3Apps\\Testably.Abstractions.FileSystem.Interface.dll",
|
||||
"ColorCode.Core.dll",
|
||||
|
||||
"ColorCode.UWP.dll",
|
||||
"UnitsNet.dll",
|
||||
"UtfUnknown.dll",
|
||||
"Wpf.Ui.dll"
|
||||
|
||||
@@ -1,46 +0,0 @@
|
||||
param(
|
||||
[Parameter()]
|
||||
[ValidateSet("Machine", "PerUser")]
|
||||
[string]$InstallMode = "Machine"
|
||||
)
|
||||
|
||||
$ProgressPreference = 'SilentlyContinue'
|
||||
|
||||
# Get artifact path
|
||||
$ArtifactPath = $ENV:BUILD_ARTIFACTSTAGINGDIRECTORY
|
||||
if (-not $ArtifactPath) {
|
||||
throw "BUILD_ARTIFACTSTAGINGDIRECTORY environment variable not set"
|
||||
}
|
||||
|
||||
# Since we only download PowerToysSetup-*.exe files, we can directly find it
|
||||
$Installer = Get-ChildItem -Path $ArtifactPath -Filter 'PowerToys*.exe' | Select-Object -First 1
|
||||
|
||||
if (-not $Installer) {
|
||||
throw "PowerToys installer not found"
|
||||
}
|
||||
|
||||
Write-Host "Installing PowerToys: $($Installer.Name)"
|
||||
|
||||
# Install PowerToys
|
||||
$Process = Start-Process -Wait -FilePath $Installer.FullName -ArgumentList "/passive", "/norestart" -PassThru -NoNewWindow
|
||||
|
||||
if ($Process.ExitCode -eq 0 -or $Process.ExitCode -eq 3010) {
|
||||
Write-Host "✅ PowerToys installation completed successfully"
|
||||
} else {
|
||||
throw "PowerToys installation failed with exit code: $($Process.ExitCode)"
|
||||
}
|
||||
|
||||
# Verify installation
|
||||
if ($InstallMode -eq "PerUser") {
|
||||
if (Test-Path "${env:LOCALAPPDATA}\PowerToys\PowerToys.exe") {
|
||||
Write-Host "✅ PowerToys verified at: ${env:LOCALAPPDATA}\PowerToys\PowerToys.exe"
|
||||
} else {
|
||||
throw "PowerToys installation verification failed"
|
||||
}
|
||||
} else {
|
||||
if (Test-Path "${env:ProgramFiles}\PowerToys\PowerToys.exe") {
|
||||
Write-Host "✅ PowerToys verified at: ${env:ProgramFiles}\PowerToys\PowerToys.exe"
|
||||
} else {
|
||||
throw "PowerToys installation verification failed"
|
||||
}
|
||||
}
|
||||
@@ -43,7 +43,6 @@ stages:
|
||||
enableMsBuildCaching: ${{ parameters.enableMsBuildCaching }}
|
||||
runTests: true
|
||||
useVSPreview: ${{ parameters.useVSPreview }}
|
||||
timeoutInMinutes: 90
|
||||
|
||||
- stage: OneFuzz
|
||||
displayName: Fuzz ${{ parameters.platform }}
|
||||
|
||||
@@ -81,12 +81,6 @@ parameters:
|
||||
- 'src/modules/previewpane/SvgPreviewHandler/SvgPreviewHandler.csproj'
|
||||
- 'src/modules/previewpane/SvgThumbnailProvider/SvgThumbnailProvider.csproj'
|
||||
- 'src/modules/FileLocksmith/FileLocksmithUI/FileLocksmithUI.csproj'
|
||||
- name: timeoutInMinutes
|
||||
type: number
|
||||
default: 240
|
||||
- name: cancelTimeoutInMinutes
|
||||
type: number
|
||||
default: 1
|
||||
|
||||
jobs:
|
||||
- job: ${{ parameters.jobName }}
|
||||
@@ -129,8 +123,8 @@ jobs:
|
||||
${{ else }}:
|
||||
RestoreAdditionalProjectSourcesArg: ''
|
||||
displayName: Build
|
||||
timeoutInMinutes: ${{ parameters.timeoutInMinutes }}
|
||||
cancelTimeoutInMinutes: ${{ parameters.cancelTimeoutInMinutes }}
|
||||
timeoutInMinutes: 240
|
||||
cancelTimeoutInMinutes: 1
|
||||
templateContext: # Required when this template is hosted in 1ES PT
|
||||
outputs:
|
||||
- output: pipelineArtifact
|
||||
@@ -478,7 +472,7 @@ jobs:
|
||||
|
||||
# This saves ~1GiB per architecture. We won't need these later.
|
||||
# Removes:
|
||||
# - All .pdb files from any static libs .libs (which were only used during linking)
|
||||
# - All .pdbs from any static libs .libs (which were only used during linking)
|
||||
- pwsh: |-
|
||||
$binDir = '$(Build.SourcesDirectory)'
|
||||
$ImportLibs = Get-ChildItem $binDir -Recurse -File -Filter '*.exp' | ForEach-Object { $_.FullName -Replace "exp$","lib" }
|
||||
|
||||
@@ -1,132 +0,0 @@
|
||||
# Minimal UI Tests Build Template
|
||||
# This template only builds UI test projects and stages their test DLLs for consumption by test pipelines
|
||||
|
||||
parameters:
|
||||
- name: buildConfigurations
|
||||
type: object
|
||||
default:
|
||||
- Release
|
||||
- name: buildPlatforms
|
||||
type: object
|
||||
default:
|
||||
- x64
|
||||
- name: condition
|
||||
type: string
|
||||
default: ''
|
||||
- name: dependsOn
|
||||
type: object
|
||||
default: []
|
||||
- name: pool
|
||||
type: object
|
||||
default: []
|
||||
- name: variables
|
||||
type: object
|
||||
default: {}
|
||||
- name: uiTestModules
|
||||
type: object
|
||||
default: []
|
||||
|
||||
jobs:
|
||||
- job: BuildUITests
|
||||
${{ if ne(length(parameters.pool), 0) }}:
|
||||
pool: ${{ parameters.pool }}
|
||||
dependsOn: ${{ parameters.dependsOn }}
|
||||
condition: ${{ parameters.condition }}
|
||||
strategy:
|
||||
matrix:
|
||||
${{ each config in parameters.buildConfigurations }}:
|
||||
${{ each platform in parameters.buildPlatforms }}:
|
||||
${{ config }}_${{ platform }}:
|
||||
BuildConfiguration: ${{ config }}
|
||||
BuildPlatform: ${{ platform }}
|
||||
variables:
|
||||
JobOutputDirectory: $(Build.ArtifactStagingDirectory)
|
||||
LogOutputDirectory: $(Build.ArtifactStagingDirectory)\logs
|
||||
JobOutputArtifactName: build-$(BuildPlatform)-$(BuildConfiguration)
|
||||
NUGET_RESTORE_MSBUILD_ARGS: /p:Platform=$(BuildPlatform)
|
||||
${{ insert }}: ${{ parameters.variables }}
|
||||
displayName: Build UI Tests Only
|
||||
timeoutInMinutes: 60
|
||||
cancelTimeoutInMinutes: 1
|
||||
templateContext:
|
||||
outputs:
|
||||
- output: pipelineArtifact
|
||||
artifactName: $(JobOutputArtifactName)
|
||||
targetPath: $(Build.ArtifactStagingDirectory)
|
||||
steps:
|
||||
- checkout: self
|
||||
clean: true
|
||||
submodules: true
|
||||
persistCredentials: True
|
||||
fetchTags: false
|
||||
fetchDepth: 1
|
||||
|
||||
- template: steps-ensure-dotnet-version.yml
|
||||
parameters:
|
||||
sdk: true
|
||||
version: '9.0'
|
||||
|
||||
- template: .\steps-restore-nuget.yml
|
||||
|
||||
- task: NuGetCommand@2
|
||||
displayName: Restore solution-level NuGet packages
|
||||
inputs:
|
||||
command: restore
|
||||
feedsToUse: config
|
||||
configPath: nuget.config
|
||||
restoreSolution: PowerToys.sln
|
||||
restoreDirectory: '$(Build.SourcesDirectory)\packages'
|
||||
|
||||
# Build all UI test projects if no specific modules are specified
|
||||
- ${{ if eq(length(parameters.uiTestModules), 0) }}:
|
||||
- task: VSBuild@1
|
||||
displayName: Build UI Test Projects
|
||||
inputs:
|
||||
solution: '**/*UITest*.csproj'
|
||||
vsVersion: 17.0
|
||||
msbuildArgs: >-
|
||||
-restore
|
||||
-graph
|
||||
/p:RestorePackagesConfig=true
|
||||
/p:BuildProjectReferences=true
|
||||
/p:CIBuild=true
|
||||
/bl:$(LogOutputDirectory)\build-all-uitests.binlog
|
||||
$(NUGET_RESTORE_MSBUILD_ARGS)
|
||||
platform: $(BuildPlatform)
|
||||
configuration: $(BuildConfiguration)
|
||||
msbuildArchitecture: x64
|
||||
maximumCpuCount: true
|
||||
|
||||
# Build specific UI test modules
|
||||
- ${{ if ne(length(parameters.uiTestModules), 0) }}:
|
||||
- ${{ each module in parameters.uiTestModules }}:
|
||||
- task: VSBuild@1
|
||||
displayName: 'Build UI Test Module: ${{ module }}'
|
||||
inputs:
|
||||
solution: '**/*${{ module }}*.csproj'
|
||||
vsVersion: 17.0
|
||||
msbuildArgs: >-
|
||||
-restore
|
||||
-graph
|
||||
/p:RestorePackagesConfig=true
|
||||
/p:BuildProjectReferences=true
|
||||
/p:CIBuild=true
|
||||
/bl:$(LogOutputDirectory)\build-${{ module }}.binlog
|
||||
$(NUGET_RESTORE_MSBUILD_ARGS)
|
||||
platform: $(BuildPlatform)
|
||||
configuration: $(BuildConfiguration)
|
||||
msbuildArchitecture: x64
|
||||
maximumCpuCount: true
|
||||
|
||||
# Stage test project outputs with directory structure
|
||||
- task: CopyFiles@2
|
||||
displayName: Stage UI Test Build Outputs
|
||||
inputs:
|
||||
sourceFolder: '$(Build.SourcesDirectory)'
|
||||
contents: '$(BuildPlatform)/$(BuildConfiguration)/**/*'
|
||||
targetFolder: '$(JobOutputDirectory)\$(BuildPlatform)\$(BuildConfiguration)'
|
||||
|
||||
- publish: $(JobOutputDirectory)
|
||||
artifact: $(JobOutputArtifactName)
|
||||
displayName: Publish UI Test artifacts
|
||||
condition: always()
|
||||
@@ -11,28 +11,10 @@ parameters:
|
||||
- name: useLatestWebView2
|
||||
type: boolean
|
||||
default: false
|
||||
- name: useLatestOfficialBuild
|
||||
type: boolean
|
||||
default: true
|
||||
- name: useCurrentBranchBuild
|
||||
type: boolean
|
||||
default: false
|
||||
- name: uiTestModules
|
||||
type: object
|
||||
default: []
|
||||
- name: installMode
|
||||
type: string
|
||||
default: 'machine'
|
||||
values:
|
||||
- 'machine'
|
||||
- 'peruser'
|
||||
- name: jobSuffix
|
||||
type: string
|
||||
default: ''
|
||||
|
||||
jobs:
|
||||
- job: Test${{ parameters.platform }}${{ parameters.configuration }}${{ parameters.jobSuffix }}
|
||||
displayName: Test ${{ parameters.platform }} ${{ parameters.configuration }}${{ parameters.jobSuffix }}
|
||||
- job: Test${{ parameters.platform }}${{ parameters.configuration }}
|
||||
displayName: Test ${{ parameters.platform }} ${{ parameters.configuration }}
|
||||
timeoutInMinutes: 300
|
||||
variables:
|
||||
${{ if or(eq(parameters.platform, 'x64Win10'), eq(parameters.platform, 'x64Win11')) }}:
|
||||
@@ -113,80 +95,28 @@ jobs:
|
||||
& '$(build.sourcesdirectory)\.pipelines\InstallWinAppDriver.ps1'
|
||||
displayName: Download and install WinAppDriver
|
||||
|
||||
- ${{ if eq(parameters.useLatestOfficialBuild, true) }}:
|
||||
- task: DownloadPipelineArtifact@2
|
||||
inputs:
|
||||
buildType: 'specific'
|
||||
project: 'Dart'
|
||||
definition: '76541'
|
||||
buildVersionToDownload: 'latestFromBranch'
|
||||
${{ if eq(parameters.useCurrentBranchBuild, true) }}:
|
||||
branchName: '$(Build.SourceBranch)'
|
||||
${{ else }}:
|
||||
branchName: 'refs/heads/main'
|
||||
artifactName: 'build-$(BuildPlatform)-Release'
|
||||
targetPath: '$(Build.ArtifactStagingDirectory)'
|
||||
${{ if eq(parameters.installMode, 'peruser') }}:
|
||||
patterns: |
|
||||
**/PowerToysUserSetup*.exe
|
||||
${{ else }}:
|
||||
patterns: |
|
||||
**/PowerToysSetup*.exe
|
||||
|
||||
- ${{ if eq(parameters.useLatestOfficialBuild, true) }}:
|
||||
- ${{ if eq(parameters.installMode, 'peruser') }}:
|
||||
- pwsh: |-
|
||||
& "$(build.sourcesdirectory)\.pipelines\installPowerToys.ps1" -InstallMode "PerUser"
|
||||
displayName: Install PowerToys (Per-User)
|
||||
|
||||
- ${{ if eq(parameters.installMode, 'machine') }}:
|
||||
- pwsh: |-
|
||||
& "$(build.sourcesdirectory)\.pipelines\installPowerToys.ps1" -InstallMode "Machine"
|
||||
displayName: Install PowerToys (Machine-Level)
|
||||
|
||||
- ${{ if ne(parameters.platform, 'arm64') }}:
|
||||
- task: ScreenResolutionUtility@1
|
||||
inputs:
|
||||
displaySettings: 'optimal'
|
||||
|
||||
- ${{ if eq(length(parameters.uiTestModules), 0) }}:
|
||||
- task: VSTest@3
|
||||
displayName: Run UI Tests
|
||||
inputs:
|
||||
platform: '$(BuildPlatform)'
|
||||
configuration: '$(BuildConfiguration)'
|
||||
testSelector: 'testAssemblies'
|
||||
searchFolder: '$(Pipeline.Workspace)\$(TestArtifactsName)'
|
||||
vsTestVersion: 'toolsInstaller'
|
||||
uiTests: true
|
||||
rerunFailedTests: true
|
||||
# Since UITests-FancyZonesEditor.dll is generated in both UITests-FancyZonesEditor and UITests-FancyZones, removed one to avoid duplicate test runs
|
||||
testAssemblyVer2: |
|
||||
**\*UITest*.dll
|
||||
!**\obj\**
|
||||
!**\ref\**
|
||||
!**\UITests-FancyZones\**\UITests-FancyZonesEditor.dll
|
||||
env:
|
||||
platform: '$(TestPlatform)'
|
||||
useInstallerForTest: ${{ parameters.useLatestOfficialBuild }}
|
||||
- task: VSTest@3
|
||||
displayName: Run UI Tests
|
||||
inputs:
|
||||
platform: '$(BuildPlatform)'
|
||||
configuration: '$(BuildConfiguration)'
|
||||
testSelector: 'testAssemblies'
|
||||
searchFolder: '$(Pipeline.Workspace)\$(TestArtifactsName)'
|
||||
vsTestVersion: 'toolsInstaller'
|
||||
uiTests: true
|
||||
rerunFailedTests: true
|
||||
# Since UITests-FancyZonesEditor.dll is generated in both UITests-FancyZonesEditor and UITests-FancyZones, removed one to avoid duplicate test runs
|
||||
testAssemblyVer2: |
|
||||
**\*UITest*.dll
|
||||
!**\obj\**
|
||||
!**\ref\**
|
||||
!**\UITests-FancyZones\**\UITests-FancyZonesEditor.dll
|
||||
|
||||
- ${{ if ne(length(parameters.uiTestModules), 0) }}:
|
||||
- ${{ each module in parameters.uiTestModules }}:
|
||||
- task: VSTest@3
|
||||
displayName: Run UI Test - ${{ module }}
|
||||
inputs:
|
||||
platform: '$(BuildPlatform)'
|
||||
configuration: '$(BuildConfiguration)'
|
||||
testSelector: 'testAssemblies'
|
||||
searchFolder: '$(Pipeline.Workspace)\$(TestArtifactsName)'
|
||||
vsTestVersion: 'toolsInstaller'
|
||||
uiTests: true
|
||||
rerunFailedTests: true
|
||||
testAssemblyVer2: |
|
||||
**\*${{ module }}*.dll
|
||||
!**\obj\**
|
||||
!**\ref\**
|
||||
!**\UITests-FancyZones\**\UITests-FancyZonesEditor.dll
|
||||
env:
|
||||
platform: '$(TestPlatform)'
|
||||
useInstallerForTest: ${{ parameters.useLatestOfficialBuild }}
|
||||
|
||||
env:
|
||||
platform: '$(TestPlatform)'
|
||||
|
||||
@@ -60,5 +60,4 @@ stages:
|
||||
useLatestWinAppSDK: ${{ parameters.useLatestWinAppSDK }}
|
||||
${{ if eq(parameters.useLatestWinAppSDK, true) }}:
|
||||
winAppSDKVersionNumber: ${{ parameters.winAppSDKVersionNumber }}
|
||||
useExperimentalVersion: ${{ parameters.useExperimentalVersion }}
|
||||
timeoutInMinutes: 90
|
||||
useExperimentalVersion: ${{ parameters.useExperimentalVersion }}
|
||||
@@ -22,155 +22,63 @@ parameters:
|
||||
- name: useLatestWebView2
|
||||
type: boolean
|
||||
default: false
|
||||
- name: useLatestOfficialBuild
|
||||
type: boolean
|
||||
default: true
|
||||
- name: testBothInstallModes
|
||||
type: boolean
|
||||
default: true
|
||||
- name: useCurrentBranchBuild
|
||||
type: boolean
|
||||
default: false
|
||||
- name: uiTestModules
|
||||
type: object
|
||||
default: []
|
||||
|
||||
stages:
|
||||
- ${{ each platform in parameters.buildPlatforms }}:
|
||||
- ${{ if eq(parameters.useLatestOfficialBuild, false) }}:
|
||||
- stage: Build_${{ platform }}
|
||||
displayName: Build ${{ platform }}
|
||||
dependsOn: []
|
||||
jobs:
|
||||
- template: job-build-project.yml
|
||||
parameters:
|
||||
pool:
|
||||
${{ if eq(variables['System.CollectionId'], 'cb55739e-4afe-46a3-970f-1b49d8ee7564') }}:
|
||||
name: SHINE-INT-L
|
||||
${{ else }}:
|
||||
name: SHINE-OSS-L
|
||||
${{ if eq(parameters.useVSPreview, true) }}:
|
||||
demands: ImageOverride -equals SHINE-VS17-Preview
|
||||
buildPlatforms:
|
||||
- ${{ platform }}
|
||||
buildConfigurations: [Release]
|
||||
enablePackageCaching: true
|
||||
enableMsBuildCaching: ${{ parameters.enableMsBuildCaching }}
|
||||
runTests: false
|
||||
buildTests: true
|
||||
useVSPreview: ${{ parameters.useVSPreview }}
|
||||
timeoutInMinutes: 90
|
||||
|
||||
- ${{ if eq(parameters.useLatestOfficialBuild, true) }}:
|
||||
- stage: BuildUITests_${{ platform }}
|
||||
displayName: Build UI Tests Only
|
||||
dependsOn: []
|
||||
jobs:
|
||||
- template: job-build-ui-tests.yml
|
||||
parameters:
|
||||
pool:
|
||||
${{ if eq(variables['System.CollectionId'], 'cb55739e-4afe-46a3-970f-1b49d8ee7564') }}:
|
||||
name: SHINE-INT-L
|
||||
${{ else }}:
|
||||
name: SHINE-OSS-L
|
||||
${{ if eq(parameters.useVSPreview, true) }}:
|
||||
demands: ImageOverride -equals SHINE-VS17-Preview
|
||||
buildPlatforms:
|
||||
- ${{ platform }}
|
||||
uiTestModules: ${{ parameters.uiTestModules }}
|
||||
- stage: Build_${{ platform }}
|
||||
displayName: Build ${{ platform }}
|
||||
dependsOn: []
|
||||
jobs:
|
||||
- template: job-build-project.yml
|
||||
parameters:
|
||||
pool:
|
||||
${{ if eq(variables['System.CollectionId'], 'cb55739e-4afe-46a3-970f-1b49d8ee7564') }}:
|
||||
name: SHINE-INT-L
|
||||
${{ else }}:
|
||||
name: SHINE-OSS-L
|
||||
${{ if eq(parameters.useVSPreview, true) }}:
|
||||
demands: ImageOverride -equals SHINE-VS17-Preview
|
||||
buildPlatforms:
|
||||
- ${{ platform }}
|
||||
buildConfigurations: [Release]
|
||||
enablePackageCaching: true
|
||||
enableMsBuildCaching: ${{ parameters.enableMsBuildCaching }}
|
||||
runTests: false
|
||||
buildTests: true
|
||||
useVSPreview: ${{ parameters.useVSPreview }}
|
||||
|
||||
- ${{ if eq(platform, 'x64') }}:
|
||||
- stage: Test_x64Win10
|
||||
displayName: Test x64Win10
|
||||
${{ if eq(parameters.useLatestOfficialBuild, true) }}:
|
||||
dependsOn:
|
||||
- BuildUITests_${{ platform }}
|
||||
${{ else }}:
|
||||
dependsOn:
|
||||
- Build_${{ platform }}
|
||||
dependsOn:
|
||||
- Build_${{platform}}
|
||||
jobs:
|
||||
- template: job-test-project.yml
|
||||
parameters:
|
||||
platform: x64Win10
|
||||
configuration: Release
|
||||
useLatestWebView2: ${{ parameters.useLatestWebView2 }}
|
||||
useLatestOfficialBuild: ${{ parameters.useLatestOfficialBuild }}
|
||||
useCurrentBranchBuild: ${{ parameters.useCurrentBranchBuild }}
|
||||
uiTestModules: ${{ parameters.uiTestModules }}
|
||||
|
||||
# Additional per-user installation test (when both modes are enabled)
|
||||
- ${{ if and(eq(parameters.useLatestOfficialBuild, true), eq(parameters.testBothInstallModes, true)) }}:
|
||||
- template: job-test-project.yml
|
||||
parameters:
|
||||
platform: x64Win10
|
||||
configuration: Release
|
||||
useLatestWebView2: ${{ parameters.useLatestWebView2 }}
|
||||
useLatestOfficialBuild: ${{ parameters.useLatestOfficialBuild }}
|
||||
useCurrentBranchBuild: ${{ parameters.useCurrentBranchBuild }}
|
||||
uiTestModules: ${{ parameters.uiTestModules }}
|
||||
installMode: 'peruser'
|
||||
jobSuffix: '_PerUser'
|
||||
|
||||
- ${{ if eq(platform, 'x64') }}:
|
||||
- stage: Test_x64Win11
|
||||
displayName: Test x64Win11
|
||||
${{ if eq(parameters.useLatestOfficialBuild, true) }}:
|
||||
dependsOn:
|
||||
- BuildUITests_${{ platform }}
|
||||
${{ else }}:
|
||||
dependsOn:
|
||||
- Build_${{ platform }}
|
||||
dependsOn:
|
||||
- Build_${{platform}}
|
||||
jobs:
|
||||
- template: job-test-project.yml
|
||||
parameters:
|
||||
platform: x64Win11
|
||||
configuration: Release
|
||||
useLatestWebView2: ${{ parameters.useLatestWebView2 }}
|
||||
useLatestOfficialBuild: ${{ parameters.useLatestOfficialBuild }}
|
||||
useCurrentBranchBuild: ${{ parameters.useCurrentBranchBuild }}
|
||||
uiTestModules: ${{ parameters.uiTestModules }}
|
||||
|
||||
# Additional per-user installation test (when both modes are enabled)
|
||||
- ${{ if and(eq(parameters.useLatestOfficialBuild, true), eq(parameters.testBothInstallModes, true)) }}:
|
||||
- template: job-test-project.yml
|
||||
parameters:
|
||||
platform: x64Win11
|
||||
configuration: Release
|
||||
useLatestWebView2: ${{ parameters.useLatestWebView2 }}
|
||||
useLatestOfficialBuild: ${{ parameters.useLatestOfficialBuild }}
|
||||
useCurrentBranchBuild: ${{ parameters.useCurrentBranchBuild }}
|
||||
uiTestModules: ${{ parameters.uiTestModules }}
|
||||
installMode: 'peruser'
|
||||
jobSuffix: '_PerUser'
|
||||
|
||||
- ${{ if ne(platform, 'x64') }}:
|
||||
- stage: Test_${{ platform }}
|
||||
displayName: Test ${{ platform }}
|
||||
${{ if eq(parameters.useLatestOfficialBuild, true) }}:
|
||||
dependsOn:
|
||||
- BuildUITests_${{ platform }}
|
||||
${{ else }}:
|
||||
dependsOn:
|
||||
- Build_${{ platform }}
|
||||
dependsOn:
|
||||
- Build_${{platform}}
|
||||
jobs:
|
||||
- template: job-test-project.yml
|
||||
parameters:
|
||||
platform: ${{ platform }}
|
||||
configuration: Release
|
||||
useLatestWebView2: ${{ parameters.useLatestWebView2 }}
|
||||
useLatestOfficialBuild: ${{ parameters.useLatestOfficialBuild }}
|
||||
useCurrentBranchBuild: ${{ parameters.useCurrentBranchBuild }}
|
||||
uiTestModules: ${{ parameters.uiTestModules }}
|
||||
|
||||
# Additional per-user installation test (when both modes are enabled)
|
||||
- ${{ if and(eq(parameters.useLatestOfficialBuild, true), eq(parameters.testBothInstallModes, true)) }}:
|
||||
- template: job-test-project.yml
|
||||
parameters:
|
||||
platform: ${{ platform }}
|
||||
configuration: Release
|
||||
useLatestWebView2: ${{ parameters.useLatestWebView2 }}
|
||||
useLatestOfficialBuild: ${{ parameters.useLatestOfficialBuild }}
|
||||
useCurrentBranchBuild: ${{ parameters.useCurrentBranchBuild }}
|
||||
uiTestModules: ${{ parameters.uiTestModules }}
|
||||
installMode: 'peruser'
|
||||
jobSuffix: '_PerUser'
|
||||
@@ -183,9 +183,9 @@ ZoomIt source code was originally implemented by [Sysinternals](https://sysinter
|
||||
- [@cinnamon-msft](https://github.com/cinnamon-msft) - Kayla Cinnamon - Lead
|
||||
- [@craigloewen-msft](https://github.com/craigloewen-msft) - Craig Loewen - Product Manager
|
||||
- [@niels9001](https://github.com/niels9001/) - Niels Laute - Product Manager
|
||||
- [@dhowett](https://github.com/dhowett) - Dustin Howett - Dev Lead
|
||||
- [@yeelam-gordon](https://github.com/yeelam-gordon) - Gordon Lam - Dev Lead
|
||||
- [@jamrobot](https://github.com/jamrobot) - Jerry Xu - Dev Lead
|
||||
- [@dhowett](https://github.com/dhowett) - Dustin Howett - Dev lead
|
||||
- [@yeelam-gordon](https://github.com/yeelam-gordon) - Gordon Lam - Dev lead
|
||||
- [@jamrobot](https://github.com/jamrobot) - Jerry Xu - Dev lead
|
||||
- [@lei9444](https://github.com/lei9444) - Leilei Zhang - Dev
|
||||
- [@shuaiyuanxx](https://github.com/shuaiyuanxx) - Shawn Yuan - Dev
|
||||
- [@moooyo](https://github.com/moooyo) - Yu Leng - Dev
|
||||
@@ -225,4 +225,4 @@ ZoomIt source code was originally implemented by [Sysinternals](https://sysinter
|
||||
- [@donlaci](https://github.com/donlaci) - Laszlo Nemeth - Dev
|
||||
- [@SeraphimaZykova](https://github.com/SeraphimaZykova) - Seraphima Zykova - Dev
|
||||
- [@stefansjfw](https://github.com/stefansjfw) - Stefan Markovic - Dev
|
||||
- [@jaimecbernardo](https://github.com/jaimecbernardo) - Jaime Bernardo - Dev Lead
|
||||
- [@jaimecbernardo](https://github.com/jaimecbernardo) - Jaime Bernardo - Dev lead
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
|
||||
<!-- Add ability to run tests via "msbuild /t:Test" -->
|
||||
<!--
|
||||
Work around an MSBuild bug where Microsoft.Common.Test.targets is missing from the Arm64 installation.
|
||||
Workaround an MSBuild bug where Microsoft.Common.Test.targets is missing from the Arm64 installation.
|
||||
See: https://github.com/dotnet/msbuild/pull/9984
|
||||
NB 1: This means that using "/t:Test" is not supported for Arm64 builds and tests will need to be run in an alternate way,
|
||||
eg running tests in VS or invoking vstest.console directly.
|
||||
|
||||
@@ -32,22 +32,22 @@
|
||||
<!-- Including MessagePack to force version, since it's used by StreamJsonRpc but contains vulnerabilities. After StreamJsonRpc updates the version of MessagePack, we can upgrade StreamJsonRpc instead. -->
|
||||
<PackageVersion Include="MessagePack" Version="3.1.3" />
|
||||
<PackageVersion Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="9.0.0" />
|
||||
<PackageVersion Include="Microsoft.Data.Sqlite" Version="9.0.7" />
|
||||
<PackageVersion Include="Microsoft.Data.Sqlite" Version="9.0.6" />
|
||||
<!-- Including Microsoft.Bcl.AsyncInterfaces to force version, since it's used by Microsoft.SemanticKernel. -->
|
||||
<PackageVersion Include="Microsoft.Bcl.AsyncInterfaces" Version="9.0.7" />
|
||||
<PackageVersion Include="Microsoft.Bcl.AsyncInterfaces" Version="9.0.6" />
|
||||
<PackageVersion Include="Microsoft.Diagnostics.Tracing.TraceEvent" Version="3.1.16" />
|
||||
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="9.0.7" />
|
||||
<PackageVersion Include="Microsoft.Extensions.Logging" Version="9.0.7" />
|
||||
<PackageVersion Include="Microsoft.Extensions.Logging.Abstractions" Version="9.0.7" />
|
||||
<PackageVersion Include="Microsoft.Extensions.Hosting" Version="9.0.7" />
|
||||
<PackageVersion Include="Microsoft.Extensions.Hosting.WindowsServices" Version="9.0.7" />
|
||||
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="9.0.6" />
|
||||
<PackageVersion Include="Microsoft.Extensions.Logging" Version="9.0.6" />
|
||||
<PackageVersion Include="Microsoft.Extensions.Logging.Abstractions" Version="9.0.6" />
|
||||
<PackageVersion Include="Microsoft.Extensions.Hosting" Version="9.0.6" />
|
||||
<PackageVersion Include="Microsoft.Extensions.Hosting.WindowsServices" Version="9.0.6" />
|
||||
<PackageVersion Include="Microsoft.SemanticKernel" Version="1.15.0" />
|
||||
<PackageVersion Include="Microsoft.Toolkit.Uwp.Notifications" Version="7.1.2" />
|
||||
<PackageVersion Include="Microsoft.Web.WebView2" Version="1.0.2903.40" />
|
||||
<!-- Package Microsoft.Win32.SystemEvents added as a hack for being able to exclude the runtime assets so they don't conflict with 8.0.1. This is a dependency of System.Drawing.Common but the 8.0.1 version wasn't published to nuget. -->
|
||||
<PackageVersion Include="Microsoft.Win32.SystemEvents" Version="9.0.7" />
|
||||
<PackageVersion Include="Microsoft.Win32.SystemEvents" Version="9.0.6" />
|
||||
<PackageVersion Include="Microsoft.WindowsPackageManager.ComInterop" Version="1.10.340" />
|
||||
<PackageVersion Include="Microsoft.Windows.Compatibility" Version="9.0.7" />
|
||||
<PackageVersion Include="Microsoft.Windows.Compatibility" Version="9.0.6" />
|
||||
<PackageVersion Include="Microsoft.Windows.CsWin32" Version="0.3.183" />
|
||||
<!-- CsWinRT version needs to be set to have a WinRT.Runtime.dll at the same version contained inside the NET SDK we're currently building on CI. -->
|
||||
<!--
|
||||
@@ -75,28 +75,28 @@
|
||||
<PackageVersion Include="StreamJsonRpc" Version="2.21.69" />
|
||||
<PackageVersion Include="StyleCop.Analyzers" Version="1.2.0-beta.556" />
|
||||
<!-- Package System.CodeDom added as a hack for being able to exclude the runtime assets so they don't conflict with 8.0.1. This is a dependency of System.Management but the 8.0.1 version wasn't published to nuget. -->
|
||||
<PackageVersion Include="System.CodeDom" Version="9.0.7" />
|
||||
<PackageVersion Include="System.CodeDom" Version="9.0.6" />
|
||||
<PackageVersion Include="System.CommandLine" Version="2.0.0-beta4.22272.1" />
|
||||
<PackageVersion Include="System.ComponentModel.Composition" Version="9.0.7" />
|
||||
<PackageVersion Include="System.Configuration.ConfigurationManager" Version="9.0.7" />
|
||||
<PackageVersion Include="System.Data.OleDb" Version="9.0.7" />
|
||||
<PackageVersion Include="System.ComponentModel.Composition" Version="9.0.6" />
|
||||
<PackageVersion Include="System.Configuration.ConfigurationManager" Version="9.0.6" />
|
||||
<PackageVersion Include="System.Data.OleDb" Version="9.0.6" />
|
||||
<!-- Package System.Data.SqlClient added to force it as a dependency of Microsoft.Windows.Compatibility to the latest version available at this time. -->
|
||||
<PackageVersion Include="System.Data.SqlClient" Version="4.9.0" />
|
||||
<!-- Package System.Diagnostics.EventLog added as a hack for being able to exclude the runtime assets so they don't conflict with 8.0.1. This is a dependency of System.Data.OleDb but the 8.0.1 version wasn't published to nuget. -->
|
||||
<PackageVersion Include="System.Diagnostics.EventLog" Version="9.0.7" />
|
||||
<PackageVersion Include="System.Diagnostics.EventLog" Version="9.0.6" />
|
||||
<!-- Package System.Diagnostics.PerformanceCounter added as a hack for being able to exclude the runtime assets so they don't conflict with 8.0.11. -->
|
||||
<PackageVersion Include="System.Diagnostics.PerformanceCounter" Version="9.0.7" />
|
||||
<PackageVersion Include="System.Drawing.Common" Version="9.0.7" />
|
||||
<PackageVersion Include="System.Diagnostics.PerformanceCounter" Version="9.0.6" />
|
||||
<PackageVersion Include="System.Drawing.Common" Version="9.0.6" />
|
||||
<PackageVersion Include="System.IO.Abstractions" Version="22.0.13" />
|
||||
<PackageVersion Include="System.IO.Abstractions.TestingHelpers" Version="22.0.13" />
|
||||
<PackageVersion Include="System.Management" Version="9.0.7" />
|
||||
<PackageVersion Include="System.Management" Version="9.0.6" />
|
||||
<PackageVersion Include="System.Net.Http" Version="4.3.4" />
|
||||
<PackageVersion Include="System.Private.Uri" Version="4.3.2" />
|
||||
<PackageVersion Include="System.Reactive" Version="6.0.1" />
|
||||
<PackageVersion Include="System.Runtime.Caching" Version="9.0.7" />
|
||||
<PackageVersion Include="System.ServiceProcess.ServiceController" Version="9.0.7" />
|
||||
<PackageVersion Include="System.Text.Encoding.CodePages" Version="9.0.7" />
|
||||
<PackageVersion Include="System.Text.Json" Version="9.0.7" />
|
||||
<PackageVersion Include="System.Runtime.Caching" Version="9.0.6" />
|
||||
<PackageVersion Include="System.ServiceProcess.ServiceController" Version="9.0.6" />
|
||||
<PackageVersion Include="System.Text.Encoding.CodePages" Version="9.0.6" />
|
||||
<PackageVersion Include="System.Text.Json" Version="9.0.6" />
|
||||
<PackageVersion Include="System.Text.RegularExpressions" Version="4.3.1" />
|
||||
<PackageVersion Include="UnicodeInformation" Version="2.6.0" />
|
||||
<PackageVersion Include="UnitsNet" Version="5.56.0" />
|
||||
|
||||
42
NOTICE.md
42
NOTICE.md
@@ -1517,23 +1517,23 @@ SOFTWARE.
|
||||
- Mages 3.0.0
|
||||
- Markdig.Signed 0.34.0
|
||||
- MessagePack 3.1.3
|
||||
- Microsoft.Bcl.AsyncInterfaces 9.0.7
|
||||
- Microsoft.Bcl.AsyncInterfaces 9.0.6
|
||||
- Microsoft.Bot.AdaptiveExpressions.Core 4.23.0
|
||||
- Microsoft.CodeAnalysis.NetAnalyzers 9.0.0
|
||||
- Microsoft.Data.Sqlite 9.0.7
|
||||
- Microsoft.Data.Sqlite 9.0.6
|
||||
- Microsoft.Diagnostics.Tracing.TraceEvent 3.1.16
|
||||
- Microsoft.DotNet.ILCompiler (A)
|
||||
- Microsoft.Extensions.DependencyInjection 9.0.7
|
||||
- Microsoft.Extensions.Hosting 9.0.7
|
||||
- Microsoft.Extensions.Hosting.WindowsServices 9.0.7
|
||||
- Microsoft.Extensions.Logging 9.0.7
|
||||
- Microsoft.Extensions.Logging.Abstractions 9.0.7
|
||||
- Microsoft.Extensions.DependencyInjection 9.0.6
|
||||
- Microsoft.Extensions.Hosting 9.0.6
|
||||
- Microsoft.Extensions.Hosting.WindowsServices 9.0.6
|
||||
- Microsoft.Extensions.Logging 9.0.6
|
||||
- Microsoft.Extensions.Logging.Abstractions 9.0.6
|
||||
- Microsoft.NET.ILLink.Tasks (A)
|
||||
- Microsoft.SemanticKernel 1.15.0
|
||||
- Microsoft.Toolkit.Uwp.Notifications 7.1.2
|
||||
- Microsoft.Web.WebView2 1.0.2903.40
|
||||
- Microsoft.Win32.SystemEvents 9.0.7
|
||||
- Microsoft.Windows.Compatibility 9.0.7
|
||||
- Microsoft.Win32.SystemEvents 9.0.6
|
||||
- Microsoft.Windows.Compatibility 9.0.6
|
||||
- Microsoft.Windows.CsWin32 0.3.183
|
||||
- Microsoft.Windows.CsWinRT 2.2.0
|
||||
- Microsoft.Windows.SDK.BuildTools 10.0.26100.4188
|
||||
@@ -1553,25 +1553,25 @@ SOFTWARE.
|
||||
- SkiaSharp.Views.WinUI 2.88.9
|
||||
- StreamJsonRpc 2.21.69
|
||||
- StyleCop.Analyzers 1.2.0-beta.556
|
||||
- System.CodeDom 9.0.7
|
||||
- System.CodeDom 9.0.6
|
||||
- System.CommandLine 2.0.0-beta4.22272.1
|
||||
- System.ComponentModel.Composition 9.0.7
|
||||
- System.Configuration.ConfigurationManager 9.0.7
|
||||
- System.Data.OleDb 9.0.7
|
||||
- System.ComponentModel.Composition 9.0.6
|
||||
- System.Configuration.ConfigurationManager 9.0.6
|
||||
- System.Data.OleDb 9.0.6
|
||||
- System.Data.SqlClient 4.9.0
|
||||
- System.Diagnostics.EventLog 9.0.7
|
||||
- System.Diagnostics.PerformanceCounter 9.0.7
|
||||
- System.Drawing.Common 9.0.7
|
||||
- System.Diagnostics.EventLog 9.0.6
|
||||
- System.Diagnostics.PerformanceCounter 9.0.6
|
||||
- System.Drawing.Common 9.0.6
|
||||
- System.IO.Abstractions 22.0.13
|
||||
- System.IO.Abstractions.TestingHelpers 22.0.13
|
||||
- System.Management 9.0.7
|
||||
- System.Management 9.0.6
|
||||
- System.Net.Http 4.3.4
|
||||
- System.Private.Uri 4.3.2
|
||||
- System.Reactive 6.0.1
|
||||
- System.Runtime.Caching 9.0.7
|
||||
- System.ServiceProcess.ServiceController 9.0.7
|
||||
- System.Text.Encoding.CodePages 9.0.7
|
||||
- System.Text.Json 9.0.7
|
||||
- System.Runtime.Caching 9.0.6
|
||||
- System.ServiceProcess.ServiceController 9.0.6
|
||||
- System.Text.Encoding.CodePages 9.0.6
|
||||
- System.Text.Json 9.0.6
|
||||
- System.Text.RegularExpressions 4.3.1
|
||||
- UnicodeInformation 2.6.0
|
||||
- UnitsNet 5.56.0
|
||||
|
||||
@@ -605,6 +605,9 @@ EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WorkspacesLib", "src\modules\Workspaces\WorkspacesLib\WorkspacesLib.vcxproj", "{B31FCC55-B5A4-4EA7-B414-2DCEAE6AF332}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WorkspacesLibUnitTests", "src\modules\Workspaces\WorkspacesLib.UnitTests\WorkspacesLibUnitTests.vcxproj", "{A85D4D9F-9A39-4B5D-8B5A-9F2D5C9A8B4C}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{B31FCC55-B5A4-4EA7-B414-2DCEAE6AF332} = {B31FCC55-B5A4-4EA7-B414-2DCEAE6AF332}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WorkspacesLauncherUI", "src\modules\Workspaces\WorkspacesLauncherUI\WorkspacesLauncherUI.csproj", "{9C53CC25-0623-4569-95BC-B05410675EE3}"
|
||||
EndProject
|
||||
@@ -722,8 +725,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CalculatorEngineCommon", "s
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ManagedCsWin32", "src\common\ManagedCsWin32\ManagedCsWin32.csproj", "{14AFD976-B4D2-49D0-9E6C-AA93CC061B8A}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PowerRenameUITest", "src\modules\powerrename\PowerRenameUITest\PowerRenameUITest.csproj", "{9D3F3793-EFE3-4525-8782-238015DABA62}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|ARM64 = Debug|ARM64
|
||||
@@ -2604,6 +2605,22 @@ Global
|
||||
{64B88F02-CD88-4ED8-9624-989A800230F9}.Release|ARM64.Build.0 = Release|ARM64
|
||||
{64B88F02-CD88-4ED8-9624-989A800230F9}.Release|x64.ActiveCfg = Release|x64
|
||||
{64B88F02-CD88-4ED8-9624-989A800230F9}.Release|x64.Build.0 = Release|x64
|
||||
{4E0AE3A4-2EE0-44D7-A2D0-8769977254A1}.Debug|ARM64.ActiveCfg = Debug|ARM64
|
||||
{4E0AE3A4-2EE0-44D7-A2D0-8769977254A1}.Debug|ARM64.Build.0 = Debug|ARM64
|
||||
{4E0AE3A4-2EE0-44D7-A2D0-8769977254A1}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{4E0AE3A4-2EE0-44D7-A2D0-8769977254A1}.Debug|x64.Build.0 = Debug|x64
|
||||
{4E0AE3A4-2EE0-44D7-A2D0-8769977254A1}.Release|ARM64.ActiveCfg = Release|ARM64
|
||||
{4E0AE3A4-2EE0-44D7-A2D0-8769977254A1}.Release|ARM64.Build.0 = Release|ARM64
|
||||
{4E0AE3A4-2EE0-44D7-A2D0-8769977254A1}.Release|x64.ActiveCfg = Release|x64
|
||||
{4E0AE3A4-2EE0-44D7-A2D0-8769977254A1}.Release|x64.Build.0 = Release|x64
|
||||
{43E779F3-D83C-48B1-BA8D-1912DBD76FC9}.Debug|ARM64.ActiveCfg = Debug|ARM64
|
||||
{43E779F3-D83C-48B1-BA8D-1912DBD76FC9}.Debug|ARM64.Build.0 = Debug|ARM64
|
||||
{43E779F3-D83C-48B1-BA8D-1912DBD76FC9}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{43E779F3-D83C-48B1-BA8D-1912DBD76FC9}.Debug|x64.Build.0 = Debug|x64
|
||||
{43E779F3-D83C-48B1-BA8D-1912DBD76FC9}.Release|ARM64.ActiveCfg = Release|ARM64
|
||||
{43E779F3-D83C-48B1-BA8D-1912DBD76FC9}.Release|ARM64.Build.0 = Release|ARM64
|
||||
{43E779F3-D83C-48B1-BA8D-1912DBD76FC9}.Release|x64.ActiveCfg = Release|x64
|
||||
{43E779F3-D83C-48B1-BA8D-1912DBD76FC9}.Release|x64.Build.0 = Release|x64
|
||||
{0217E86E-3476-9946-DE8E-9D200CEBD47A}.Debug|ARM64.ActiveCfg = Debug|ARM64
|
||||
{0217E86E-3476-9946-DE8E-9D200CEBD47A}.Debug|ARM64.Build.0 = Debug|ARM64
|
||||
{0217E86E-3476-9946-DE8E-9D200CEBD47A}.Debug|x64.ActiveCfg = Debug|x64
|
||||
@@ -2626,22 +2643,6 @@ Global
|
||||
{2694E2FB-DCD5-4BFF-A418-B6C3C7CE3B8E}.Release|ARM64.ActiveCfg = Release|ARM64
|
||||
{2694E2FB-DCD5-4BFF-A418-B6C3C7CE3B8E}.Release|x64.ActiveCfg = Release|x64
|
||||
{2694E2FB-DCD5-4BFF-A418-B6C3C7CE3B8E}.Release|x64.Build.0 = Release|x64
|
||||
{4E0AE3A4-2EE0-44D7-A2D0-8769977254A1}.Debug|ARM64.ActiveCfg = Debug|ARM64
|
||||
{4E0AE3A4-2EE0-44D7-A2D0-8769977254A1}.Debug|ARM64.Build.0 = Debug|ARM64
|
||||
{4E0AE3A4-2EE0-44D7-A2D0-8769977254A1}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{4E0AE3A4-2EE0-44D7-A2D0-8769977254A1}.Debug|x64.Build.0 = Debug|x64
|
||||
{4E0AE3A4-2EE0-44D7-A2D0-8769977254A1}.Release|ARM64.ActiveCfg = Release|ARM64
|
||||
{4E0AE3A4-2EE0-44D7-A2D0-8769977254A1}.Release|ARM64.Build.0 = Release|ARM64
|
||||
{4E0AE3A4-2EE0-44D7-A2D0-8769977254A1}.Release|x64.ActiveCfg = Release|x64
|
||||
{4E0AE3A4-2EE0-44D7-A2D0-8769977254A1}.Release|x64.Build.0 = Release|x64
|
||||
{43E779F3-D83C-48B1-BA8D-1912DBD76FC9}.Debug|ARM64.ActiveCfg = Debug|ARM64
|
||||
{43E779F3-D83C-48B1-BA8D-1912DBD76FC9}.Debug|ARM64.Build.0 = Debug|ARM64
|
||||
{43E779F3-D83C-48B1-BA8D-1912DBD76FC9}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{43E779F3-D83C-48B1-BA8D-1912DBD76FC9}.Debug|x64.Build.0 = Debug|x64
|
||||
{43E779F3-D83C-48B1-BA8D-1912DBD76FC9}.Release|ARM64.ActiveCfg = Release|ARM64
|
||||
{43E779F3-D83C-48B1-BA8D-1912DBD76FC9}.Release|ARM64.Build.0 = Release|ARM64
|
||||
{43E779F3-D83C-48B1-BA8D-1912DBD76FC9}.Release|x64.ActiveCfg = Release|x64
|
||||
{43E779F3-D83C-48B1-BA8D-1912DBD76FC9}.Release|x64.Build.0 = Release|x64
|
||||
{2CF78CF7-8FEB-4BE1-9591-55FA25B48FC6}.Debug|ARM64.ActiveCfg = Debug|ARM64
|
||||
{2CF78CF7-8FEB-4BE1-9591-55FA25B48FC6}.Debug|ARM64.Build.0 = Debug|ARM64
|
||||
{2CF78CF7-8FEB-4BE1-9591-55FA25B48FC6}.Debug|x64.ActiveCfg = Debug|x64
|
||||
@@ -2658,14 +2659,6 @@ Global
|
||||
{14AFD976-B4D2-49D0-9E6C-AA93CC061B8A}.Release|ARM64.Build.0 = Release|ARM64
|
||||
{14AFD976-B4D2-49D0-9E6C-AA93CC061B8A}.Release|x64.ActiveCfg = Release|x64
|
||||
{14AFD976-B4D2-49D0-9E6C-AA93CC061B8A}.Release|x64.Build.0 = Release|x64
|
||||
{9D3F3793-EFE3-4525-8782-238015DABA62}.Debug|ARM64.ActiveCfg = Debug|ARM64
|
||||
{9D3F3793-EFE3-4525-8782-238015DABA62}.Debug|ARM64.Build.0 = Debug|ARM64
|
||||
{9D3F3793-EFE3-4525-8782-238015DABA62}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{9D3F3793-EFE3-4525-8782-238015DABA62}.Debug|x64.Build.0 = Debug|x64
|
||||
{9D3F3793-EFE3-4525-8782-238015DABA62}.Release|ARM64.ActiveCfg = Release|ARM64
|
||||
{9D3F3793-EFE3-4525-8782-238015DABA62}.Release|ARM64.Build.0 = Release|ARM64
|
||||
{9D3F3793-EFE3-4525-8782-238015DABA62}.Release|x64.ActiveCfg = Release|x64
|
||||
{9D3F3793-EFE3-4525-8782-238015DABA62}.Release|x64.Build.0 = Release|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
@@ -2805,7 +2798,7 @@ Global
|
||||
{25C91A4E-BA4E-467A-85CD-8B62545BF674} = {A50C70A6-2DA0-4027-B90E-B1A40755A8A5}
|
||||
{6AB6A2D6-F859-4A82-9184-0BD29C9F07D1} = {A50C70A6-2DA0-4027-B90E-B1A40755A8A5}
|
||||
{212AD910-8488-4036-BE20-326931B75FB2} = {4AFC9975-2456-4C70-94A4-84073C1CED93}
|
||||
{7AC943C9-52E8-44CF-9083-744D8049667B} = {4574FDD0-F61D-4376-98BF-E5A1262C11EC}
|
||||
{7AC943C9-52E8-44CF-9083-744D8049667B} = {322566EF-20DC-43A6-B9F8-616AF942579A}
|
||||
{54A93AF7-60C7-4F6C-99D2-FBB1F75F853A} = {7AC943C9-52E8-44CF-9083-744D8049667B}
|
||||
{92C39820-9F84-4529-BC7D-22AAE514D63B} = {7AC943C9-52E8-44CF-9083-744D8049667B}
|
||||
{515554D1-D004-4F7F-A107-2211FC0F6B2C} = {7AC943C9-52E8-44CF-9083-744D8049667B}
|
||||
@@ -2937,14 +2930,13 @@ Global
|
||||
{4E0AE3A4-2EE0-44D7-A2D0-8769977254A0} = {F05E590D-AD46-42BE-9C25-6A63ADD2E3EA}
|
||||
{5702B3CC-8575-48D5-83D8-15BB42269CD3} = {929C1324-22E8-4412-A9A8-80E85F3985A5}
|
||||
{64B88F02-CD88-4ED8-9624-989A800230F9} = {ECB8E0D1-7603-4E5C-AB10-D1E545E6F8E2}
|
||||
{4E0AE3A4-2EE0-44D7-A2D0-8769977254A1} = {322566EF-20DC-43A6-B9F8-616AF942579A}
|
||||
{43E779F3-D83C-48B1-BA8D-1912DBD76FC9} = {A2221D7E-55E7-4BEA-90D1-4F162D670BBF}
|
||||
{0217E86E-3476-9946-DE8E-9D200CEBD47A} = {D1D6BC88-09AE-4FB4-AD24-5DED46A791DD}
|
||||
{5F63C743-F6CE-4DBA-A200-2B3F8A14E8C2} = {3846508C-77EB-4034-A702-F8BB263C4F79}
|
||||
{2694E2FB-DCD5-4BFF-A418-B6C3C7CE3B8E} = {89E20BCE-EB9C-46C8-8B50-E01A82E6FDC3}
|
||||
{4E0AE3A4-2EE0-44D7-A2D0-8769977254A1} = {322566EF-20DC-43A6-B9F8-616AF942579A}
|
||||
{43E779F3-D83C-48B1-BA8D-1912DBD76FC9} = {A2221D7E-55E7-4BEA-90D1-4F162D670BBF}
|
||||
{2CF78CF7-8FEB-4BE1-9591-55FA25B48FC6} = {1AFB6476-670D-4E80-A464-657E01DFF482}
|
||||
{14AFD976-B4D2-49D0-9E6C-AA93CC061B8A} = {1AFB6476-670D-4E80-A464-657E01DFF482}
|
||||
{9D3F3793-EFE3-4525-8782-238015DABA62} = {89E20BCE-EB9C-46C8-8B50-E01A82E6FDC3}
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {C3A2F9D1-7930-4EF4-A6FC-7EE0A99821D0}
|
||||
|
||||
@@ -16,56 +16,6 @@
|
||||
|
||||
- Run tests in the Test Explorer (`Test > Test Explorer` or `Ctrl+E, T`).
|
||||
|
||||
## Running tests in pipeline
|
||||
|
||||
The PowerToys UI test pipeline provides flexible options for building and testing:
|
||||
|
||||
### Pipeline Options
|
||||
|
||||
- **useLatestOfficialBuild**: When checked, downloads the latest official PowerToys build and installs it for testing. This skips the full solution build and only builds UI test projects.
|
||||
|
||||
- **useCurrentBranchBuild**: When checked along with `useLatestOfficialBuild`, downloads the official build from the current branch instead of main.
|
||||
|
||||
**Default value**: `false` (downloads from main branch)
|
||||
|
||||
**When to use this**:
|
||||
- **Default scenario**: The pipeline tests against the latest signed PowerToys build from the `main` branch, regardless of which branch your test code changes are from
|
||||
- **Custom branch testing**: Only specify `true` when:
|
||||
- Your branch has produced its own signed PowerToys build via the official build pipeline
|
||||
- You want to test against that specific branch's PowerToys build instead of main
|
||||
- You are testing PowerToys functionality changes that are only available in your branch's build
|
||||
|
||||
**Important notes**:
|
||||
- The test pipeline itself runs from your specified branch, but by default tests against the main branch's PowerToys build
|
||||
- Not all branches have signed builds available - only use this if you're certain your branch has a signed build
|
||||
- If enabled but no build exists for your branch, the pipeline may fail or fall back to main
|
||||
|
||||
- **uiTestModules**: Specify which UI test modules to build and run. This parameter controls both the `.csproj` projects to build and the `.dll` test assemblies to execute. Examples:
|
||||
- `['UITests-FancyZones']` - Only FancyZones UI tests
|
||||
- `['MouseUtils.UITests']` - Only MouseUtils UI tests
|
||||
- `['UITests-FancyZones', 'MouseUtils.UITests']` - Multiple specific modules
|
||||
- Leave empty to build and run all UI test modules
|
||||
|
||||
**Important**: The `uiTestModules` parameter values must match both the test project names (for `.csproj` selection during build) and the test assembly names (for `.dll` execution during testing).
|
||||
|
||||
### Build Modes
|
||||
|
||||
1. **Official Build + Selective Testing** (`useLatestOfficialBuild = true`)
|
||||
- Downloads and installs official PowerToys build
|
||||
- Builds only specified UI test projects
|
||||
- Runs specified UI tests against installed PowerToys
|
||||
- Controlled by `uiTestModules` parameter
|
||||
|
||||
2. **Full Build + Testing** (`useLatestOfficialBuild = false`)
|
||||
- Builds entire PowerToys solution
|
||||
- Builds UI test projects (all or specific based on `uiTestModules`)
|
||||
- Runs UI tests (all or specific based on `uiTestModules`)
|
||||
- Uses freshly built PowerToys for testing
|
||||
|
||||
> **Note**: Both modes support the `uiTestModules` parameter to control which specific UI test modules to build and run.
|
||||
|
||||
### Pipeline Access
|
||||
- Pipeline: https://microsoft.visualstudio.com/Dart/_build?definitionId=161438&_a=summary
|
||||
|
||||
## How to add the first UI tests for your modules
|
||||
|
||||
|
||||
@@ -9,4 +9,4 @@ The following must be kept in mind regarding compatibility with settings v1 and
|
||||
- The status of each of the modules is communicated with the runner in the form of a json object. The names of all the powerToys is set in the [`EnableModules.cs`](src/settings-ui/Settings.UI.Library/EnabledModules.cs) file. The `JsonPropertyName` must not be changed to ensure that the information is dispatched properly to all the modules by the runner.
|
||||
|
||||
### ImageResizer anomaly
|
||||
All the powertoys have the same folder name as well as JsonPropertyName to communicate information with the runner. However that is not the case with ImageResizer. The folder name is `ImageResizer` whereas the JsonPropertyName has an additional space: `Image Resizer`. This should not be changed to ensure backward compatibility as well as proper functioning of the module.
|
||||
All the powertoys have the same folder name as well as JsonPropertyName to communicate information with the runner. However that is not the case with ImageResizer. The folder name is `ImageResizer` whereas the JsonPropertyName is `Image Resizer`(Note the additional space). This should not be changed to ensure backward compatibility as well as proper functioning of the module.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# What is it
|
||||
|
||||
We would like to enable our users to use [`winget configure`](https://learn.microsoft.com/en-us/windows/package-manager/winget/configure) command to install PowerToys and configure its settings with a [WinGet configuration file](https://learn.microsoft.com/en-us/windows/package-manager/configuration/create). For example:
|
||||
We would like to enable our users to use [`winget configure`](https://learn.microsoft.com/en-us/windows/package-manager/winget/configure) command to install PowerToys and configure its settings with a [Winget configuration file](https://learn.microsoft.com/en-us/windows/package-manager/configuration/create). For example:
|
||||
|
||||
```yaml
|
||||
properties:
|
||||
@@ -35,7 +35,7 @@ This should install PowerToys and make `PowerToysConfigure` resource available.
|
||||
PowerToys.Settings.exe set <ModuleName>.<SettingName> <SettingValue>
|
||||
```
|
||||
|
||||
So for example the config above should perform 3 following invocations:
|
||||
So for the example the config above should perform 3 following invocations:
|
||||
```
|
||||
PowerToys.Settings.exe set ShortcutGuide.Enabled false
|
||||
PowerToys.Settings.exe set FancyZones.Enabled true
|
||||
|
||||
@@ -1,25 +1,25 @@
|
||||
# View Models
|
||||
The view models are located within the [`Settings.UI.Library`](/src/settings-ui/Settings.UI.Library) project.
|
||||
# Viewmodels
|
||||
The viewmodels are located within the [`Settings.UI.Library`](/src/settings-ui/Settings.UI.Library) project.
|
||||
|
||||
## Components
|
||||
- Each view model takes in the general `settingsRepository`, the `moduleSettingsRepository` if it exists and the delegates for IPC communication.
|
||||
- Each viewmodel takes in the general `settingsRepository`, the `moduleSettingsRepository` if it exists and the delegates for IPC communication.
|
||||
- The general `settingsRepository` contains the general configurations of all powertoys whereas the `moduleSettingsRepository` is specific to the module. This is to ensure that the configuration details are shared amongst the viewmodels without having to re-open the `settings.json` file.
|
||||
- Whenever there is a change in the UI, the `OnPropertyChanged` event is invoked and the view model sends a corresponding IPC message to the runner which would perform the designated action such as dispatching the change to the modules or enabling/disabling the powertoy, etc.
|
||||
- Whenever there is a change in the UI, the `OnPropertyChanged` event is invoked and the viewmodel sends a corresponding IPC message to the runner which would perform the designated action such as dispatching the change to the modules or enabling/disabling the powertoy etc.
|
||||
|
||||
#### Difference between view models
|
||||
#### Difference between viewmodels
|
||||
- The [`GeneralViewModel`](/src/settings-ui/Settings.UI.Library/ViewModels/GeneralViewModel.cs) is different from the rest of the view models with regard to the IPC communication wherein it sends special IPC messages to the runner to check for updates and to restart as admin.
|
||||
- Each of the powerToy view models have two types of IPC communications, one for the general status of the powerToy and the other for communication powerToy specific change in properties to the runner.
|
||||
- Each of the powerToy viewmodels have two types of IPC communications, one for the general status of the powerToy and the other for communication powerToy specific change in properties to the runner.
|
||||
|
||||
## [`SettingsRepository`](src/settings-ui/Settings.UI.Library/SettingsRepository`1.cs)
|
||||
- The [`SettingsRepository`](src/settings-ui/Settings.UI.Library/SettingsRepository`1.cs) is a generic singleton which contains the configurations for each view model.
|
||||
- As it is a generic singleton, there can only be one instance of the settings repository of a particular type. This ensures that all the view models are modifying a common object and a change made in one locations reflects everywhere.
|
||||
- The [`SettingsRepository`](src/settings-ui/Settings.UI.Library/SettingsRepository`1.cs) is a generic singleton which contains the configurations for each viewmodel.
|
||||
- As it is a generic singleton, there can only be one instance of the settings repository of a particular type. This ensures that all the viewmodels are modifying a common object and a change made in one locations reflects everywhere.
|
||||
- The singleton implementation is thread-safe. Unit tests have been added for the same.
|
||||
|
||||
### Settings view model anomalies
|
||||
- The reason behind using the `SettingsRepository` is to ensure that the settings process does not try to access the `settings.json` files directly but rather does it through this class which encapsulates all the file operations from the view models.
|
||||
- However, this could not be expanded to all the view models directly for the following reasons. Some refactoring must be done to unify these cases and to bring them under the same model:
|
||||
- The PowerRename view model does not save the settings configurations in the same format as the rest of the powertoys, i.e. {name, version, properties}. However, it only stores the properties directly.
|
||||
- Some view models expect the runner to create the file instead of creating the file themselves, like in keyboard manager.
|
||||
### Settings viewmodel anomalies
|
||||
- The reason behind using the `SettingsRepository` is to ensure that the settings process does not try to access the `settings.json` files directly but rather does it through this class which encapsulates all the file operations from the viewmodels.
|
||||
- However, this could not be expanded to all the viewmodels directly for the following reasons. Some refactoring must be done to unify these cases and to bring them under the same model:
|
||||
- The PowerRename viewmodel does not save the settings configurations in the same format as the rest of the powertoys, ie. {name, version, properties}. However, it only stores the properties directly.
|
||||
- Some viewmodels expect the runner to create the file instead of creating the file themselves, like in keyboard manager.
|
||||
- The colorpicker powertoy creates the `settings.json` within the module. This must be taken care of when encapsulated within the settingsRepository.
|
||||
- Currently, all modules use the `SettingsRepository` to access the General Settings config.
|
||||
- However, only FancyZones, ShortcutGuide and PowerPreview use the `SettingsRepository` to access the module properties.
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
## Localization on the pipeline (CDPX)
|
||||
[The localization step](https://github.com/microsoft/PowerToys/blob/86d77103e9c69686c297490acb04775d43ef8b76/.pipelines/pipeline.user.windows.yml#L45-L52) is run on the pipeline before the solution is built. This step runs the [build-localization](https://github.com/microsoft/PowerToys/blob/main/.pipelines/build-localization.cmd) script, which generates resx files for all the projects with localization enabled using the `Localization.XLoc` package.
|
||||
|
||||
The [`Localization.XLoc`](https://github.com/microsoft/PowerToys/blob/86d77103e9c69686c297490acb04775d43ef8b76/.pipelines/build-localization.cmd#L24-L25) tool is run on the repo root, and it checks for all occurrences of `LocProject.json`. Each localized project has a `LocProject.json` file in the project root, which contains the location of the English resx file, list of languages for localization, and the output path where the localized resx files are to be copied to. In addition to this, some other parameters can be set, such as whether the language ID should be added as a folder in the file path or in the file name. When the CDPX pipeline is run, the localization team is notified of changes in the English resx files. For each project with localization enabled, a `loc` folder (see [the loc folder in the Microsoft.Launcher module](https://github.com/microsoft/PowerToys/tree/main/src/modules/launcher/Microsoft.Launcher/loc) for example) is created in the same directory as the `LocProject.json` file. The folder contains language specific folders which in turn have a nested folder path equivalent to `OutputPath` in the `LocProject.json`. Each of these folders contain one `lcl` file. The `lcl` files contain the English resources along with their translation for that language. These are described in more detail in the [Lcl files section](#lcl-files). Once the `.resx` files are generated, they will be used during the `Build PowerToys` step for localized versions of the modules.
|
||||
The [`Localization.XLoc`](https://github.com/microsoft/PowerToys/blob/86d77103e9c69686c297490acb04775d43ef8b76/.pipelines/build-localization.cmd#L24-L25) tool is run on the repo root, and it checks for all occurrences of `LocProject.json`. Each localized project has a `LocProject.json` file in the project root, which contains the location of the English resx file, list of languages for localization, and the output path where the localized resx files are to be copied to. In addition to this, some other parameters can be set, such as whether the language ID should be added as a folder in the file path or in the file name. When the CDPX pipeline is run, the localization team is notified of changes in the English resx files. For each project with localization enabled, a `loc` folder (see [this](https://github.com/microsoft/PowerToys/tree/main/src/modules/launcher/Microsoft.Launcher/loc) for example) is created in the same directory as the `LocProject.json` file. The folder contains language specific folders which in turn have a nested folder path equivalent to `OutputPath` in the `LocProject.json`. Each of these folders contain one `lcl` file. The `lcl` files contain the English resources along with their translation for that language. These are described in more detail in the [Lcl files section](#lcl-files). Once the `.resx` files are generated, they will be used during the `Build PowerToys` step for localized versions of the modules.
|
||||
|
||||
Since the localization script requires certain nuget packages, the [`restore-localization`](https://github.com/microsoft/PowerToys/blob/main/.pipelines/restore-localization.cmd) script is run before running `build-localization` to install all the required packages. This script must [run in the `restore` step](https://github.com/microsoft/PowerToys/blob/86d77103e9c69686c297490acb04775d43ef8b76/.pipelines/pipeline.user.windows.yml#L37-L39) of pipeline because [the host is network isolated](https://onebranch.visualstudio.com/Pipeline/_wiki/wikis/Pipeline.wiki/2066/Consuming-Packages-in-a-CDPx-Pipeline?anchor=overview) at the `build` step. The [Toolset package source](https://github.com/microsoft/PowerToys/blob/86d77103e9c69686c297490acb04775d43ef8b76/.pipelines/pipeline.user.windows.yml#L23) is used for this.
|
||||
|
||||
@@ -159,7 +159,7 @@ This can be done by adding the directory name of the project to [Product.wxs nea
|
||||
|
||||
We should also ensure the new dlls are signed by the pipeline. Currently all dlls of the form [`*.resources.dll` are signed](https://github.com/microsoft/PowerToys/blob/f92bd6ffd38014c228544bb8d68d0937ce4c2b6d/.pipelines/pipeline.user.windows.yml#L68).
|
||||
|
||||
**Note:** The resource dlls should be added to the MSI project only after the initial commit with the lcl files has been done by the Localization team. Otherwise, the pipeline will fail as there wouldn't be any resx files to generate the dlls.
|
||||
**Note:** The resource dlls should be added to the MSI project only after the initial commit with the lcl files has been done by the Localization team. Otherwise the pipeline will fail as there wouldn't be any resx files to generate the dlls.
|
||||
|
||||
## Working With Strings
|
||||
|
||||
|
||||
@@ -56,7 +56,7 @@ string validUIDisplayString = Resources.ValidUIDisplayString;
|
||||
```
|
||||
|
||||
## More On Coding Guidance
|
||||
Please review these brief docs below relating to our coding standards, etc.
|
||||
Please review these brief docs below relating to our coding standards etc.
|
||||
|
||||
* [Coding Style](./style.md)
|
||||
* [Code Organization](./readme.md)
|
||||
|
||||
@@ -162,4 +162,4 @@ This can be done by adding the directory name of the project to [Product.wxs nea
|
||||
|
||||
We should also ensure the new dlls are signed by the pipeline. Currently all dlls of the form [`*.resources.dll` are signed](https://github.com/microsoft/PowerToys/blob/f92bd6ffd38014c228544bb8d68d0937ce4c2b6d/.pipelines/pipeline.user.windows.yml#L68).
|
||||
|
||||
**Note:** The resource dlls should be added to the MSI project only after the initial commit with the lcl files has been done by the Localization team. Otherwise, the pipeline will fail as there wouldn't be any resx files to generate the dlls.
|
||||
**Note:** The resource dlls should be added to the MSI project only after the initial commit with the lcl files has been done by the Localization team. Otherwise the pipeline will fail as there wouldn't be any resx files to generate the dlls.
|
||||
|
||||
@@ -55,7 +55,7 @@ The module is initialized in the AlwaysOnTop class. During initialization, the f
|
||||
The AlwaysOnTop class handles the pinning and unpinning of windows. Key methods include:
|
||||
|
||||
- **PinTopmostWindow**: Pins the specified window on top of others and applies visual indicators
|
||||
- **UnpinTopmostWindows**: Removes the pinning status and visual indicators from the specified window
|
||||
- **UnpinTopmostWindowss**: Removes the pinning status and visual indicators from the specified window
|
||||
- **AssignBorder**: Applies a colored border around the pinned window based on user settings
|
||||
|
||||
### Settings Management
|
||||
|
||||
@@ -68,4 +68,4 @@ EnvironmentVariableUILib # Abstracted UI methods and implementations
|
||||
|
||||
- The module reads and writes variables directly to the registry instead of using the Environment API
|
||||
- This direct registry access approach is used because the Environment API automatically expands variables and has a timeout for notifications
|
||||
- When a profile variable has the same name as an existing User variable, a backup is created with the naming pattern: `VARIABLE_NAME_powertoys_PROFILE_NAME`
|
||||
- When a profile variable has the same name as an existing User variable, a backup is created with a naming pattern: `VARIABLE_NAME_powertoys_PROFILE_NAME`
|
||||
|
||||
@@ -444,12 +444,10 @@ PowerToys/doc/releases/tests-checklist-template.md at releaseChecklist · micros
|
||||
- ### First Run FancyZones error
|
||||

|
||||
|
||||
If you encounter this situation, you need to launch the FancyZones Editor once in the powertoys settings UI:
|
||||
If you encounter this situation, you need to launch the FancyZones Editor once in the powertoys settings UI (Refer to the image below). The reason is that running the Editor directly within the project will not initialize various configuration files.
|
||||
|
||||

|
||||
|
||||
The reason is that running the Editor directly within the project will not initialize various configuration files.
|
||||
|
||||
- ### How are layouts stored and loaded? Is there a central configuration handler?
|
||||
|
||||
There is no central configuration handler.
|
||||
@@ -473,7 +471,7 @@ When the Editor starts, it will load the config data, and when FancyZones starts
|
||||
|
||||
About monitor detection you can find "FancyZones::MoveSizeUpdate" function.
|
||||
|
||||
I believe that in the case without DPI scaling, FancyZones retrieves the window's position and does not need to know what the mouse's DPI scaling is like. If you are referring to window scaling, it is called through the system interface, and you can see the detailed code in "WindowMouseSnap::MoveSizeEnd()" function.
|
||||
I believe that in the case without DPI scaling, FancyZones retrieves the window's position and does not need to know what the mouse's DPI scaling is like. If you are referring to window scaling, it is called through the system interface, and you can see the detailed code in "WindowMouseSnap::MoveSizeEnd()" fucntion.
|
||||
|
||||
- ### How does FancyZones track which windows belong to which zones?
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ For more details on the implementation approach, see the [Dual Registration sect
|
||||
Image Resizer dynamically determines when to show the context menu option:
|
||||
- `AppxManifest.xml` registers the extension for all file types (`Type="*"`)
|
||||
- The shell extension checks if the selected files are images using `AssocGetPerceivedType()`
|
||||
- The menu appears only for image files (returns `ECS_ENABLED`); otherwise, it remains hidden (returns `ECS_HIDDEN`)
|
||||
- The menu appears only for image files (returns `ECS_ENABLED`), otherwise it remains hidden (returns `ECS_HIDDEN`)
|
||||
|
||||
This approach provides flexibility to support additional file types by modifying only the detection logic without changing the system-level registration.
|
||||
|
||||
|
||||
@@ -86,7 +86,7 @@ Returns true if successful.
|
||||
virtual void set_config(const wchar_t* config)
|
||||
```
|
||||
|
||||
After the user has changed the module settings in the Settings editor, the runner calls this method to pass the updated values to the module. It's a good place to save the settings as well.
|
||||
After the user has changed the module settings in the Settings editor, the runner calls this method to pass to the module the updated values. It's a good place to save the settings as well.
|
||||
|
||||
## call_custom_action
|
||||
|
||||
|
||||
@@ -58,7 +58,7 @@ This file contains documentation for all the methods involved in key/shortcut re
|
||||
[This method](https://github.com/microsoft/PowerToys/blob/b80578b1b9a4b24c9945bddac33c771204280107/src/modules/keyboardmanager/dll/KeyboardEventHandlers.cpp#L754-L809) is used for handling app-specific shortcut to shortcut and shortcut to key remaps. The general logic is as follows:
|
||||
- Check if the `dwExtraInfo` field is set to `KEYBOARDMANAGER_SHORTCUT_FLAG`. This indicates that the key event was generated by the KBM shortcut remap method using `SendInput`. This ensures that we don't read events generated by the shortcut remap method, but we still read events which are generated by the key remap method.
|
||||
- Get the name of the process in the foreground. This is done using `GetCurrentApplication` which uses `GetForegroundWindow` to get the window handle and `get_process_path` from the common lib. This approach can fail for UWP apps in full screen, so for that scenario we use the `GetGUIThreadInfo` approach to find the correct window handle, and hence the correct process name. This method is [described in more detail](keyboardmanagercommon.md#Foreground-app-detection)
|
||||
- By checking `KeyboardManagerState.GetActivatedApp` we check if an app-specific shortcut is currently invoked. If so, we consider this application to be the activated app. This is required because some shortcut remaps could cause the current app to lose focus and hence until the shortcut is completely released we should allow that remap to continue; otherwise, the user could end up in a state where some keys do not get released. For example: remap <kbd>Ctrl+A</kbd> to <kbd>Alt+Tab</kbd> for Edge, when a user presses <kbd>Ctrl+A</kbd> the window loses focus as <kbd>Alt+Tab</kbd> gets executed.
|
||||
- By checking `KeyboardManagerState.GetActivatedApp` we check if an app-specific shortcut is currently invoked. If so, we consider this application to be the activated app. This is required because some shortcut remaps could cause the current app to lose focus and hence until the shortcut is completely released we should allow that remap to continue, otherwise the user could end up in a state where some keys do not get released. For example: remap <kbd>Ctrl+A</kbd> to <kbd>Alt+Tab</kbd> for Edge, when a user presses <kbd>Ctrl+A</kbd> the window loses focus as <kbd>Alt+Tab</kbd> gets executed.
|
||||
- If there is no app-specific shortcut currently invoked, we check if the foreground process is present in the list of app-specific remaps, either with or without the file extension and case-insensitive. If it is, this is considered to be the activated app.
|
||||
- Call `HandleShortcutRemapEvent` with the `activatedApp` argument so that app-specific shortcut remapping takes place if it applies for the current key event.
|
||||
|
||||
@@ -73,8 +73,8 @@ The [`MockedInput`](https://github.com/microsoft/PowerToys/blob/main/src/modules
|
||||
|
||||
[To mock the `SendInput` method](https://github.com/microsoft/PowerToys/blob/b80578b1b9a4b24c9945bddac33c771204280107/src/modules/keyboardmanager/test/MockedInput.cpp#L10-L110), the steps for processing the input are as follows. This implementation is based on public documentation for SendInput and the behavior of key messages and keyboard hooks:
|
||||
- Iterate over all the inputs in the `INPUT` vector argument.
|
||||
- If the event is a key up event, then it is considered [`WM_SYSKEYUP`](https://learn.microsoft.com/windows/win32/inputdev/wm-syskeyup) if Alt is held down; otherwise, it is `WM_KEYUP`.
|
||||
- If the event is a key down event, then it is considered [`WM_SYSKEYDOWN`](https://learn.microsoft.com/windows/win32/inputdev/wm-syskeydown) if either Alt is held down or if it is F10; otherwise, it is `WM_KEYDOWN`.
|
||||
- If the event is a key up event, then it is considered [`WM_SYSKEYUP`](https://learn.microsoft.com/windows/win32/inputdev/wm-syskeyup) if Alt is held down, otherwise it is `WM_KEYUP`.
|
||||
- If the event is a key down event, then it is considered [`WM_SYSKEYDOWN`](https://learn.microsoft.com/windows/win32/inputdev/wm-syskeydown) if either Alt is held down or if it is F10, otherwise it is `WM_KEYDOWN`.
|
||||
- An optional function which can be set on the `MockedInput` handler can be used to test for the number of times a key event is received by the system with a particular condition using [`sendVirtualInputCallCondition`](https://github.com/microsoft/PowerToys/blob/b80578b1b9a4b24c9945bddac33c771204280107/src/modules/keyboardmanager/test/MockedInput.cpp#L48-L52).
|
||||
- The hook logic for a low level hook which returns 0 or 1 can be set on the `MockedInput` handler such that it behaves like a low level hook would behave with actual keyboard input. If the method returns 1, then the keyboard state is not updated, and if it returns 0 the corresponding key event is used to update the key state. This works in the recursive way as well similar to low level hooks, as `SendVirtualInput` can be called from within the hook, thus simulating identical behavior to calling `SendInput` in a low level hook (as soon as SendInput is called, the low level hook is called for the new input event, and only after those are processed it returns back to the current event, check this [blog](https://devblogs.microsoft.com/oldnewthing/20140213-00/?p=1773) for more details).
|
||||
- For updating the keyboard state, KEYUP messages result in the state for that key code being set to false, and KEYDOWN result in the state for that key code being set to true.
|
||||
|
||||
@@ -127,12 +127,12 @@ The [`HandleKeyboardHookEvent`](https://github.com/microsoft/PowerToys/blob/b805
|
||||
**Note:** Single key remaps need to be executed before shortcut remaps, because otherwise there can be several logical issues. For example if a user has Ctrl remapped to X and Ctrl+A remapped to Y, we can't detect Ctrl+A because the moment Ctrl is pressed it would be remapped to X before the system ever sees Ctrl+A. This is why the design decision was made to separate Remap keys and Remap shortcuts, and all key remaps are reflected in the shortcut remaps.
|
||||
|
||||
## Custom Action to launch KBM UI
|
||||
KBM uses the [`call_custom_action`](https://github.com/microsoft/PowerToys/blob/b80578b1b9a4b24c9945bddac33c771204280107/src/modules/keyboardmanager/dll/dllmain.cpp#L249-L280) method from the `PowertoyModuleIface` in order to launch the KBM UI when the user clicks "Remap a key" or "Remap a shortcut" from the KBM settings page. On clicking the button, we check if there is already any active KBM UI window, and if there is it is brought to the foreground. If not, the corresponding KBM UI window is launched on a separate detached thread. The UI is described in more detail in [Keyboard Manager UI](keyboardmanagerui.md).
|
||||
KBM uses the [`call_custom_action`](https://github.com/microsoft/PowerToys/blob/b80578b1b9a4b24c9945bddac33c771204280107/src/modules/keyboardmanager/dll/dllmain.cpp#L249-L280) method from the `PowertoyModuleIface` in order to launch the KBM UI when the user clicks the Remap a key or Remap a shortcut button from the KBM settings page. On clicking the button, we check if there is already any active KBM UI window, and if there is it is brought to the foreground. If not, the corresponding KBM UI window is launched on a separate detached thread. The UI is described in more detail in [Keyboard Manager UI](keyboardmanagerui.md).
|
||||
|
||||
## SendInput Special Scenarios
|
||||
|
||||
### Extended keys
|
||||
Certain keys such as the arrow keys, <kbd>right Ctrl/Alt</kbd>, and <kbd>Del/Home/Ins</kbd>, etc. need to be sent with the `KEYEVENTF_EXTENDEDKEY` flag because otherwise the NumPad versions get sent, which can cause weird behavior when NumLock is on. The code can be found where [`SetKeyEvent` checks `IsExtendedKey(keyCode)`](https://github.com/microsoft/PowerToys/blob/b80578b1b9a4b24c9945bddac33c771204280107/src/modules/keyboardmanager/common/Helpers.cpp#L190-L194) and the list of extended keys in code can be found in [`IsExtendedKey`](https://github.com/microsoft/PowerToys/blob/b80578b1b9a4b24c9945bddac33c771204280107/src/modules/keyboardmanager/common/Helpers.cpp#L73-L98). Docs about extended keys can be found in [Keyboard Input Overview: Extended-Key Flag
|
||||
Certain keys such as the arrow keys, <kbd>right Ctrl/Alt</kbd>, and <kbd>Del/Home/Ins</kbd>, etc need to be sent with the `KEYEVENTF_EXTENDEDKEY` flag because otherwise the NumPad versions get sent, which can cause weird behavior when NumLock is on. The code can be found where [`SetKeyEvent` checks `IsExtendedKey(keyCode)`](https://github.com/microsoft/PowerToys/blob/b80578b1b9a4b24c9945bddac33c771204280107/src/modules/keyboardmanager/common/Helpers.cpp#L190-L194) and the list of extended keys in code can be found in [`IsExtendedKey`](https://github.com/microsoft/PowerToys/blob/b80578b1b9a4b24c9945bddac33c771204280107/src/modules/keyboardmanager/common/Helpers.cpp#L73-L98). Docs about extended keys can be found in [Keyboard Input Overview: Extended-Key Flag
|
||||
](https://learn.microsoft.com/windows/win32/inputdev/about-keyboard-input#extended-key-flag).
|
||||
|
||||
The weird behavior that is caused by this can be found at these issues:
|
||||
@@ -177,13 +177,13 @@ For example, while [remapping <kbd>Ctrl</kbd> to <kbd>Caps Lock</kbd>](https://g
|
||||
While the above work around fixes most of the cases, there are still some scenarios where the modifier can get stuck, mentioned at this [comment](https://github.com/microsoft/PowerToys/issues/3397#issuecomment-663729278), which is why the issue is still open. This occurs if a modifier is pressed after the remap has been invoked before releasing the remapped key and it is a harder scenario to solve which requires refactoring the single key remap code.
|
||||
|
||||
### UIPI Issues (not resolved)
|
||||
`SendInput` does not work directly with certain key codes such as Play/Pause Media, Calculator key, etc. as it requires UAC privileges to be injected to the OS and accordingly play the active media app or launch the Calculator app. In order to resolve this the correct approach is that the executable which calls `SendInput` needs to have the [UIAccess flag](https://learn.microsoft.com/windows/win32/winauto/uiauto-securityoverview) set to true, which will also avoid the requirement of KBM having to run as administrator to intercept key events when an elevated window is in focus. The UIAccess flag has many constraints such as it must be a signed executable and must be located in a protected path like Program Files. Since KBM currently runs out of the runner process, it would make more sense to do this work after KBM is moved to a separate executable, and it could be enabled by a separate toggle in settings only if PowerToys is installed in Program Files. [This comment](https://github.com/microsoft/PowerToys/issues/3192#issuecomment-646323661) has more details on this approach and (this)[https://github.com/microsoft/PowerToys/issues/3255] is the tracking issue.
|
||||
`SendInput` does not work directly with certain key codes such as Play/Pause Media, Calculator key, etc as it requires UAC privileges to be injected to the OS and accordingly play the active media app or launch the Calculator app. In order to resolve this the correct approach is that the executable which calls `SendInput` needs to have the [UIAccess flag](https://learn.microsoft.com/windows/win32/winauto/uiauto-securityoverview) set to true, which will also avoid the requirement of KBM having to run as administrator to intercept key events when an elevated window is in focus. The UIAccess flag has many constraints such as it must be a signed executable and must be located in a protected path like Program Files. Since KBM currently runs out of the runner process, it would make more sense to do this work after KBM is moved to a separate executable, and it could be enabled by a separate toggle in settings only if PowerToys is installed in Program Files. [This comment](https://github.com/microsoft/PowerToys/issues/3192#issuecomment-646323661) has more details on this approach and (this)[https://github.com/microsoft/PowerToys/issues/3255] is the tracking issue.
|
||||
|
||||
## Other remapping approaches
|
||||
Other approaches for remapping which were deprioritized are:
|
||||
|
||||
### Registry approach
|
||||
This method is used by [SharpKeys](https://github.com/randyrants/sharpkeys) and involves using the [Microsoft Keyboard Scancode mapper registry key](https://github.com/randyrants/sharpkeys) to remap keys based on their scan codes. This has the advantage of being applied in all scenarios and not facing any elevation or UAC issues, however the disadvantages are that for modifying the settings, the process must run elevated (as it modifies HKLM registry) and it requires a reboot to get applied. Another issue which is an advantage/disadvantage for users is that the process does not need to be running, so the remaps are applied all the time, including at the password prompt on logging into the user's Windows account, which could get a user stuck if they orphaned a key in their password. This registry doesn't have any support for remapping shortcuts either, so the hook approach was prioritized over this.
|
||||
This method is used by [SharpKeys](https://github.com/randyrants/sharpkeys) and involves using the [Microsoft Keyboard Scancode mapper registry key](https://github.com/randyrants/sharpkeys) to remap keys based on their scan codes. This has the advantage of being applied in all scenarios and not facing any elevation or UAC issues, however the disadvantages are that for modifying the settings the process must run elevated (as it modifies HKLM registry) and it requires a reboot to get applied. Another issue which is an advantage/disadvantage for users is that the process does not need to be running, so the remaps are applied all the time, including at the password prompt on logging into the user's Windows account, which could get a user stuck if they orphaned a key in their password. This registry doesn't have any support for remapping shortcuts either, so the hook approach was prioritized over this.
|
||||
|
||||
### Driver approach
|
||||
Using a driver approach has the benefit of not depending on precedence orders as KBM could always run before low level hooks, and it also has the benefit of differentiating between different keyboards, allowing [multi keyboard-specific remaps](https://github.com/microsoft/PowerToys/issues/1460). The disadvantages are however that any bug or crash could have system level consequences. [Interception](https://github.com/oblitum/Interception) is an open source driver that could be used for implementing this. The approach was deprioritized due to the potential side effects.
|
||||
@@ -191,7 +191,7 @@ Using a driver approach has the benefit of not depending on precedence orders as
|
||||
## Telemetry
|
||||
Keyboard Manager emits the following telemetry events (implemented in [trace.h](https://github.com/microsoft/PowerToys/blob/main/src/modules/keyboardmanager/common/trace.h) and [trace.cpp](https://github.com/microsoft/PowerToys/blob/main/src/modules/keyboardmanager/common/trace.cpp)):
|
||||
- **`KeyboardManager_EnableKeyboardManager`:** Logs a `boolean` value storing the KBM toggle state. It is logged whenever KBM is enabled or disabled (emitted in [`enable`](https://github.com/microsoft/PowerToys/blob/b80578b1b9a4b24c9945bddac33c771204280107/src/modules/keyboardmanager/dll/dllmain.cpp#L305-L306) and [`disable`](https://github.com/microsoft/PowerToys/blob/b80578b1b9a4b24c9945bddac33c771204280107/src/modules/keyboardmanager/dll/dllmain.cpp#L315-L316)).
|
||||
- **`KeyboardManager_KeyRemapCount`:** Logs the number of key to key and key to shortcut remaps (i.e. all the remaps on the "Remap a key" window). This gets logged on saving new settings in the "Remap a key" window (emitted at [the end of `ApplySingleKeyRemappings`](https://github.com/microsoft/PowerToys/blob/b80578b1b9a4b24c9945bddac33c771204280107/src/modules/keyboardmanager/ui/LoadingAndSavingRemappingHelper.cpp#L159-L163)).
|
||||
- **`KeyboardManager_OSLevelShortcutRemapCount`:** Logs the number of global shortcut to shortcut and shortcut to key remaps. This gets logged on saving new settings in the "Remap a shortcut" window (emitted at [the end of `ApplyShortcutRemappings`](https://github.com/microsoft/PowerToys/blob/b80578b1b9a4b24c9945bddac33c771204280107/src/modules/keyboardmanager/ui/LoadingAndSavingRemappingHelper.cpp#L220)).
|
||||
- **`KeyboardManager_AppSpecificShortcutRemapCount`:** Logs the number of app-specific shortcut to shortcut and shortcut to key remaps. This gets logged on saving new settings in the "Remap a shortcut" window (emitted [after calling `OSLevelShortcutRemapCount` in `ApplyShortcutRemappings`](https://github.com/microsoft/PowerToys/blob/b80578b1b9a4b24c9945bddac33c771204280107/src/modules/keyboardmanager/ui/LoadingAndSavingRemappingHelper.cpp#L221)).
|
||||
- **`KeyboardManager_KeyRemapCount`:** Logs the number of key to key and key to shortcut remaps (i.e. all the remaps on the Remap a key window). This gets logged on saving new settings in the Remap a key window (emitted at [the end of `ApplySingleKeyRemappings`](https://github.com/microsoft/PowerToys/blob/b80578b1b9a4b24c9945bddac33c771204280107/src/modules/keyboardmanager/ui/LoadingAndSavingRemappingHelper.cpp#L159-L163)).
|
||||
- **`KeyboardManager_OSLevelShortcutRemapCount`:** Logs the number of global shortcut to shortcut and shortcut to key remaps. This gets logged on saving new settings in the Remap a shortcut window (emitted at [the end of `ApplyShortcutRemappings`](https://github.com/microsoft/PowerToys/blob/b80578b1b9a4b24c9945bddac33c771204280107/src/modules/keyboardmanager/ui/LoadingAndSavingRemappingHelper.cpp#L220)).
|
||||
- **`KeyboardManager_AppSpecificShortcutRemapCount`:** Logs the number of app-specific shortcut to shortcut and shortcut to key remaps. This gets logged on saving new settings in the Remap a shortcut window (emitted [after calling `OSLevelShortcutRemapCount` in `ApplyShortcutRemappings`](https://github.com/microsoft/PowerToys/blob/b80578b1b9a4b24c9945bddac33c771204280107/src/modules/keyboardmanager/ui/LoadingAndSavingRemappingHelper.cpp#L221)).
|
||||
- **`KeyboardManager_Error`:** Logs the occurrence of an error in KBM with the name of the method, error code and the corresponding error message. This is currently used only for logging `SetWindowsHookEx` failures (emitted [at the end of `start_lowlevel_keyboard_hook`](https://github.com/microsoft/PowerToys/blob/b80578b1b9a4b24c9945bddac33c771204280107/src/modules/keyboardmanager/dll/dllmain.cpp#L364-L369)).
|
||||
|
||||
@@ -32,7 +32,7 @@ The KBM UI consists of a [`Grid` with several columns](https://github.com/micros
|
||||
|
||||
When the UI windows are activated the `KeyboardManagerState` object [sets the `UIState` variable](https://github.com/microsoft/PowerToys/blob/b80578b1b9a4b24c9945bddac33c771204280107/src/modules/keyboardmanager/ui/EditKeyboardWindow.cpp#L251-L252) which is used for distinguishing if the UI is up from the keyboard hook thread. The [states are also updated](https://github.com/microsoft/PowerToys/blob/b80578b1b9a4b24c9945bddac33c771204280107/src/modules/keyboardmanager/ui/SingleKeyRemapControl.cpp#L53) on opening and closing the Type window.
|
||||
|
||||
Clicking the Type Button [opens a content dialog](https://github.com/microsoft/PowerToys/blob/b80578b1b9a4b24c9945bddac33c771204280107/src/modules/keyboardmanager/ui/SingleKeyRemapControl.cpp#L206-L380) which registers key delays using the [`KeyDelay` class](keyboardmanagercommon.md#KeyDelay) for Enter and Esc keys and sets the UI states such that when a key event occurs the TextBlocks on the ContentDialog are updated accordingly. On accepting the dialog, the selected keys are copied into the ComboBoxes from the TextBlocks, and on closing the window, the key delays are unregistered and UI states are reset.
|
||||
Clicking the Type Button [opens a content dialog](https://github.com/microsoft/PowerToys/blob/b80578b1b9a4b24c9945bddac33c771204280107/src/modules/keyboardmanager/ui/SingleKeyRemapControl.cpp#L206-L380) which registers key delays using the [`KeyDelay` class](keyboardmanagercommon.md#KeyDelay) for Enter and Esc keys and sets the UI states such that when a key event occurs the TextBlocks on the ContentDialog are updated accordingly. On accepting the dialog the selected keys are copied into the ComboBoxes from the TextBlocks, and on closing the window the key delays are unregistered and UI states are reset.
|
||||
|
||||
Since ComboBoxes are added dynamically, handlers have been added which [update the accessible names for these controls](https://github.com/microsoft/PowerToys/blob/b80578b1b9a4b24c9945bddac33c771204280107/src/modules/keyboardmanager/ui/KeyDropDownControl.cpp#L69-L74), which get executed whenever a drop down is added or removed.
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ The Value Generator plugin is used to generate hashes for strings, to calculate
|
||||
- [`UuidCreateSequential`](https://learn.microsoft.com/en-us/windows/win32/api/rpcdce/nf-rpcdce-uuidcreatesequential) for version 1
|
||||
- `System.Guid.NewGuid()` for version 4
|
||||
- `System.Guid.CreateVersion7()` for version 7
|
||||
- Versions 3 and 5 take two parameters: a namespace and a name
|
||||
- Versions 3 and 5 take two parameters, a namespace and a name
|
||||
- The namespace must be a valid GUID or one of the [predefined ones](https://datatracker.ietf.org/doc/html/rfc4122#appendix-C)
|
||||
- The `PredefinedNamespaces` dictionary contains aliases for the predefined namespaces
|
||||
- The name can be any string
|
||||
@@ -72,10 +72,10 @@ The Value Generator plugin is used to generate hashes for strings, to calculate
|
||||
### [`InputParser`](/src/modules/launcher/Plugins/Community.PowerToys.Run.Plugin.ValueGenerator/InputParser.cs)
|
||||
- It is responsible only for parsing the query from the user
|
||||
- Based on the user query, the `ParseInput()` method must return an object that implements the `IComputeRequest` interface or it must throw one of `FormatException` or `ArgumentException`
|
||||
- Throwing an `ArgumentException` should signal the fact that the query contains a mistake that the user can fix (e.g. an unsupported hash function, an invalid GUID version, an invalid namespace, etc.)
|
||||
- Throwing an `ArgumentException` should signal the fact the query contains a mistake that the user can fix (eg. an unsupported hash function, an invalid GUID version, an invalid namespace, etc)
|
||||
> The error message will be shown to the user and no log message will be created
|
||||
- Throwing a `FormatException` should signal either:
|
||||
- that the query may become valid, and so it does not make sense to show an error just yet (e.g. the query does not contain a request yet, a hash request without a string to hash)
|
||||
- that the query may become valid, and so it does not make sense to show an error just yet (eg. the query does not contain a request yet, a hash request without a string to hash)
|
||||
- that the query is completely invalid
|
||||
> The error message will not be shown to the user but a log message will be created
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ The History Plugin allows users to search or display results they have used (sel
|
||||
The plugin uses data that was already being captured which is, what results were clicked, and how many times. We do add a little more data to this set now.
|
||||
When this plugin is queried, it creates results based on this previously selected results data.
|
||||
|
||||
In order to make sure selected results in the history are still valid, we re-query the relevant plugin using the PluginManager. If there are no results,
|
||||
In order to make sure selected results in the history are still valid, we re-query the plugin the relevant plug using the PluginManager. If there are no results,
|
||||
this history item is not included. This usually means that the result is no longer valid. For instance, if a file was deleted, but it's still in the selected history
|
||||
we don't want to show it as a selectable result.
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ The code itself is very simple, basically just a call into OneNote interop via t
|
||||
var pages = OneNoteProvider.FindPages(query.Search);
|
||||
```
|
||||
|
||||
The query results will be cached for 1 day, and if cached results are found they'll be returned in the initial `Query()` call; otherwise, OneNote itself will be queried in the `delayedExecution:true` overload.
|
||||
The query results will be cached for 1 day, and if cached results are found they'll be returned in the initial `Query()` call, otherwise OneNote itself will be queried in the `delayedExecution:true` overload.
|
||||
|
||||
If the user actions on a result, it'll open it in the OneNote app, and restore and/or focus the app as well if necessary.
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ The user can switch to the found windows, close them or kill their process.
|
||||
## Remarks
|
||||
|
||||
### UWP Apps
|
||||
- The process of an UWP app can't be detected correctly for windows that are minimized while searching. At this time they are assigned to the generic process `ApplicationFrameHost.exe`. If the user searches for such a window while it is not minimized, then the process gets assigned correctly/updated.
|
||||
- The process of an UWP app can't be detected correctly for windows that are minimized while searching. At this time they are assigned to the generic process `ApplicationFrameHost.exe`. If the user searches for such an window while it is not minimized, then the process gets assigned correctly/updated.
|
||||
|
||||
### Killing processes
|
||||
- Killing the Explorer process is only allowed, if each folder window is running in its own process. (See section `File Explorer setting` below.)
|
||||
@@ -17,7 +17,7 @@ The user can switch to the found windows, close them or kill their process.
|
||||
- Windows of UWP apps don't know their process, until they are searched in non-minimized state.
|
||||
|
||||
### File Explorer setting
|
||||
- To kill the Process of an Explorer window, each window has to run in a separate process. Otherwise, the process is the same one as the shell process and killing the shell process will crash the shell (Windows ui).
|
||||
- To kill the Process of an Explorer window, each window has to run in a separate process. Otherwise the process is the same one as the shell process and killing the shell process will crash the shell (Windows ui).
|
||||
- To enable this behavior the setting `Launch folder windows in a separate process` under `Folder Options > View` has to be enabled.
|
||||
- From PowerToys Run you can open the `Folder options` dialog by clicking the information message in the search results. The information message is only shown when searching with action keyword for explorer windows and can be hidden in the plugin settings.
|
||||
- Note: The folder option/process is evaluated in real time. After changing the setting it is enough to search again for the windows.
|
||||
|
||||
@@ -31,7 +31,7 @@ This document outlines the process for preparing and publishing PowerToys releas
|
||||
- Uses semantic versioning: `MAJOR.MINOR.PATCH`
|
||||
- MINOR version increases with regular releases (e.g., 0.89.0)
|
||||
- PATCH version increases for hotfixes (e.g., 0.87.0 → 0.87.1)
|
||||
- Each release version must be greater than the previous one for proper updating
|
||||
- Each release version must be higher than the previous one for proper updating
|
||||
|
||||
## Testing Process
|
||||
|
||||
|
||||
@@ -5,10 +5,10 @@
|
||||
<?include $(sys.CURRENTDIR)\Common.wxi?>
|
||||
|
||||
<?define ImageResizerAssetsFiles=?>
|
||||
<?define ImageResizerAssetsFilesPath=$(var.BinDir)WinUI3Apps\Assets\ImageResizer\?>
|
||||
<?define ImageResizerAssetsFilesPath=$(var.BinDir)Assets\ImageResizer\?>
|
||||
|
||||
<Fragment>
|
||||
<DirectoryRef Id="WinUI3AppsAssetsFolder">
|
||||
<DirectoryRef Id="BaseApplicationsAssetsFolder">
|
||||
<Directory Id="ImageResizerAssetsFolder" Name="ImageResizer" />
|
||||
</DirectoryRef>
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
<Component Id="Module_ImageResizer_Registry" Win64="yes">
|
||||
<RegistryKey Root="$(var.RegistryScope)" Key="Software\Classes\CLSID\{51B4D7E5-7568-4234-B4BB-47FB3C016A69}\InprocServer32">
|
||||
<RegistryValue Value="[WinUI3AppsInstallFolder]PowerToys.ImageResizerExt.dll" Type="string" />
|
||||
<RegistryValue Value="[INSTALLFOLDER]PowerToys.ImageResizerExt.dll" Type="string" />
|
||||
<RegistryValue Name="ThreadingModel" Value="Apartment" Type="string" />
|
||||
</RegistryKey>
|
||||
|
||||
|
||||
@@ -186,7 +186,7 @@
|
||||
<RegistryKey Root="$(var.RegistryScope)" Key="Software\Classes\powertoys\components">
|
||||
<RegistryValue Type="string" Name="ImageResizer_$(var.IdSafeLanguage)_Component" Value="" KeyPath="yes"/>
|
||||
</RegistryKey>
|
||||
<File Id="ImageResizer_$(var.IdSafeLanguage)_File" Source="$(var.BinDir)\WinUI3Apps\$(var.Language)\PowerToys.ImageResizer.resources.dll" />
|
||||
<File Id="ImageResizer_$(var.IdSafeLanguage)_File" Source="$(var.BinDir)\$(var.Language)\PowerToys.ImageResizer.resources.dll" />
|
||||
</Component>
|
||||
<Component
|
||||
Id="ColorPicker_$(var.IdSafeLanguage)_Component"
|
||||
|
||||
@@ -179,7 +179,7 @@ Generate-FileList -fileDepsJson "" -fileListName HostsAssetsFiles -wxsFilePath $
|
||||
Generate-FileComponents -fileListName "HostsAssetsFiles" -wxsFilePath $PSScriptRoot\Hosts.wxs -regroot $registryroot
|
||||
|
||||
#ImageResizer
|
||||
Generate-FileList -fileDepsJson "" -fileListName ImageResizerAssetsFiles -wxsFilePath $PSScriptRoot\ImageResizer.wxs -depsPath "$PSScriptRoot..\..\..\$platform\Release\WinUI3Apps\Assets\ImageResizer"
|
||||
Generate-FileList -fileDepsJson "" -fileListName ImageResizerAssetsFiles -wxsFilePath $PSScriptRoot\ImageResizer.wxs -depsPath "$PSScriptRoot..\..\..\$platform\Release\Assets\ImageResizer"
|
||||
Generate-FileComponents -fileListName "ImageResizerAssetsFiles" -wxsFilePath $PSScriptRoot\ImageResizer.wxs -regroot $registryroot
|
||||
|
||||
#New+
|
||||
|
||||
@@ -11,35 +11,26 @@ namespace Common.UI
|
||||
{
|
||||
public enum SettingsWindow
|
||||
{
|
||||
Dashboard = 0,
|
||||
Overview,
|
||||
AlwaysOnTop,
|
||||
Overview = 0,
|
||||
Awake,
|
||||
ColorPicker,
|
||||
CmdNotFound,
|
||||
FancyZones,
|
||||
FileLocksmith,
|
||||
Run,
|
||||
ImageResizer,
|
||||
KBM,
|
||||
MouseUtils,
|
||||
MouseWithoutBorders,
|
||||
Peek,
|
||||
PowerAccent,
|
||||
PowerLauncher,
|
||||
PowerPreview,
|
||||
PowerRename,
|
||||
FileExplorer,
|
||||
ShortcutGuide,
|
||||
Hosts,
|
||||
MeasureTool,
|
||||
PowerOCR,
|
||||
Workspaces,
|
||||
RegistryPreview,
|
||||
CropAndLock,
|
||||
EnvironmentVariables,
|
||||
Dashboard,
|
||||
AdvancedPaste,
|
||||
NewPlus,
|
||||
Workspaces,
|
||||
CmdPal,
|
||||
ZoomIt,
|
||||
}
|
||||
@@ -48,22 +39,14 @@ namespace Common.UI
|
||||
{
|
||||
switch (value)
|
||||
{
|
||||
case SettingsWindow.Dashboard:
|
||||
return "Dashboard";
|
||||
case SettingsWindow.Overview:
|
||||
return "Overview";
|
||||
case SettingsWindow.AlwaysOnTop:
|
||||
return "AlwaysOnTop";
|
||||
case SettingsWindow.Awake:
|
||||
return "Awake";
|
||||
case SettingsWindow.ColorPicker:
|
||||
return "ColorPicker";
|
||||
case SettingsWindow.CmdNotFound:
|
||||
return "CmdNotFound";
|
||||
case SettingsWindow.FancyZones:
|
||||
return "FancyZones";
|
||||
case SettingsWindow.FileLocksmith:
|
||||
return "FileLocksmith";
|
||||
case SettingsWindow.Run:
|
||||
return "Run";
|
||||
case SettingsWindow.ImageResizer:
|
||||
@@ -72,16 +55,6 @@ namespace Common.UI
|
||||
return "KBM";
|
||||
case SettingsWindow.MouseUtils:
|
||||
return "MouseUtils";
|
||||
case SettingsWindow.MouseWithoutBorders:
|
||||
return "MouseWithoutBorders";
|
||||
case SettingsWindow.Peek:
|
||||
return "Peek";
|
||||
case SettingsWindow.PowerAccent:
|
||||
return "PowerAccent";
|
||||
case SettingsWindow.PowerLauncher:
|
||||
return "PowerLauncher";
|
||||
case SettingsWindow.PowerPreview:
|
||||
return "PowerPreview";
|
||||
case SettingsWindow.PowerRename:
|
||||
return "PowerRename";
|
||||
case SettingsWindow.FileExplorer:
|
||||
@@ -94,18 +67,18 @@ namespace Common.UI
|
||||
return "MeasureTool";
|
||||
case SettingsWindow.PowerOCR:
|
||||
return "PowerOcr";
|
||||
case SettingsWindow.Workspaces:
|
||||
return "Workspaces";
|
||||
case SettingsWindow.RegistryPreview:
|
||||
return "RegistryPreview";
|
||||
case SettingsWindow.CropAndLock:
|
||||
return "CropAndLock";
|
||||
case SettingsWindow.EnvironmentVariables:
|
||||
return "EnvironmentVariables";
|
||||
case SettingsWindow.Dashboard:
|
||||
return "Dashboard";
|
||||
case SettingsWindow.AdvancedPaste:
|
||||
return "AdvancedPaste";
|
||||
case SettingsWindow.NewPlus:
|
||||
return "NewPlus";
|
||||
case SettingsWindow.Workspaces:
|
||||
return "Workspaces";
|
||||
case SettingsWindow.CmdPal:
|
||||
return "CmdPal";
|
||||
case SettingsWindow.ZoomIt:
|
||||
|
||||
@@ -21,7 +21,7 @@ public static partial class Kernel32
|
||||
out int pBytesReturned,
|
||||
IntPtr lpOverlapped);
|
||||
|
||||
[LibraryImport("kernel32.dll", SetLastError = true, StringMarshalling = StringMarshalling.Utf16, EntryPoint = "CreateFileW")]
|
||||
[LibraryImport("kernel32.dll", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
|
||||
public static partial int CreateFile(
|
||||
string lpFileName,
|
||||
FileAccessType dwDesiredAccess,
|
||||
|
||||
@@ -31,7 +31,6 @@ namespace Microsoft.PowerToys.UITest
|
||||
Hosts,
|
||||
Runner,
|
||||
Workspaces,
|
||||
PowerRename,
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -77,7 +76,7 @@ namespace Microsoft.PowerToys.UITest
|
||||
|
||||
internal class ModuleConfigData
|
||||
{
|
||||
private Dictionary<PowerToysModule, ModuleInfo> ModuleInfo { get; }
|
||||
private Dictionary<PowerToysModule, string> ModulePath { get; }
|
||||
|
||||
// Singleton instance of ModuleConfigData.
|
||||
private static readonly Lazy<ModuleConfigData> SingletonInstance = new Lazy<ModuleConfigData>(() => new ModuleConfigData());
|
||||
@@ -86,74 +85,35 @@ namespace Microsoft.PowerToys.UITest
|
||||
|
||||
public const string WindowsApplicationDriverUrl = "http://127.0.0.1:4723";
|
||||
|
||||
private bool UseInstallerForTest { get; }
|
||||
public Dictionary<PowerToysModule, string> ModuleWindowName { get; }
|
||||
|
||||
private ModuleConfigData()
|
||||
{
|
||||
// Check if we should use installer paths from environment variable
|
||||
string? useInstallerForTestEnv =
|
||||
Environment.GetEnvironmentVariable("useInstallerForTest") ?? Environment.GetEnvironmentVariable("USEINSTALLERFORTEST");
|
||||
UseInstallerForTest = !string.IsNullOrEmpty(useInstallerForTestEnv) && bool.TryParse(useInstallerForTestEnv, out bool result) && result;
|
||||
|
||||
// Module information including executable name, window name, and optional subdirectory
|
||||
ModuleInfo = new Dictionary<PowerToysModule, ModuleInfo>
|
||||
// The exe window name for each module.
|
||||
ModuleWindowName = new Dictionary<PowerToysModule, string>
|
||||
{
|
||||
[PowerToysModule.PowerToysSettings] = new ModuleInfo("PowerToys.Settings.exe", "PowerToys Settings", "WinUI3Apps"),
|
||||
[PowerToysModule.FancyZone] = new ModuleInfo("PowerToys.FancyZonesEditor.exe", "FancyZones Layout"),
|
||||
[PowerToysModule.Hosts] = new ModuleInfo("PowerToys.Hosts.exe", "Hosts File Editor", "WinUI3Apps"),
|
||||
[PowerToysModule.Runner] = new ModuleInfo("PowerToys.exe", "PowerToys"),
|
||||
[PowerToysModule.Workspaces] = new ModuleInfo("PowerToys.WorkspacesEditor.exe", "Workspaces Editor"),
|
||||
[PowerToysModule.PowerRename] = new ModuleInfo("PowerToys.PowerRename.exe", "PowerRename", "WinUI3Apps"),
|
||||
[PowerToysModule.PowerToysSettings] = "PowerToys Settings",
|
||||
[PowerToysModule.FancyZone] = "FancyZones Layout",
|
||||
[PowerToysModule.Hosts] = "Hosts File Editor",
|
||||
[PowerToysModule.Runner] = "PowerToys",
|
||||
[PowerToysModule.Workspaces] = "Workspaces Editor",
|
||||
};
|
||||
|
||||
// Exe start path for the module if it exists.
|
||||
ModulePath = new Dictionary<PowerToysModule, string>
|
||||
{
|
||||
[PowerToysModule.PowerToysSettings] = @"\..\..\..\WinUI3Apps\PowerToys.Settings.exe",
|
||||
[PowerToysModule.FancyZone] = @"\..\..\..\PowerToys.FancyZonesEditor.exe",
|
||||
[PowerToysModule.Hosts] = @"\..\..\..\WinUI3Apps\PowerToys.Hosts.exe",
|
||||
[PowerToysModule.Runner] = @"\..\..\..\PowerToys.exe",
|
||||
[PowerToysModule.Workspaces] = @"\..\..\..\PowerToys.WorkspacesEditor.exe",
|
||||
};
|
||||
}
|
||||
|
||||
private string GetPowerToysInstallPath()
|
||||
{
|
||||
// Try common installation paths
|
||||
string[] possiblePaths =
|
||||
{
|
||||
@"C:\Program Files\PowerToys",
|
||||
@"C:\Program Files (x86)\PowerToys",
|
||||
Environment.ExpandEnvironmentVariables(@"%LocalAppData%\PowerToys"),
|
||||
Environment.ExpandEnvironmentVariables(@"%ProgramFiles%\PowerToys"),
|
||||
};
|
||||
|
||||
foreach (string path in possiblePaths)
|
||||
{
|
||||
if (Directory.Exists(path) && File.Exists(Path.Combine(path, "PowerToys.exe")))
|
||||
{
|
||||
return path;
|
||||
}
|
||||
}
|
||||
|
||||
// Fallback to Program Files if not found
|
||||
return @"C:\Program Files\PowerToys";
|
||||
}
|
||||
|
||||
public string GetModulePath(PowerToysModule scope)
|
||||
{
|
||||
var moduleInfo = ModuleInfo[scope];
|
||||
|
||||
if (UseInstallerForTest)
|
||||
{
|
||||
string powerToysInstallPath = GetPowerToysInstallPath();
|
||||
string installedPath = moduleInfo.GetInstalledPath(powerToysInstallPath);
|
||||
|
||||
if (File.Exists(installedPath))
|
||||
{
|
||||
return installedPath;
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine($"Warning: Installed module not found at {installedPath}, using development path");
|
||||
}
|
||||
}
|
||||
|
||||
return moduleInfo.GetDevelopmentPath();
|
||||
}
|
||||
public string GetModulePath(PowerToysModule scope) => ModulePath[scope];
|
||||
|
||||
public string GetWindowsApplicationDriverUrl() => WindowsApplicationDriverUrl;
|
||||
|
||||
public string GetModuleWindowName(PowerToysModule scope) => ModuleInfo[scope].WindowName;
|
||||
public string GetModuleWindowName(PowerToysModule scope) => ModuleWindowName[scope];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,54 +0,0 @@
|
||||
// Copyright (c) Microsoft Corporation
|
||||
// The Microsoft Corporation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Microsoft.PowerToys.UITest
|
||||
{
|
||||
internal class ModuleInfo
|
||||
{
|
||||
public string ExecutableName { get; }
|
||||
|
||||
public string? SubDirectory { get; }
|
||||
|
||||
public string WindowName { get; }
|
||||
|
||||
public ModuleInfo(string executableName, string windowName, string? subDirectory = null)
|
||||
{
|
||||
ExecutableName = executableName;
|
||||
WindowName = windowName;
|
||||
SubDirectory = subDirectory;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the relative development path for this module
|
||||
/// </summary>
|
||||
public string GetDevelopmentPath()
|
||||
{
|
||||
if (string.IsNullOrEmpty(SubDirectory))
|
||||
{
|
||||
return $@"\..\..\..\{ExecutableName}";
|
||||
}
|
||||
|
||||
return $@"\..\..\..\{SubDirectory}\{ExecutableName}";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the installed path for this module based on the PowerToys install directory
|
||||
/// </summary>
|
||||
public string GetInstalledPath(string powerToysInstallPath)
|
||||
{
|
||||
if (string.IsNullOrEmpty(SubDirectory))
|
||||
{
|
||||
return Path.Combine(powerToysInstallPath, ExecutableName);
|
||||
}
|
||||
|
||||
return Path.Combine(powerToysInstallPath, SubDirectory, ExecutableName);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -129,7 +129,7 @@ namespace Microsoft.PowerToys.UITest
|
||||
/// <typeparam name="T">The class of the element, should be Element or its derived class.</typeparam>
|
||||
/// <param name="by">The name of the element.</param>
|
||||
/// <param name="timeoutMS">The timeout in milliseconds (default is 5000).</param>
|
||||
/// <returns>True if only has one element; otherwise, false.</returns>
|
||||
/// <returns>True if only has one element, otherwise false.</returns>
|
||||
public bool HasOne<T>(By by, int timeoutMS = 5000, bool global = false)
|
||||
where T : Element, new()
|
||||
{
|
||||
@@ -141,7 +141,7 @@ namespace Microsoft.PowerToys.UITest
|
||||
/// </summary>
|
||||
/// <param name="by">The name of the element.</param>
|
||||
/// <param name="timeoutMS">The timeout in milliseconds (default is 5000).</param>
|
||||
/// <returns>True if only has one element; otherwise, false.</returns>
|
||||
/// <returns>True if only has one element, otherwise false.</returns>
|
||||
public bool HasOne(By by, int timeoutMS = 5000, bool global = false)
|
||||
{
|
||||
return this.HasOne<Element>(by, timeoutMS, global);
|
||||
@@ -153,7 +153,7 @@ namespace Microsoft.PowerToys.UITest
|
||||
/// <typeparam name="T">The class of the element, should be Element or its derived class.</typeparam>
|
||||
/// <param name="name">The name of the element.</param>
|
||||
/// <param name="timeoutMS">The timeout in milliseconds (default is 5000).</param>
|
||||
/// <returns>True if only has one element; otherwise, false.</returns>
|
||||
/// <returns>True if only has one element, otherwise false.</returns>
|
||||
public bool HasOne<T>(string name, int timeoutMS = 5000, bool global = false)
|
||||
where T : Element, new()
|
||||
{
|
||||
@@ -165,7 +165,7 @@ namespace Microsoft.PowerToys.UITest
|
||||
/// </summary>
|
||||
/// <param name="name">The name of the element.</param>
|
||||
/// <param name="timeoutMS">The timeout in milliseconds (default is 5000).</param>
|
||||
/// <returns>True if only has one element; otherwise, false.</returns>
|
||||
/// <returns>True if only has one element, otherwise false.</returns>
|
||||
public bool HasOne(string name, int timeoutMS = 5000, bool global = false)
|
||||
{
|
||||
return this.HasOne<Element>(By.Name(name), timeoutMS, global);
|
||||
@@ -177,7 +177,7 @@ namespace Microsoft.PowerToys.UITest
|
||||
/// <typeparam name="T">The class of the element, should be Element or its derived class.</typeparam>
|
||||
/// <param name="by">The selector to find the element.</param>
|
||||
/// <param name="timeoutMS">The timeout in milliseconds (default is 5000).</param>
|
||||
/// <returns>True if has one or more element; otherwise, false.</returns>
|
||||
/// <returns>True if has one or more element, otherwise false.</returns>
|
||||
public bool Has<T>(By by, int timeoutMS = 5000, bool global = false)
|
||||
where T : Element, new()
|
||||
{
|
||||
@@ -189,7 +189,7 @@ namespace Microsoft.PowerToys.UITest
|
||||
/// </summary>
|
||||
/// <param name="by">The selector to find the element.</param>
|
||||
/// <param name="timeoutMS">The timeout in milliseconds (default is 5000).</param>
|
||||
/// <returns>True if has one or more element; otherwise, false.</returns>
|
||||
/// <returns>True if has one or more element, otherwise false.</returns>
|
||||
public bool Has(By by, int timeoutMS = 5000, bool global = false)
|
||||
{
|
||||
return this.Has<Element>(by, timeoutMS, global);
|
||||
@@ -201,7 +201,7 @@ namespace Microsoft.PowerToys.UITest
|
||||
/// <typeparam name="T">The class of the element, should be Element or its derived class.</typeparam>
|
||||
/// <param name="name">The name of the element.</param>
|
||||
/// <param name="timeoutMS">The timeout in milliseconds (default is 5000).</param>
|
||||
/// <returns>True if has one or more element; otherwise, false.</returns>
|
||||
/// <returns>True if has one or more element, otherwise false.</returns>
|
||||
public bool Has<T>(string name, int timeoutMS = 5000, bool global = false)
|
||||
where T : Element, new()
|
||||
{
|
||||
@@ -213,7 +213,7 @@ namespace Microsoft.PowerToys.UITest
|
||||
/// </summary>
|
||||
/// <param name="name">The name of the element.</param>
|
||||
/// <param name="timeoutMS">The timeout in milliseconds (default is 5000).</param>
|
||||
/// <returns>True if has one or more element; otherwise, false.</returns>
|
||||
/// <returns>True if has one or more element, otherwise false.</returns>
|
||||
public bool Has(string name, int timeoutMS = 5000, bool global = false)
|
||||
{
|
||||
return this.Has<Element>(name, timeoutMS, global);
|
||||
|
||||
@@ -5,13 +5,10 @@
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
using OpenQA.Selenium.Appium;
|
||||
using OpenQA.Selenium.Appium.Windows;
|
||||
using static Microsoft.PowerToys.UITest.WindowHelper;
|
||||
|
||||
namespace Microsoft.PowerToys.UITest
|
||||
{
|
||||
@@ -35,22 +32,27 @@ namespace Microsoft.PowerToys.UITest
|
||||
private Process? runner;
|
||||
|
||||
private PowerToysModule scope;
|
||||
private string[]? commandLineArgs;
|
||||
|
||||
private bool UseInstallerForTest { get; }
|
||||
|
||||
[UnconditionalSuppressMessage("SingleFile", "IL3000:Avoid accessing Assembly file path when publishing as a single file", Justification = "<Pending>")]
|
||||
public SessionHelper(PowerToysModule scope, string[]? commandLineArgs = null)
|
||||
public SessionHelper(PowerToysModule scope)
|
||||
{
|
||||
this.scope = scope;
|
||||
this.commandLineArgs = commandLineArgs;
|
||||
this.sessionPath = ModuleConfigData.Instance.GetModulePath(scope);
|
||||
string? useInstallerForTestEnv =
|
||||
Environment.GetEnvironmentVariable("useInstallerForTest") ?? Environment.GetEnvironmentVariable("USEINSTALLERFORTEST");
|
||||
UseInstallerForTest = !string.IsNullOrEmpty(useInstallerForTestEnv) && bool.TryParse(useInstallerForTestEnv, out bool result) && result;
|
||||
this.locationPath = UseInstallerForTest ? string.Empty : Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
|
||||
this.locationPath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
|
||||
|
||||
CheckWinAppDriverAndRoot();
|
||||
|
||||
var runnerProcessInfo = new ProcessStartInfo
|
||||
{
|
||||
FileName = locationPath + this.runnerPath,
|
||||
Verb = "runas",
|
||||
};
|
||||
|
||||
if (scope == PowerToysModule.PowerToysSettings)
|
||||
{
|
||||
this.ExitExe(runnerProcessInfo.FileName);
|
||||
this.runner = Process.Start(runnerProcessInfo);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -74,8 +76,7 @@ namespace Microsoft.PowerToys.UITest
|
||||
public SessionHelper Init()
|
||||
{
|
||||
this.ExitExe(this.locationPath + this.sessionPath);
|
||||
|
||||
this.StartExe(this.locationPath + this.sessionPath, this.commandLineArgs);
|
||||
this.StartExe(this.locationPath + this.sessionPath);
|
||||
|
||||
Assert.IsNotNull(this.Driver, $"Failed to initialize the test environment. Driver is null.");
|
||||
|
||||
@@ -88,6 +89,19 @@ namespace Microsoft.PowerToys.UITest
|
||||
public void Cleanup()
|
||||
{
|
||||
ExitScopeExe();
|
||||
try
|
||||
{
|
||||
if (this.scope == PowerToysModule.PowerToysSettings)
|
||||
{
|
||||
runner?.Kill();
|
||||
runner?.WaitForExit(); // Optional: Wait for the process to exit
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
// Handle exceptions if needed
|
||||
Debug.WriteLine($"Exception during Cleanup: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -118,81 +132,17 @@ namespace Microsoft.PowerToys.UITest
|
||||
/// Starts a new exe and takes control of it.
|
||||
/// </summary>
|
||||
/// <param name="appPath">The path to the application executable.</param>
|
||||
/// <param name="args">Optional command line arguments to pass to the application.</param>
|
||||
public void StartExe(string appPath, string[]? args = null)
|
||||
public void StartExe(string appPath)
|
||||
{
|
||||
var opts = new AppiumOptions();
|
||||
opts.AddAdditionalCapability("app", appPath);
|
||||
|
||||
if (args != null && args.Length > 0)
|
||||
{
|
||||
// Build command line arguments string
|
||||
string argsString = string.Join(" ", args.Select(arg =>
|
||||
{
|
||||
// Quote arguments that contain spaces
|
||||
if (arg.Contains(' '))
|
||||
{
|
||||
return $"\"{arg}\"";
|
||||
}
|
||||
|
||||
return arg;
|
||||
}));
|
||||
|
||||
opts.AddAdditionalCapability("appArguments", argsString);
|
||||
}
|
||||
|
||||
this.Driver = NewWindowsDriver(opts);
|
||||
}
|
||||
|
||||
private void TryLaunchPowerToysSettings(AppiumOptions opts)
|
||||
{
|
||||
CheckWinAppDriverAndRoot();
|
||||
|
||||
var runnerProcessInfo = new ProcessStartInfo
|
||||
{
|
||||
FileName = locationPath + this.runnerPath,
|
||||
Verb = "runas",
|
||||
Arguments = "--open-settings",
|
||||
};
|
||||
|
||||
this.ExitExe(runnerProcessInfo.FileName);
|
||||
this.runner = Process.Start(runnerProcessInfo);
|
||||
Thread.Sleep(5000);
|
||||
|
||||
if (root != null)
|
||||
{
|
||||
const int maxRetries = 5;
|
||||
const int delayMs = 5000;
|
||||
var windowName = "PowerToys Settings";
|
||||
|
||||
for (int attempt = 1; attempt <= maxRetries; attempt++)
|
||||
{
|
||||
var settingsWindow = ApiHelper.FindDesktopWindowHandler(
|
||||
new[] { windowName, AdministratorPrefix + windowName });
|
||||
|
||||
if (settingsWindow.Count > 0)
|
||||
{
|
||||
var hexHwnd = settingsWindow[0].HWnd.ToString("x");
|
||||
opts.AddAdditionalCapability("appTopLevelWindow", hexHwnd);
|
||||
return;
|
||||
}
|
||||
|
||||
if (attempt < maxRetries)
|
||||
{
|
||||
Thread.Sleep(delayMs);
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new TimeoutException("Failed to find PowerToys Settings window after multiple attempts.");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Starts a new exe and takes control of it.
|
||||
/// </summary>
|
||||
/// <param name="info">The AppiumOptions for the application.</param>
|
||||
/// <param name="info">The path to the application executable.</param>
|
||||
private WindowsDriver<WindowsElement> NewWindowsDriver(AppiumOptions info)
|
||||
{
|
||||
// Create driver with retry
|
||||
@@ -226,19 +176,6 @@ namespace Microsoft.PowerToys.UITest
|
||||
public void ExitScopeExe()
|
||||
{
|
||||
ExitExe(sessionPath);
|
||||
try
|
||||
{
|
||||
if (this.scope == PowerToysModule.PowerToysSettings)
|
||||
{
|
||||
runner?.Kill();
|
||||
runner?.WaitForExit(); // Optional: Wait for the process to exit
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
// Handle exceptions if needed
|
||||
Debug.WriteLine($"Exception during Cleanup: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -247,7 +184,7 @@ namespace Microsoft.PowerToys.UITest
|
||||
public void RestartScopeExe()
|
||||
{
|
||||
ExitScopeExe();
|
||||
StartExe(locationPath + sessionPath, this.commandLineArgs);
|
||||
StartExe(locationPath + sessionPath);
|
||||
}
|
||||
|
||||
public WindowsDriver<WindowsElement> GetRoot()
|
||||
|
||||
@@ -4,9 +4,18 @@
|
||||
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Diagnostics;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Reflection;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Xml.Linq;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
using OpenQA.Selenium;
|
||||
using OpenQA.Selenium.Appium;
|
||||
using OpenQA.Selenium.Appium.Windows;
|
||||
using Windows.Devices.Display.Core;
|
||||
using Windows.Foundation.Metadata;
|
||||
using static Microsoft.PowerToys.UITest.UITestBase.NativeMethods;
|
||||
using static Microsoft.PowerToys.UITest.WindowHelper;
|
||||
|
||||
namespace Microsoft.PowerToys.UITest
|
||||
{
|
||||
@@ -26,12 +35,11 @@ namespace Microsoft.PowerToys.UITest
|
||||
|
||||
private readonly PowerToysModule scope;
|
||||
private readonly WindowSize size;
|
||||
private readonly string[]? commandLineArgs;
|
||||
private SessionHelper? sessionHelper;
|
||||
private System.Threading.Timer? screenshotTimer;
|
||||
private string? screenshotDirectory;
|
||||
|
||||
public UITestBase(PowerToysModule scope = PowerToysModule.PowerToysSettings, WindowSize size = WindowSize.UnSpecified, string[]? commandLineArgs = null)
|
||||
public UITestBase(PowerToysModule scope = PowerToysModule.PowerToysSettings, WindowSize size = WindowSize.UnSpecified)
|
||||
{
|
||||
this.IsInPipeline = !string.IsNullOrEmpty(Environment.GetEnvironmentVariable("platform"));
|
||||
Console.WriteLine($"Running tests on platform: {Environment.GetEnvironmentVariable("platform")}");
|
||||
@@ -46,7 +54,6 @@ namespace Microsoft.PowerToys.UITest
|
||||
|
||||
this.scope = scope;
|
||||
this.size = size;
|
||||
this.commandLineArgs = commandLineArgs;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -68,8 +75,18 @@ namespace Microsoft.PowerToys.UITest
|
||||
System.Windows.Forms.SendKeys.SendWait("{ESC}");
|
||||
}
|
||||
|
||||
this.sessionHelper = new SessionHelper(scope, commandLineArgs).Init();
|
||||
this.sessionHelper = new SessionHelper(scope).Init();
|
||||
this.Session = new Session(this.sessionHelper.GetRoot(), this.sessionHelper.GetDriver(), scope, size);
|
||||
|
||||
if (this.scope == PowerToysModule.PowerToysSettings)
|
||||
{
|
||||
// close Debug warning dialog if any
|
||||
// Such debug warning dialog seems only appear in PowerToys Settings
|
||||
if (this.FindAll("DEBUG").Count > 0)
|
||||
{
|
||||
this.Find("DEBUG").Find<Button>("Close").Click();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -156,7 +173,7 @@ namespace Microsoft.PowerToys.UITest
|
||||
/// <typeparam name="T">The class of the element, should be Element or its derived class.</typeparam>
|
||||
/// <param name="by">The name of the element.</param>
|
||||
/// <param name="timeoutMS">The timeout in milliseconds (default is 5000).</param>
|
||||
/// <returns>True if only has one element; otherwise, false.</returns>
|
||||
/// <returns>True if only has one element, otherwise false.</returns>
|
||||
public bool HasOne<T>(By by, int timeoutMS = 5000, bool global = false)
|
||||
where T : Element, new()
|
||||
{
|
||||
@@ -168,7 +185,7 @@ namespace Microsoft.PowerToys.UITest
|
||||
/// </summary>
|
||||
/// <param name="by">The name of the element.</param>
|
||||
/// <param name="timeoutMS">The timeout in milliseconds (default is 5000).</param>
|
||||
/// <returns>True if only has one element; otherwise, false.</returns>
|
||||
/// <returns>True if only has one element, otherwise false.</returns>
|
||||
public bool HasOne(By by, int timeoutMS = 5000, bool global = false)
|
||||
{
|
||||
return this.Session.HasOne<Element>(by, timeoutMS, global);
|
||||
@@ -180,7 +197,7 @@ namespace Microsoft.PowerToys.UITest
|
||||
/// <typeparam name="T">The class of the element, should be Element or its derived class.</typeparam>
|
||||
/// <param name="name">The name of the element.</param>
|
||||
/// <param name="timeoutMS">The timeout in milliseconds (default is 5000).</param>
|
||||
/// <returns>True if only has one element; otherwise, false.</returns>
|
||||
/// <returns>True if only has one element, otherwise false.</returns>
|
||||
public bool HasOne<T>(string name, int timeoutMS = 5000, bool global = false)
|
||||
where T : Element, new()
|
||||
{
|
||||
@@ -192,7 +209,7 @@ namespace Microsoft.PowerToys.UITest
|
||||
/// </summary>
|
||||
/// <param name="name">The name of the element.</param>
|
||||
/// <param name="timeoutMS">The timeout in milliseconds (default is 5000).</param>
|
||||
/// <returns>True if only has one element; otherwise, false.</returns>
|
||||
/// <returns>True if only has one element, otherwise false.</returns>
|
||||
public bool HasOne(string name, int timeoutMS = 5000, bool global = false)
|
||||
{
|
||||
return this.Session.HasOne<Element>(name, timeoutMS, global);
|
||||
@@ -204,7 +221,7 @@ namespace Microsoft.PowerToys.UITest
|
||||
/// <typeparam name="T">The class of the element, should be Element or its derived class.</typeparam>
|
||||
/// <param name="by">The selector to find the element.</param>
|
||||
/// <param name="timeoutMS">The timeout in milliseconds (default is 5000).</param>
|
||||
/// <returns>True if has one or more element; otherwise, false.</returns>
|
||||
/// <returns>True if has one or more element, otherwise false.</returns>
|
||||
public bool Has<T>(By by, int timeoutMS = 5000, bool global = false)
|
||||
where T : Element, new()
|
||||
{
|
||||
@@ -216,7 +233,7 @@ namespace Microsoft.PowerToys.UITest
|
||||
/// </summary>
|
||||
/// <param name="by">The selector to find the element.</param>
|
||||
/// <param name="timeoutMS">The timeout in milliseconds (default is 5000).</param>
|
||||
/// <returns>True if has one or more element; otherwise, false.</returns>
|
||||
/// <returns>True if has one or more element, otherwise false.</returns>
|
||||
public bool Has(By by, int timeoutMS = 5000, bool global = false)
|
||||
{
|
||||
return this.Session.Has<Element>(by, timeoutMS, global);
|
||||
@@ -228,7 +245,7 @@ namespace Microsoft.PowerToys.UITest
|
||||
/// <typeparam name="T">The class of the element, should be Element or its derived class.</typeparam>
|
||||
/// <param name="name">The name of the element.</param>
|
||||
/// <param name="timeoutMS">The timeout in milliseconds (default is 5000).</param>
|
||||
/// <returns>True if has one or more element; otherwise, false.</returns>
|
||||
/// <returns>True if has one or more element, otherwise false.</returns>
|
||||
public bool Has<T>(string name, int timeoutMS = 5000, bool global = false)
|
||||
where T : Element, new()
|
||||
{
|
||||
@@ -240,7 +257,7 @@ namespace Microsoft.PowerToys.UITest
|
||||
/// </summary>
|
||||
/// <param name="name">The name of the element.</param>
|
||||
/// <param name="timeoutMS">The timeout in milliseconds (default is 5000).</param>
|
||||
/// <returns>True if has one or more element; otherwise, false.</returns>
|
||||
/// <returns>True if has one or more element, otherwise false.</returns>
|
||||
public bool Has(string name, int timeoutMS = 5000, bool global = false)
|
||||
{
|
||||
return this.Session.Has<Element>(name, timeoutMS, global);
|
||||
|
||||
@@ -24,7 +24,7 @@ namespace Microsoft.PowerToys.UITest
|
||||
/// <param name="c1">base color</param>
|
||||
/// <param name="c2">test color</param>
|
||||
/// <param name="fuzz">fuzz factor, default is 10</param>
|
||||
/// <returns>true if same; otherwise, is false</returns>
|
||||
/// <returns>true if same, otherwise is false</returns>
|
||||
public static bool PixIsSame(Color c1, Color c2, int fuzz = 10)
|
||||
{
|
||||
return Math.Abs(c1.A - c2.A) <= fuzz && Math.Abs(c1.R - c2.R) <= fuzz && Math.Abs(c1.G - c2.G) <= fuzz && Math.Abs(c1.B - c2.B) <= fuzz;
|
||||
|
||||
@@ -11,7 +11,7 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace Microsoft.PowerToys.UITest
|
||||
{
|
||||
public static class WindowHelper
|
||||
internal static class WindowHelper
|
||||
{
|
||||
internal const string AdministratorPrefix = "Administrator: ";
|
||||
|
||||
|
||||
@@ -83,7 +83,7 @@ namespace winrt::PowerToys::Interop::implementation
|
||||
ev.key = reinterpret_cast<KBDLLHOOKSTRUCT*>(lParam)->vkCode;
|
||||
ev.dwExtraInfo = reinterpret_cast<KBDLLHOOKSTRUCT*>(lParam)->dwExtraInfo;
|
||||
|
||||
// Ignore the keyboard hook if the FilterKeyboardEvent returns false.
|
||||
// Ignore the keyboard hook if the FilterkeyboardEvent returns false.
|
||||
if ((s_instance->filterKeyboardEvent != nullptr && !s_instance->filterKeyboardEvent(ev)))
|
||||
{
|
||||
continue;
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace winrt::PowerToys::Interop::implementation
|
||||
{
|
||||
return _map->GetKeyFromName(std::wstring(name));
|
||||
}
|
||||
void LayoutMapManaged::UpdateLayout()
|
||||
void LayoutMapManaged::Updatelayout()
|
||||
{
|
||||
_map->UpdateLayout();
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ namespace winrt::PowerToys::Interop::implementation
|
||||
|
||||
hstring GetKeyName(uint32_t key);
|
||||
uint32_t GetKeyValue(hstring const& name);
|
||||
void UpdateLayout();
|
||||
void Updatelayout();
|
||||
|
||||
private:
|
||||
std::unique_ptr<LayoutMap> _map = std::make_unique<LayoutMap>();
|
||||
|
||||
@@ -6,7 +6,7 @@ namespace PowerToys
|
||||
LayoutMapManaged();
|
||||
String GetKeyName(UInt32 key);
|
||||
UInt32 GetKeyValue(String name);
|
||||
void UpdateLayout();
|
||||
void Updatelayout();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -117,7 +117,7 @@ void LayoutMap::LayoutMapImpl::UpdateLayout()
|
||||
}
|
||||
}
|
||||
|
||||
// Override special key names like Shift, Ctrl, etc. because they don't have unicode mappings and key names like Enter, Space as they appear as "\r", " "
|
||||
// Override special key names like Shift, Ctrl etc because they don't have unicode mappings and key names like Enter, Space as they appear as "\r", " "
|
||||
// To do: localization
|
||||
keyboardLayoutMap[VK_CANCEL] = L"Break";
|
||||
keyboardLayoutMap[VK_BACK] = L"Backspace";
|
||||
|
||||
@@ -190,7 +190,7 @@ void notifications::show_toast_with_activations(std::wstring message,
|
||||
// We must set toast's title and contents immediately, because some of the toasts we send could be snoozed.
|
||||
// Windows instantiates the snoozed toast from scratch before showing it again, so all bindings that were set
|
||||
// using NotificationData would be empty.
|
||||
// Add the launch attribute if launch_uri is provided; otherwise, omit it
|
||||
// Add the launch attribute if launch_uri is provided, otherwise omit it
|
||||
toast_xml += LR"(<?xml version="1.0"?>)";
|
||||
if (!launch_uri.empty())
|
||||
{
|
||||
|
||||
@@ -207,7 +207,7 @@ namespace powertoys_gpo
|
||||
|
||||
inline std::optional<std::wstring> getPolicyListValue(const std::wstring& registry_list_path, const std::wstring& registry_list_value_name)
|
||||
{
|
||||
// This function returns the value of an entry of a policy list. The user scope is only checked, if the list is not enabled for the machine to not mix the lists.
|
||||
// This function returns the value of an entry of an policy list. The user scope is only checked, if the list is not enabled for the machine to not mix the lists.
|
||||
|
||||
HKEY key{};
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ namespace AdvancedPaste.UnitTests.ServicesTests;
|
||||
/// Tests that write batch AI outputs against a list of inputs. Connects to OpenAI and uses the full AdvancedPaste action catalog for Semantic Kernel.
|
||||
/// If queries produce errors, the error message is written to the output file. If queries produce text-file output, their contents are included as though they were text output.
|
||||
/// To run this test-suite, first:
|
||||
/// 1. Set up an OpenAI API key using AdvancedPaste Settings.
|
||||
/// 1. Setup an OpenAI API key using AdvancedPaste Settings.
|
||||
/// 2. Comment out the [Ignore] attribute above.
|
||||
/// 3. Ensure the %USERPROFILE% folder contains the required input files (paths are below).
|
||||
/// These tests are idempotent and resumable, allowing for partial runs and restarts. It's ok to use existing output files as input files - output-related fields will simply be ignored.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<Application
|
||||
x:Class="AdvancedPaste.App"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<XamlCompositionBrushBase
|
||||
<XamlCompositionBrushBase
|
||||
x:Class="AdvancedPaste.Controls.AnimatedBorderBrush"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<ResourceDictionary
|
||||
<ResourceDictionary
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:animations="using:CommunityToolkit.WinUI.Animations"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<Page
|
||||
<Page
|
||||
x:Class="AdvancedPaste.Pages.MainPage"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<ResourceDictionary
|
||||
<ResourceDictionary
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="using:AdvancedPaste">
|
||||
|
||||
@@ -17,7 +17,7 @@ public sealed class PasteActionModeratedException : PasteActionException
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Non-localized error description for logs, reports, telemetry, etc.
|
||||
/// Non-localized error description for logs, reports, telemetry etc.
|
||||
/// </summary>
|
||||
public const string ErrorDescription = "Paste operation moderated";
|
||||
}
|
||||
|
||||
@@ -60,7 +60,7 @@ OverlayWindow::OverlayWindow(
|
||||
m_crosshairCursor.reset(winrt::check_pointer(LoadCursorW(nullptr, IDC_CROSS)));
|
||||
m_cursorType = CursorType::Standard;
|
||||
|
||||
// Set up the visual tree
|
||||
// Setup the visual tree
|
||||
m_compositor = compositor;
|
||||
m_target = CreateWindowTarget(m_compositor);
|
||||
m_rootVisual = m_compositor.CreateContainerVisual();
|
||||
|
||||
@@ -147,7 +147,7 @@ void ThumbnailCropAndLockWindow::CropAndLock(HWND windowToCrop, RECT cropRect)
|
||||
auto adjustedHeight = windowRect.bottom - windowRect.top;
|
||||
winrt::check_bool(SetWindowPos(m_window, HWND_TOPMOST, 0, 0, adjustedWidth, adjustedHeight, SWP_NOMOVE | SWP_SHOWWINDOW));
|
||||
|
||||
// Set up the thumbnail
|
||||
// Setup the thumbnail
|
||||
winrt::check_hresult(DwmRegisterThumbnail(m_window, m_currentTarget, m_thumbnail.addressof()));
|
||||
|
||||
clientRect = {};
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace constants::nonlocalizable
|
||||
// String key used by PowerToys
|
||||
constexpr WCHAR PowerToyKey[] = L"File Locksmith";
|
||||
|
||||
// Nonlocalized name of this PowerToy, for logs, etc.
|
||||
// Nonlocalized name of this PowerToy, for logs, etc
|
||||
constexpr WCHAR PowerToyName[] = L"File Locksmith";
|
||||
|
||||
// JSON key used to store whether the module is enabled
|
||||
|
||||
@@ -141,7 +141,7 @@ namespace PowerToys.FileLocksmithUI.ViewModels
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logger.LogError($"Couldn't add a waiter to wait for a process to exit. PID = {process.pid} and Name = {process.name}.", ex);
|
||||
Processes.Remove(process); // If we couldn't get a handle to the process or it has exited in the meanwhile, don't show it.
|
||||
Processes.Remove(process); // If we couldn't get an handle to the process or it has exited in the meanwhile, don't show it.
|
||||
}
|
||||
}
|
||||
|
||||
@@ -162,8 +162,8 @@ namespace PowerToys.FileLocksmithUI.ViewModels
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logger.LogError($"Couldn't get a handle to kill process {selectedProcess.name} with PID {selectedProcess.pid}. Likely has been killed already.", ex);
|
||||
Processes.Remove(selectedProcess); // If we couldn't get a handle to the process, remove it from the list, since it's likely been killed already.
|
||||
Logger.LogError($"Couldn't get an handle to kill process {selectedProcess.name} with PID {selectedProcess.pid}. Likely has been killed already.", ex);
|
||||
Processes.Remove(selectedProcess); // If we couldn't get an handle to the process, remove it from the list, since it's likely been killed already.
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
<RunVSTest>false</RunVSTest>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<OutputPath>..\..\..\..\$(Platform)\$(Configuration)\tests\Hosts.UITests\</OutputPath>
|
||||
<OutputPath>$(SolutionDir)$(Platform)\$(Configuration)\tests\Hosts.UITests\</OutputPath>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="Baseline\HostModuleTests_TestAddingEntry_arm64.png" />
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<Application
|
||||
x:Class="Hosts.App"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
|
||||
@@ -427,7 +427,7 @@ void SuperSonar<D>::DetectShake()
|
||||
return;
|
||||
}
|
||||
|
||||
// Size of the rectangle that the pointer moved in.
|
||||
// Size of the rectangle the pointer moved in.
|
||||
double rectangleWidth = static_cast<double>(maxX) - minX;
|
||||
double rectangleHeight = static_cast<double>(maxY) - minY;
|
||||
|
||||
@@ -521,7 +521,7 @@ void SuperSonar<D>::StartSonar()
|
||||
Logger::info("Focusing the sonar on the mouse cursor.");
|
||||
Trace::MousePointerFocused();
|
||||
// Cover the entire virtual screen.
|
||||
// HACK: Draw with 1 pixel off. Otherwise, Windows glitches the task bar transparency when a transparent window fill the whole screen.
|
||||
// HACK: Draw with 1 pixel off. Otherwise Windows glitches the task bar transparency when a transparent window fill the whole screen.
|
||||
SetWindowPos(m_hwnd, HWND_TOPMOST, GetSystemMetrics(SM_XVIRTUALSCREEN) + 1, GetSystemMetrics(SM_YVIRTUALSCREEN) + 1, GetSystemMetrics(SM_CXVIRTUALSCREEN) - 2, GetSystemMetrics(SM_CYVIRTUALSCREEN) - 2, 0);
|
||||
m_sonarPos = ptNowhere;
|
||||
OnMouseTimer();
|
||||
|
||||
@@ -185,7 +185,7 @@ void Highlighter::AddDrawingPoint(MouseButton button)
|
||||
// Perhaps add a task to the Dispatcher every X circles to clean up.
|
||||
|
||||
// Get back on top in case other Window is now the topmost.
|
||||
// HACK: Draw with 1 pixel off. Otherwise, Windows glitches the task bar transparency when a transparent window fill the whole screen.
|
||||
// HACK: Draw with 1 pixel off. Otherwise Windows glitches the task bar transparency when a transparent window fill the whole screen.
|
||||
SetWindowPos(m_hwnd, HWND_TOPMOST, GetSystemMetrics(SM_XVIRTUALSCREEN) + 1, GetSystemMetrics(SM_YVIRTUALSCREEN) + 1, GetSystemMetrics(SM_CXVIRTUALSCREEN) - 2, GetSystemMetrics(SM_CYVIRTUALSCREEN) - 2, 0);
|
||||
}
|
||||
|
||||
@@ -402,7 +402,7 @@ void Highlighter::StartDrawing()
|
||||
|
||||
m_visible = true;
|
||||
|
||||
// HACK: Draw with 1 pixel off. Otherwise, Windows glitches the task bar transparency when a transparent window fill the whole screen.
|
||||
// HACK: Draw with 1 pixel off. Otherwise Windows glitches the task bar transparency when a transparent window fill the whole screen.
|
||||
SetWindowPos(m_hwnd, HWND_TOPMOST, GetSystemMetrics(SM_XVIRTUALSCREEN) + 1, GetSystemMetrics(SM_YVIRTUALSCREEN) + 1, GetSystemMetrics(SM_CXVIRTUALSCREEN) - 2, GetSystemMetrics(SM_CYVIRTUALSCREEN) - 2, 0);
|
||||
ClearDrawing();
|
||||
ShowWindow(m_hwnd, SW_SHOWNOACTIVATE);
|
||||
@@ -461,7 +461,7 @@ void Highlighter::ApplySettings(MouseHighlighterSettings settings)
|
||||
|
||||
void Highlighter::BringToFront()
|
||||
{
|
||||
// HACK: Draw with 1 pixel off. Otherwise, Windows glitches the task bar transparency when a transparent window fill the whole screen.
|
||||
// HACK: Draw with 1 pixel off. Otherwise Windows glitches the task bar transparency when a transparent window fill the whole screen.
|
||||
SetWindowPos(m_hwnd, HWND_TOPMOST, GetSystemMetrics(SM_XVIRTUALSCREEN) + 1, GetSystemMetrics(SM_YVIRTUALSCREEN) + 1, GetSystemMetrics(SM_CXVIRTUALSCREEN) - 2, GetSystemMetrics(SM_CYVIRTUALSCREEN) - 2, 0);
|
||||
}
|
||||
|
||||
|
||||
@@ -60,7 +60,7 @@ public static class LayoutHelperTests
|
||||
yield return new object[] { new TestCase(layoutConfig, layoutInfo) };
|
||||
|
||||
// check we handle rounding errors in scaling the preview form
|
||||
// that might make the form one pixel *smaller* than the current screen -
|
||||
// that might make the form a pixel *smaller* than the current screen -
|
||||
// e.g. a desktop 7168 x 1440 scaled to a screen 1024 x 768
|
||||
// with a 5px form padding border:
|
||||
//
|
||||
|
||||
@@ -72,7 +72,7 @@ public static class MouseHelper
|
||||
// | (a) | |
|
||||
// +---------+----------------+
|
||||
//
|
||||
// setting the position again seems to fix this and moves the
|
||||
// setting the position a second time seems to fix this and moves the
|
||||
// cursor to the expected location (b)
|
||||
var target = location.ToPoint();
|
||||
for (var i = 0; i < 2; i++)
|
||||
|
||||
@@ -10,7 +10,7 @@ public interface IImageRegionCopyService
|
||||
{
|
||||
/// <summary>
|
||||
/// Copies the source region from the provider's source image (e.g. the interactive desktop,
|
||||
/// a static image, etc.) to the target region on the specified Graphics object.
|
||||
/// a static image, etc) to the target region on the specified Graphics object.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Implementations of this interface are used to capture regions of the interactive desktop
|
||||
|
||||
@@ -217,7 +217,7 @@ internal sealed partial class MainForm : Form
|
||||
this.Thumbnail.Image = null;
|
||||
tmp.Dispose();
|
||||
|
||||
// force preview image memory to be released; otherwise,
|
||||
// force preview image memory to be released, otherwise
|
||||
// all the disposed images can pile up without being GC'ed
|
||||
GC.Collect();
|
||||
}
|
||||
@@ -250,7 +250,7 @@ internal sealed partial class MainForm : Form
|
||||
if (!this.Visible)
|
||||
{
|
||||
// we seem to need to turn off topmost and then re-enable it again
|
||||
// when we show the form; otherwise, it doesn't always get shown topmost...
|
||||
// when we show the form, otherwise it doesn't always get shown topmost...
|
||||
this.TopMost = false;
|
||||
this.TopMost = true;
|
||||
this.Show();
|
||||
|
||||
@@ -181,7 +181,7 @@ void InclusiveCrosshairs::UpdateCrosshairsPosition()
|
||||
{
|
||||
POINT ptCursor;
|
||||
|
||||
// HACK: Draw with 1 pixel off. Otherwise, Windows glitches the task bar transparency when a transparent window fill the whole screen.
|
||||
// HACK: Draw with 1 pixel off. Otherwise Windows glitches the task bar transparency when a transparent window fill the whole screen.
|
||||
SetWindowPos(m_hwnd, HWND_TOPMOST, GetSystemMetrics(SM_XVIRTUALSCREEN) + 1, GetSystemMetrics(SM_YVIRTUALSCREEN) + 1, GetSystemMetrics(SM_CXVIRTUALSCREEN) - 2, GetSystemMetrics(SM_CYVIRTUALSCREEN) - 2, 0);
|
||||
|
||||
GetCursorPos(&ptCursor);
|
||||
|
||||
@@ -117,8 +117,8 @@ namespace MouseUtils.UITests
|
||||
VerifyMouseHighlighterNotAppears(ref settings, "leftClick");
|
||||
VerifyMouseHighlighterNotAppears(ref settings, "rightClick");
|
||||
|
||||
// [Test Case] With left mouse button pressed, drag the mouse and verify the highlight is dragged with the pointer.
|
||||
// [Test Case] With right mouse button pressed, drag the mouse and verify the highlight is dragged with the pointer.
|
||||
// [Test Case] With left mouse button pressed, drag the mouse and verify the hightlight is dragged with the pointer.
|
||||
// [Test Case] With right mouse button pressed, drag the mouse and verify the hightlight is dragged with the pointer.
|
||||
foundCustom.Find<ToggleSwitch>("Enable Mouse Highlighter").Toggle(true);
|
||||
xy = Session.GetMousePosition();
|
||||
Session.MoveMouseTo(xy.Item1 - 100, xy.Item2);
|
||||
|
||||
@@ -25,9 +25,9 @@ Find My Mouse:
|
||||
|
||||
Mouse Highlighter:
|
||||
* Enable Mouse Highlighter. Then:
|
||||
- [x] Press the activation shortcut and press left and right click somewhere, verifying the highlights are applied.
|
||||
- [x] With left mouse button pressed, drag the mouse and verify the highlight is dragged with the pointer.
|
||||
- [x] With right mouse button pressed, drag the mouse and verify the highlight is dragged with the pointer.
|
||||
- [x] Press the activation shortcut and press left and right click somewhere, verifying the hightlights are applied.
|
||||
- [x] With left mouse button pressed, drag the mouse and verify the hightlight is dragged with the pointer.
|
||||
- [x] With right mouse button pressed, drag the mouse and verify the hightlight is dragged with the pointer.
|
||||
- [x] Press the activation shortcut again and verify no highlights appear when the mouse buttons are clicked.
|
||||
- [x] Disable Mouse Highlighter and verify that the module is not activated when you press the activation shortcut.
|
||||
* Test the different settings and verify they apply:
|
||||
|
||||
@@ -970,7 +970,7 @@ namespace MouseWithoutBorders.Class
|
||||
/// <summary>
|
||||
/// Use this method to figure out if your code is running on a Microsoft computer.
|
||||
/// </summary>
|
||||
/// <returns>True if running on a Microsoft computer; otherwise, false.</returns>
|
||||
/// <returns>True if running on a Microsoft computer, otherwise false.</returns>
|
||||
internal static bool IsRunningAtMicrosoft()
|
||||
{
|
||||
string domain = GetDNSDomain();
|
||||
|
||||
@@ -27,7 +27,7 @@ namespace MouseWithoutBorders.Core;
|
||||
*
|
||||
* SEQUENCE OF EVENTS:
|
||||
* DragDropStep01: MachineX: Remember mouse down state since it could be a start of a dragging
|
||||
* DragDropStep02: MachineY: Send a message to the MachineX to ask it to check if it is
|
||||
* DragDropStep02: MachineY: Send an message to the MachineX to ask it to check if it is
|
||||
* doing drag/drop
|
||||
* DragDropStep03: MachineX: Got explorerDragDrop, send WM_CHECK_EXPLORER_DRAG_DROP to its mainForm
|
||||
* DragDropStep04: MachineX: Show Mouse Without Borders Helper form at mouse cursor to get DragEnter event.
|
||||
|
||||
@@ -50,7 +50,7 @@ public static class LoggerTests
|
||||
var lines = log.Split("\r\n");
|
||||
|
||||
// some parts of the PrivateDump output are impossible to reproduce -
|
||||
// e.g. random numbers, system timestamps, thread ids, etc., so we'll mask them
|
||||
// e.g. random numbers, system timestamps, thread ids, etc, so we'll mask them
|
||||
var maskPrefixes = new string[]
|
||||
{
|
||||
"----_s0 = ",
|
||||
|
||||
@@ -808,7 +808,7 @@ void D2DOverlayWindow::render(ID2D1DeviceContext5* d2d_device_context)
|
||||
d2d_device_context->FillRectangle(monitor_rect, brush.get());
|
||||
}
|
||||
}
|
||||
// Finalize the overlay - dim the buttons if no thumbnail is present and show "No active window"
|
||||
// Finalize the overlay - dimm the buttons if no thumbnail is present and show "No active window"
|
||||
use_overlay->toggle_window_group(miniature_shown || window_state == MINIMIZED);
|
||||
if (!miniature_shown && window_state != MINIMIZED)
|
||||
{
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<Page
|
||||
<Page
|
||||
x:Class="WorkspacesEditor.MainPage"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
@@ -172,7 +172,7 @@
|
||||
VerticalContentAlignment="Stretch"
|
||||
VerticalScrollBarVisibility="Auto"
|
||||
Visibility="{Binding IsWorkspacesViewEmpty, Mode=OneWay, Converter={StaticResource BooleanToInvertedVisibilityConverter}, UpdateSourceTrigger=PropertyChanged}">
|
||||
<ItemsControl x:Name="WorkspacesItemsControl" ItemsSource="{Binding WorkspacesView, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}">
|
||||
<ItemsControl ItemsSource="{Binding WorkspacesView, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}">
|
||||
<ItemsControl.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<StackPanel
|
||||
@@ -235,10 +235,7 @@
|
||||
Grid.Column="1"
|
||||
Margin="12,12,12,12"
|
||||
Orientation="Vertical">
|
||||
<StackPanel
|
||||
x:Name="WorkspaceActionGroup"
|
||||
HorizontalAlignment="Right"
|
||||
Orientation="Horizontal">
|
||||
<StackPanel HorizontalAlignment="Right" Orientation="Horizontal">
|
||||
<Button
|
||||
x:Name="MoreButton"
|
||||
HorizontalAlignment="Right"
|
||||
@@ -251,8 +248,7 @@
|
||||
</Button>
|
||||
<Popup
|
||||
AllowsTransparency="True"
|
||||
Closed="PopupClosed"
|
||||
IsOpen="{Binding IsPopupVisible, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
|
||||
IsOpen="{Binding IsPopupVisible, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}"
|
||||
Placement="Left"
|
||||
PlacementTarget="{Binding ElementName=MoreButton}"
|
||||
StaysOpen="False">
|
||||
|
||||
@@ -4,8 +4,7 @@
|
||||
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Controls.Primitives;
|
||||
using ManagedCommon;
|
||||
|
||||
using WorkspacesEditor.Models;
|
||||
using WorkspacesEditor.ViewModels;
|
||||
|
||||
@@ -43,28 +42,17 @@ namespace WorkspacesEditor
|
||||
e.Handled = true;
|
||||
Button button = sender as Button;
|
||||
Project selectedProject = button.DataContext as Project;
|
||||
selectedProject.IsPopupVisible = false;
|
||||
|
||||
_mainViewModel.DeleteProject(selectedProject);
|
||||
}
|
||||
|
||||
private void MoreButton_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
_mainViewModel.CloseAllPopups();
|
||||
e.Handled = true;
|
||||
Button button = sender as Button;
|
||||
Project project = button.DataContext as Project;
|
||||
project.IsPopupVisible = true;
|
||||
}
|
||||
|
||||
private void PopupClosed(object sender, object e)
|
||||
{
|
||||
if (sender is Popup p && p.DataContext is Project proj)
|
||||
{
|
||||
proj.IsPopupVisible = false;
|
||||
}
|
||||
}
|
||||
|
||||
private void LaunchButton_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
e.Handled = true;
|
||||
|
||||
@@ -33,7 +33,7 @@ namespace WorkspacesEditor.Telemetry
|
||||
// Number of apps with "Launch as admin" set
|
||||
public int AdminCount { get; set; }
|
||||
|
||||
// True if user checked "Create Shortcut". False if not.
|
||||
// True of user checked "Create Shortcut". False if not.
|
||||
public bool ShortcutCreated { get; set; }
|
||||
|
||||
public PartA_PrivTags PartA_PrivTags => PartA_PrivTags.ProductAndServiceUsage;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<ResourceDictionary
|
||||
<ResourceDictionary
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:system="clr-namespace:System;assembly=System.Runtime">
|
||||
|
||||
@@ -437,11 +437,7 @@ namespace WorkspacesEditor.ViewModels
|
||||
private void RunSnapshotTool(bool isExistingProjectLaunched)
|
||||
{
|
||||
Process process = new Process();
|
||||
|
||||
var exeDir = Path.GetDirectoryName(Environment.ProcessPath);
|
||||
var snapshotUtilsPath = Path.Combine(exeDir, "PowerToys.WorkspacesSnapshotTool.exe");
|
||||
|
||||
process.StartInfo = new ProcessStartInfo(snapshotUtilsPath);
|
||||
process.StartInfo = new ProcessStartInfo(@".\PowerToys.WorkspacesSnapshotTool.exe");
|
||||
process.StartInfo.CreateNoWindow = true;
|
||||
process.StartInfo.Arguments = isExistingProjectLaunched ? $"{(int)InvokePoint.LaunchAndEdit}" : string.Empty;
|
||||
|
||||
|
||||
@@ -51,8 +51,6 @@
|
||||
MouseLeave="AppBorder_MouseLeave">
|
||||
<Expander
|
||||
Margin="0,0,20,0"
|
||||
AutomationProperties.AutomationId="{Binding AppName}"
|
||||
AutomationProperties.Name="{Binding AppName}"
|
||||
FlowDirection="RightToLeft"
|
||||
IsEnabled="{Binding IsIncluded, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}"
|
||||
IsExpanded="{Binding IsExpanded, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}">
|
||||
@@ -401,11 +399,7 @@
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
<ItemsControl
|
||||
x:Name="CapturedAppList"
|
||||
AutomationProperties.Name="Captured Application List"
|
||||
ItemTemplateSelector="{StaticResource AppListDataTemplateSelector}"
|
||||
ItemsSource="{Binding ApplicationsListed, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}" />
|
||||
<ItemsControl ItemTemplateSelector="{StaticResource AppListDataTemplateSelector}" ItemsSource="{Binding ApplicationsListed, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}" />
|
||||
</Grid>
|
||||
</StackPanel>
|
||||
</ScrollViewer>
|
||||
|
||||
@@ -1,605 +0,0 @@
|
||||
// Copyright (c) Microsoft Corporation
|
||||
// The Microsoft Corporation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using System.Diagnostics;
|
||||
using Microsoft.PowerToys.UITest;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
|
||||
namespace WorkspacesEditorUITest;
|
||||
|
||||
[TestClass]
|
||||
[Ignore("not stable")]
|
||||
public class WorkspacesEditingPageTests : WorkspacesUiAutomationBase
|
||||
{
|
||||
public WorkspacesEditingPageTests()
|
||||
: base()
|
||||
{
|
||||
}
|
||||
|
||||
[TestMethod("WorkspacesEditingPage.RemoveApp")]
|
||||
[TestCategory("Workspaces Editing Page UI")]
|
||||
public void TestRemoveAppFromWorkspace()
|
||||
{
|
||||
// Find app list
|
||||
var appList = Find<Custom>("AppList");
|
||||
var initialAppCount = appList.FindAll<Custom>(By.ClassName("AppItem")).Count;
|
||||
|
||||
if (initialAppCount == 0)
|
||||
{
|
||||
Assert.Inconclusive("No apps in workspace to remove");
|
||||
return;
|
||||
}
|
||||
|
||||
// Remove first app
|
||||
var firstApp = appList.FindAll<Custom>(By.ClassName("AppItem"))[0];
|
||||
var appName = firstApp.GetAttribute("Name");
|
||||
|
||||
var removeButton = firstApp.Find<Button>("Remove");
|
||||
removeButton.Click();
|
||||
Thread.Sleep(500);
|
||||
|
||||
// Verify app removed from list
|
||||
var finalAppCount = appList.FindAll<Custom>(By.ClassName("AppItem")).Count;
|
||||
Assert.AreEqual(initialAppCount - 1, finalAppCount, "App should be removed from list");
|
||||
|
||||
// Verify preview updated
|
||||
var previewPane = Find<Pane>("Preview");
|
||||
var windowPreviews = previewPane.FindAll<Custom>(By.ClassName("WindowPreview"));
|
||||
Assert.AreEqual(finalAppCount, windowPreviews.Count, "Preview should show correct number of windows");
|
||||
}
|
||||
|
||||
[TestMethod("WorkspacesEditingPage.RemoveAndAddBackApp")]
|
||||
[TestCategory("Workspaces Editing Page UI")]
|
||||
public void TestRemoveAndAddBackApp()
|
||||
{
|
||||
// Find app list
|
||||
var appList = Find<Custom>("AppList");
|
||||
var apps = appList.FindAll<Custom>(By.ClassName("AppItem"));
|
||||
|
||||
if (apps.Count == 0)
|
||||
{
|
||||
Assert.Inconclusive("No apps in workspace to test");
|
||||
return;
|
||||
}
|
||||
|
||||
var firstApp = apps[0];
|
||||
var appName = firstApp.GetAttribute("Name");
|
||||
|
||||
// Remove app
|
||||
var removeButton = firstApp.Find<Button>("Remove");
|
||||
removeButton.Click();
|
||||
Thread.Sleep(500);
|
||||
|
||||
// Verify removed app shows in "removed apps" section
|
||||
Assert.IsTrue(Has<Button>("Add back"), "Should have 'Add back' button for removed apps");
|
||||
|
||||
// Add back the app
|
||||
var addBackButton = Find<Button>("Add back");
|
||||
addBackButton.Click();
|
||||
Thread.Sleep(500);
|
||||
|
||||
// Verify app is back in the list
|
||||
var restoredApp = appList.Find<Custom>(By.Name(appName), timeoutMS: 2000);
|
||||
Assert.IsNotNull(restoredApp, "App should be restored to the list");
|
||||
|
||||
// Verify preview updated
|
||||
var previewPane = Find<Pane>("Preview");
|
||||
var windowPreviews = previewPane.FindAll<Custom>(By.ClassName("WindowPreview"));
|
||||
var currentAppCount = appList.FindAll<Custom>(By.ClassName("AppItem")).Count;
|
||||
Assert.AreEqual(currentAppCount, windowPreviews.Count, "Preview should show all windows again");
|
||||
}
|
||||
|
||||
[TestMethod("WorkspacesEditingPage.SetAppMinimized")]
|
||||
[TestCategory("Workspaces Editing Page UI")]
|
||||
public void TestSetAppMinimized()
|
||||
{
|
||||
// Find first app
|
||||
var appList = Find<Custom>("AppList");
|
||||
var apps = appList.FindAll<Custom>(By.ClassName("AppItem"));
|
||||
|
||||
if (apps.Count == 0)
|
||||
{
|
||||
Assert.Inconclusive("No apps in workspace to test");
|
||||
return;
|
||||
}
|
||||
|
||||
var firstApp = apps[0];
|
||||
|
||||
// Find and toggle minimized checkbox
|
||||
var minimizedCheckbox = firstApp.Find<CheckBox>("Minimized");
|
||||
bool wasMinimized = minimizedCheckbox.IsChecked;
|
||||
|
||||
minimizedCheckbox.Click();
|
||||
Thread.Sleep(500);
|
||||
|
||||
// Verify state changed
|
||||
Assert.AreNotEqual(wasMinimized, minimizedCheckbox.IsChecked, "Minimized state should toggle");
|
||||
|
||||
// Verify preview reflects the change
|
||||
var previewPane = Find<Pane>("Preview");
|
||||
var windowPreviews = previewPane.FindAll<Custom>(By.ClassName("WindowPreview"));
|
||||
|
||||
// The first window preview should indicate minimized state
|
||||
if (minimizedCheckbox.IsChecked && windowPreviews.Count > 0)
|
||||
{
|
||||
var firstPreview = windowPreviews[0];
|
||||
var opacity = firstPreview.GetAttribute("Opacity");
|
||||
|
||||
// Minimized windows might have reduced opacity or other visual indicator
|
||||
Assert.IsNotNull(opacity, "Minimized window should have visual indication in preview");
|
||||
}
|
||||
}
|
||||
|
||||
[TestMethod("WorkspacesEditingPage.SetAppMaximized")]
|
||||
[TestCategory("Workspaces Editing Page UI")]
|
||||
public void TestSetAppMaximized()
|
||||
{
|
||||
// Find first app
|
||||
var appList = Find<Custom>("AppList");
|
||||
var apps = appList.FindAll<Custom>(By.ClassName("AppItem"));
|
||||
|
||||
if (apps.Count == 0)
|
||||
{
|
||||
Assert.Inconclusive("No apps in workspace to test");
|
||||
return;
|
||||
}
|
||||
|
||||
var firstApp = apps[0];
|
||||
|
||||
// Find and toggle maximized checkbox
|
||||
var maximizedCheckbox = firstApp.Find<CheckBox>("Maximized");
|
||||
bool wasMaximized = maximizedCheckbox.IsChecked;
|
||||
|
||||
maximizedCheckbox.Click();
|
||||
Thread.Sleep(500);
|
||||
|
||||
// Verify state changed
|
||||
Assert.AreNotEqual(wasMaximized, maximizedCheckbox.IsChecked, "Maximized state should toggle");
|
||||
|
||||
// Verify preview reflects the change
|
||||
var previewPane = Find<Pane>("Preview");
|
||||
if (maximizedCheckbox.IsChecked)
|
||||
{
|
||||
// Maximized window should fill the preview area
|
||||
var windowPreviews = previewPane.FindAll<Custom>(By.ClassName("WindowPreview"));
|
||||
if (windowPreviews.Count > 0)
|
||||
{
|
||||
var firstPreview = windowPreviews[0];
|
||||
|
||||
// Check if preview shows maximized state
|
||||
var width = firstPreview.GetAttribute("Width");
|
||||
var height = firstPreview.GetAttribute("Height");
|
||||
Assert.IsNotNull(width, "Maximized window should have width in preview");
|
||||
Assert.IsNotNull(height, "Maximized window should have height in preview");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[TestMethod("WorkspacesEditingPage.LaunchAsAdmin")]
|
||||
[TestCategory("Workspaces Editing Page UI")]
|
||||
public void TestSetLaunchAsAdmin()
|
||||
{
|
||||
// Find app that supports admin launch
|
||||
var appList = Find<Custom>("AppList");
|
||||
var apps = appList.FindAll<Custom>(By.ClassName("AppItem"));
|
||||
|
||||
bool foundAdminCapableApp = false;
|
||||
foreach (var app in apps)
|
||||
{
|
||||
try
|
||||
{
|
||||
var adminCheckbox = app.Find<CheckBox>("Launch as admin", timeoutMS: 1000);
|
||||
if (adminCheckbox != null && adminCheckbox.IsChecked)
|
||||
{
|
||||
foundAdminCapableApp = true;
|
||||
bool wasAdmin = adminCheckbox.IsChecked;
|
||||
|
||||
adminCheckbox.Click();
|
||||
Thread.Sleep(500);
|
||||
|
||||
// Verify state changed
|
||||
Assert.AreNotEqual(wasAdmin, adminCheckbox.IsChecked, "Admin launch state should toggle");
|
||||
break;
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
// This app doesn't support admin launch
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if (!foundAdminCapableApp)
|
||||
{
|
||||
Assert.Inconclusive("No apps in workspace support admin launch");
|
||||
}
|
||||
}
|
||||
|
||||
[TestMethod("WorkspacesEditingPage.AddCLIArgs")]
|
||||
[TestCategory("Workspaces Editing Page UI")]
|
||||
public void TestAddCommandLineArguments()
|
||||
{
|
||||
// Find first app
|
||||
var appList = Find<Custom>("AppList");
|
||||
var apps = appList.FindAll<Custom>(By.ClassName("AppItem"));
|
||||
|
||||
if (apps.Count == 0)
|
||||
{
|
||||
Assert.Inconclusive("No apps in workspace to test");
|
||||
return;
|
||||
}
|
||||
|
||||
var firstApp = apps[0];
|
||||
|
||||
// Find CLI args textbox
|
||||
var cliArgsTextBox = firstApp.Find<TextBox>("Command line arguments", timeoutMS: 2000);
|
||||
if (cliArgsTextBox == null)
|
||||
{
|
||||
Assert.Inconclusive("App does not support command line arguments");
|
||||
return;
|
||||
}
|
||||
|
||||
// Add test arguments
|
||||
string testArgs = "--test-arg value";
|
||||
cliArgsTextBox.SetText(testArgs);
|
||||
Thread.Sleep(500);
|
||||
|
||||
// Verify arguments were entered
|
||||
Assert.AreEqual(testArgs, cliArgsTextBox.Text, "Command line arguments should be set");
|
||||
}
|
||||
|
||||
[TestMethod("WorkspacesEditingPage.ChangeAppPosition")]
|
||||
[TestCategory("Workspaces Editing Page UI")]
|
||||
public void TestManuallyChangeAppPosition()
|
||||
{
|
||||
// Find first app
|
||||
var appList = Find<Custom>("AppList");
|
||||
var apps = appList.FindAll<Custom>(By.ClassName("AppItem"));
|
||||
|
||||
if (apps.Count == 0)
|
||||
{
|
||||
Assert.Inconclusive("No apps in workspace to test");
|
||||
return;
|
||||
}
|
||||
|
||||
var firstApp = apps[0];
|
||||
|
||||
// Find position controls
|
||||
var xPositionBox = firstApp.Find<TextBox>("X position", timeoutMS: 2000);
|
||||
var yPositionBox = firstApp.Find<TextBox>("Y position", timeoutMS: 2000);
|
||||
|
||||
if (xPositionBox == null || yPositionBox == null)
|
||||
{
|
||||
// Try alternate approach with spinners
|
||||
var positionSpinners = firstApp.FindAll<Custom>(By.ClassName("SpinBox"));
|
||||
if (positionSpinners.Count >= 2)
|
||||
{
|
||||
xPositionBox = positionSpinners[0].Find<TextBox>(By.ClassName("TextBox"));
|
||||
yPositionBox = positionSpinners[1].Find<TextBox>(By.ClassName("TextBox"));
|
||||
}
|
||||
}
|
||||
|
||||
if (xPositionBox != null && yPositionBox != null)
|
||||
{
|
||||
// Change position
|
||||
xPositionBox.SetText("200");
|
||||
Thread.Sleep(500);
|
||||
|
||||
yPositionBox.SetText("150");
|
||||
Thread.Sleep(500);
|
||||
|
||||
// Verify preview updated
|
||||
var previewPane = Find<Pane>("Preview");
|
||||
var windowPreviews = previewPane.FindAll<Custom>(By.ClassName("WindowPreview"));
|
||||
Assert.IsTrue(windowPreviews.Count > 0, "Preview should show window at new position");
|
||||
}
|
||||
else
|
||||
{
|
||||
Assert.Inconclusive("Could not find position controls");
|
||||
}
|
||||
}
|
||||
|
||||
[TestMethod("WorkspacesEditingPage.ChangeWorkspaceName")]
|
||||
[TestCategory("Workspaces Editing Page UI")]
|
||||
public void TestChangeWorkspaceName()
|
||||
{
|
||||
// Find workspace name textbox
|
||||
var nameTextBox = Find<TextBox>("Workspace name");
|
||||
string originalName = nameTextBox.Text;
|
||||
|
||||
// Change name
|
||||
string newName = "Renamed_Workspace_" + DateTime.Now.Ticks;
|
||||
nameTextBox.SetText(newName);
|
||||
Thread.Sleep(500);
|
||||
|
||||
// Save changes
|
||||
var saveButton = Find<Button>("Save");
|
||||
saveButton.Click();
|
||||
Thread.Sleep(1000);
|
||||
|
||||
// Verify we're back at main list
|
||||
Assert.IsTrue(Has<Custom>("WorkspacesList"), "Should return to main list after saving");
|
||||
|
||||
// Verify workspace was renamed
|
||||
var workspacesList = Find<Custom>("WorkspacesList");
|
||||
var renamedWorkspace = workspacesList.Find<Custom>(By.Name(newName), timeoutMS: 2000);
|
||||
Assert.IsNotNull(renamedWorkspace, "Workspace should be renamed in the list");
|
||||
}
|
||||
|
||||
[TestMethod("WorkspacesEditingPage.SaveAndCancelWork")]
|
||||
[TestCategory("Workspaces Editing Page UI")]
|
||||
public void TestSaveAndCancelButtons()
|
||||
{
|
||||
// Make a change
|
||||
var nameTextBox = Find<TextBox>("Workspace name");
|
||||
string originalName = nameTextBox.Text;
|
||||
string tempName = originalName + "_temp";
|
||||
|
||||
nameTextBox.SetText(tempName);
|
||||
Thread.Sleep(500);
|
||||
|
||||
// Test Cancel button
|
||||
var cancelButton = Find<Button>("Cancel");
|
||||
cancelButton.Click();
|
||||
Thread.Sleep(1000);
|
||||
|
||||
// Verify returned to main list without saving
|
||||
Assert.IsTrue(Has<Custom>("WorkspacesList"), "Should return to main list");
|
||||
|
||||
// Go back to editing
|
||||
var workspacesList = Find<Custom>("WorkspacesList");
|
||||
var workspace = workspacesList.FindAll<Custom>(By.ClassName("WorkspaceItem"))[0];
|
||||
workspace.Click();
|
||||
Thread.Sleep(1000);
|
||||
|
||||
// Verify name wasn't changed
|
||||
nameTextBox = Find<TextBox>("Workspace name");
|
||||
Assert.AreEqual(originalName, nameTextBox.Text, "Name should not be changed after cancel");
|
||||
|
||||
// Now test Save button
|
||||
nameTextBox.SetText(tempName);
|
||||
Thread.Sleep(500);
|
||||
|
||||
var saveButton = Find<Button>("Save");
|
||||
saveButton.Click();
|
||||
Thread.Sleep(1000);
|
||||
|
||||
// Verify saved
|
||||
workspacesList = Find<Custom>("WorkspacesList");
|
||||
var savedWorkspace = workspacesList.Find<Custom>(By.Name(tempName), timeoutMS: 2000);
|
||||
Assert.IsNotNull(savedWorkspace, "Workspace should be saved with new name");
|
||||
}
|
||||
|
||||
[TestMethod("WorkspacesEditingPage.NavigateWithoutSaving")]
|
||||
[TestCategory("Workspaces Editing Page UI")]
|
||||
public void TestNavigateToMainPageWithoutSaving()
|
||||
{
|
||||
// Make a change
|
||||
var nameTextBox = Find<TextBox>("Workspace name");
|
||||
string originalName = nameTextBox.Text;
|
||||
|
||||
nameTextBox.SetText(originalName + "_unsaved");
|
||||
Thread.Sleep(500);
|
||||
|
||||
// Click on "Workspaces" navigation/breadcrumb
|
||||
if (Has<NavigationViewItem>("Workspaces", timeoutMS: 1000))
|
||||
{
|
||||
var workspacesNav = Find<NavigationViewItem>("Workspaces");
|
||||
workspacesNav.Click();
|
||||
Thread.Sleep(1000);
|
||||
}
|
||||
else if (Has<HyperlinkButton>("Workspaces", timeoutMS: 1000))
|
||||
{
|
||||
var workspacesBreadcrumb = Find<HyperlinkButton>("Workspaces");
|
||||
workspacesBreadcrumb.Click();
|
||||
Thread.Sleep(1000);
|
||||
}
|
||||
|
||||
// If there's a confirmation dialog, handle it
|
||||
if (Has<Button>("Discard", timeoutMS: 1000))
|
||||
{
|
||||
Find<Button>("Discard").Click();
|
||||
Thread.Sleep(500);
|
||||
}
|
||||
|
||||
// Verify returned to main list
|
||||
Assert.IsTrue(Has<Custom>("WorkspacesList"), "Should return to main list");
|
||||
|
||||
// Verify changes weren't saved
|
||||
var workspacesList = Find<Custom>("WorkspacesList");
|
||||
var unsavedWorkspace = workspacesList.Find<Custom>(By.Name(originalName + "_unsaved"), timeoutMS: 1000);
|
||||
Assert.IsNull(unsavedWorkspace, "Unsaved changes should not persist");
|
||||
}
|
||||
|
||||
[TestMethod("WorkspacesEditingPage.CreateDesktopShortcut")]
|
||||
[TestCategory("Workspaces Editing Page UI")]
|
||||
public void TestCreateDesktopShortcut()
|
||||
{
|
||||
// Find desktop shortcut checkbox
|
||||
var shortcutCheckbox = Find<CheckBox>("Create desktop shortcut");
|
||||
|
||||
// Get desktop path
|
||||
string desktopPath = Environment.GetFolderPath(Environment.SpecialFolder.Desktop);
|
||||
|
||||
// Get workspace name to check for shortcut
|
||||
var nameTextBox = Find<TextBox>("Workspace name");
|
||||
string workspaceName = nameTextBox.Text;
|
||||
string shortcutPath = Path.Combine(desktopPath, $"{workspaceName}.lnk");
|
||||
|
||||
// Clean up any existing shortcut
|
||||
if (File.Exists(shortcutPath))
|
||||
{
|
||||
File.Delete(shortcutPath);
|
||||
Thread.Sleep(500);
|
||||
}
|
||||
|
||||
// Check the checkbox
|
||||
if (!shortcutCheckbox.IsChecked)
|
||||
{
|
||||
shortcutCheckbox.Click();
|
||||
Thread.Sleep(500);
|
||||
}
|
||||
|
||||
// Save
|
||||
var saveButton = Find<Button>("Save");
|
||||
saveButton.Click();
|
||||
Thread.Sleep(2000); // Give time for shortcut creation
|
||||
|
||||
// Verify shortcut was created
|
||||
Assert.IsTrue(File.Exists(shortcutPath), "Desktop shortcut should be created");
|
||||
|
||||
// Clean up
|
||||
if (File.Exists(shortcutPath))
|
||||
{
|
||||
File.Delete(shortcutPath);
|
||||
}
|
||||
}
|
||||
|
||||
[TestMethod("WorkspacesEditingPage.DesktopShortcutState")]
|
||||
[TestCategory("Workspaces Editing Page UI")]
|
||||
public void TestDesktopShortcutCheckboxState()
|
||||
{
|
||||
// Get workspace name
|
||||
var nameTextBox = Find<TextBox>("Workspace name");
|
||||
string workspaceName = nameTextBox.Text;
|
||||
string desktopPath = Environment.GetFolderPath(Environment.SpecialFolder.Desktop);
|
||||
string shortcutPath = Path.Combine(desktopPath, $"{workspaceName}.lnk");
|
||||
|
||||
// Find checkbox
|
||||
var shortcutCheckbox = Find<CheckBox>("Create desktop shortcut");
|
||||
|
||||
// Test 1: When shortcut exists
|
||||
if (!File.Exists(shortcutPath))
|
||||
{
|
||||
// Create shortcut first
|
||||
if (!shortcutCheckbox.IsChecked)
|
||||
{
|
||||
shortcutCheckbox.Click();
|
||||
Thread.Sleep(500);
|
||||
}
|
||||
|
||||
Find<Button>("Save").Click();
|
||||
Thread.Sleep(2000);
|
||||
|
||||
// Navigate back to editing
|
||||
NavigateToEditingPage();
|
||||
}
|
||||
|
||||
shortcutCheckbox = Find<CheckBox>("Create desktop shortcut");
|
||||
Assert.IsTrue(shortcutCheckbox.IsChecked, "Checkbox should be checked when shortcut exists");
|
||||
|
||||
// Test 2: Remove shortcut
|
||||
if (File.Exists(shortcutPath))
|
||||
{
|
||||
File.Delete(shortcutPath);
|
||||
Thread.Sleep(500);
|
||||
}
|
||||
|
||||
// Re-navigate to refresh state
|
||||
Find<Button>("Cancel").Click();
|
||||
Thread.Sleep(1000);
|
||||
NavigateToEditingPage();
|
||||
|
||||
shortcutCheckbox = Find<CheckBox>("Create desktop shortcut");
|
||||
Assert.IsFalse(shortcutCheckbox.IsChecked, "Checkbox should be unchecked when shortcut doesn't exist");
|
||||
}
|
||||
|
||||
[TestMethod("WorkspacesEditingPage.LaunchAndEdit")]
|
||||
[TestCategory("Workspaces Editing Page UI")]
|
||||
public void TestLaunchAndEditCapture()
|
||||
{
|
||||
// Find Launch and Edit button
|
||||
var launchEditButton = Find<Button>("Launch and Edit");
|
||||
launchEditButton.Click();
|
||||
Thread.Sleep(3000); // Wait for apps to launch
|
||||
|
||||
// Open a new application
|
||||
Process.Start("calc.exe");
|
||||
Thread.Sleep(2000);
|
||||
|
||||
// Click Capture
|
||||
var captureButton = Find<Button>("Capture");
|
||||
captureButton.Click();
|
||||
Thread.Sleep(2000);
|
||||
|
||||
// Verify new app was added
|
||||
var appList = Find<Custom>("AppList");
|
||||
var apps = appList.FindAll<Custom>(By.ClassName("AppItem"));
|
||||
|
||||
bool foundCalculator = false;
|
||||
foreach (var app in apps)
|
||||
{
|
||||
var appName = app.GetAttribute("Name");
|
||||
if (appName.Contains("Calculator", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
foundCalculator = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Assert.IsTrue(foundCalculator, "Newly opened Calculator should be captured and added");
|
||||
|
||||
// Clean up
|
||||
foreach (var process in Process.GetProcessesByName("CalculatorApp"))
|
||||
{
|
||||
process.Kill();
|
||||
}
|
||||
|
||||
foreach (var process in Process.GetProcessesByName("Calculator"))
|
||||
{
|
||||
process.Kill();
|
||||
}
|
||||
}
|
||||
|
||||
// Helper methods
|
||||
private void NavigateToEditingPage()
|
||||
{
|
||||
// Ensure we have at least one workspace
|
||||
if (!Has<Custom>("WorkspacesList", timeoutMS: 1000))
|
||||
{
|
||||
CreateTestWorkspace();
|
||||
}
|
||||
|
||||
// Click on first workspace to edit
|
||||
var workspacesList = Find<Custom>("WorkspacesList");
|
||||
var workspaceItems = workspacesList.FindAll<Custom>(By.ClassName("WorkspaceItem"));
|
||||
|
||||
if (workspaceItems.Count == 0)
|
||||
{
|
||||
CreateTestWorkspace();
|
||||
workspaceItems = workspacesList.FindAll<Custom>(By.ClassName("WorkspaceItem"));
|
||||
}
|
||||
|
||||
workspaceItems[0].Click();
|
||||
Thread.Sleep(1000);
|
||||
}
|
||||
|
||||
private void CreateTestWorkspace()
|
||||
{
|
||||
// Open a test app
|
||||
Process.Start("notepad.exe");
|
||||
Thread.Sleep(1000);
|
||||
|
||||
// Create workspace
|
||||
var createButton = Find<Button>("Create Workspace");
|
||||
createButton.Click();
|
||||
Thread.Sleep(1000);
|
||||
|
||||
// Capture
|
||||
var captureButton = Find<Button>("Capture");
|
||||
captureButton.Click();
|
||||
Thread.Sleep(2000);
|
||||
|
||||
// Save with default name
|
||||
var saveButton = Find<Button>("Save");
|
||||
saveButton.Click();
|
||||
Thread.Sleep(1000);
|
||||
|
||||
// Close test app
|
||||
foreach (var process in Process.GetProcessesByName("notepad"))
|
||||
{
|
||||
process.Kill();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -8,10 +8,10 @@ using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
namespace WorkspacesEditorUITest;
|
||||
|
||||
[TestClass]
|
||||
public class WorkspacesEditorTests : WorkspacesUiAutomationBase
|
||||
public class WorkspacesEditorTests : UITestBase
|
||||
{
|
||||
public WorkspacesEditorTests()
|
||||
: base()
|
||||
: base(PowerToysModule.Workspaces, WindowSize.Medium)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -21,217 +21,4 @@ public class WorkspacesEditorTests : WorkspacesUiAutomationBase
|
||||
{
|
||||
Assert.IsTrue(this.Has<Button>("Create Workspace"), "Should have create workspace button");
|
||||
}
|
||||
|
||||
/*
|
||||
[TestMethod("WorkspacesEditor.Editor.NewWorkspaceAppearsInList")]
|
||||
[TestCategory("Workspaces UI")]
|
||||
public void TestNewWorkspaceAppearsInListAfterCapture()
|
||||
{
|
||||
// Open test application
|
||||
OpenNotepad();
|
||||
Thread.Sleep(2000);
|
||||
|
||||
// Create workspace
|
||||
var createButton = Find<Button>("Create Workspace");
|
||||
createButton.Click();
|
||||
Thread.Sleep(1000);
|
||||
|
||||
// Capture
|
||||
var captureButton = Find<Button>("Capture");
|
||||
captureButton.Click();
|
||||
Thread.Sleep(2000);
|
||||
|
||||
// Save workspace
|
||||
var saveButton = Find<Button>("Save");
|
||||
saveButton.Click();
|
||||
Thread.Sleep(1000);
|
||||
|
||||
// Verify workspace appears in list
|
||||
var workspacesList = Find<Custom>("WorkspacesList");
|
||||
var workspaceItems = workspacesList.FindAll<Custom>(By.ClassName("WorkspaceItem"));
|
||||
Assert.IsTrue(workspaceItems.Count > 0, "New workspace should appear in the list");
|
||||
|
||||
CloseNotepad();
|
||||
}
|
||||
|
||||
[TestMethod("WorkspacesEditor.Editor.CancelCaptureDoesNotAddWorkspace")]
|
||||
[TestCategory("Workspaces UI")]
|
||||
public void TestCancelCaptureDoesNotAddWorkspace()
|
||||
{
|
||||
// Count existing workspaces
|
||||
var workspacesList = Find<Custom>("WorkspacesList");
|
||||
var initialCount = workspacesList.FindAll<Custom>(By.ClassName("WorkspaceItem")).Count;
|
||||
|
||||
// Create workspace
|
||||
var createButton = Find<Button>("Create Workspace");
|
||||
createButton.Click();
|
||||
Thread.Sleep(1000);
|
||||
|
||||
// Cancel
|
||||
var cancelButton = Find<Button>("Cancel");
|
||||
cancelButton.Click();
|
||||
Thread.Sleep(1000);
|
||||
|
||||
// Verify count hasn't changed
|
||||
var finalCount = workspacesList.FindAll<Custom>(By.ClassName("WorkspaceItem")).Count;
|
||||
Assert.AreEqual(initialCount, finalCount, "Workspace count should not change after canceling");
|
||||
}
|
||||
|
||||
[TestMethod("WorkspacesEditor.Editor.SearchFiltersWorkspaces")]
|
||||
[TestCategory("Workspaces UI")]
|
||||
public void TestSearchFiltersWorkspaces()
|
||||
{
|
||||
// Create test workspaces first
|
||||
CreateTestWorkspace("TestWorkspace1");
|
||||
CreateTestWorkspace("TestWorkspace2");
|
||||
CreateTestWorkspace("DifferentName");
|
||||
|
||||
// Find search box
|
||||
var searchBox = Find<TextBox>("Search");
|
||||
searchBox.SetText("TestWorkspace");
|
||||
Thread.Sleep(1000);
|
||||
|
||||
// Verify filtered results
|
||||
var workspacesList = Find<Custom>("WorkspacesList");
|
||||
var visibleItems = workspacesList.FindAll<Custom>(By.ClassName("WorkspaceItem"));
|
||||
|
||||
// Should only show items matching "TestWorkspace"
|
||||
Assert.IsTrue(visibleItems.Count >= 2, "Should show at least 2 TestWorkspace items");
|
||||
|
||||
// Clear search
|
||||
searchBox.SetText(string.Empty);
|
||||
Thread.Sleep(500);
|
||||
}
|
||||
|
||||
[TestMethod("WorkspacesEditor.Editor.SortByWorks")]
|
||||
[TestCategory("Workspaces UI")]
|
||||
public void TestSortByFunctionality()
|
||||
{
|
||||
// Find sort dropdown
|
||||
var sortDropdown = Find<ComboBox>("SortBy");
|
||||
sortDropdown.Click();
|
||||
Thread.Sleep(500);
|
||||
|
||||
// Select different sort options
|
||||
var sortOptions = FindAll<Custom>(By.ClassName("ComboBoxItem"));
|
||||
if (sortOptions.Count > 1)
|
||||
{
|
||||
sortOptions[1].Click(); // Select second option
|
||||
Thread.Sleep(1000);
|
||||
|
||||
// Verify list is updated (we can't easily verify sort order in UI tests)
|
||||
var workspacesList = Find<Custom>("WorkspacesList");
|
||||
Assert.IsNotNull(workspacesList, "Workspaces list should still be visible after sorting");
|
||||
}
|
||||
}
|
||||
|
||||
[TestMethod("WorkspacesEditor.Editor.SortByPersists")]
|
||||
[TestCategory("Workspaces UI")]
|
||||
public void TestSortByPersistsAfterRestart()
|
||||
{
|
||||
// Set sort option
|
||||
var sortDropdown = Find<ComboBox>("SortBy");
|
||||
sortDropdown.Click();
|
||||
Thread.Sleep(500);
|
||||
|
||||
var sortOptions = FindAll<Custom>(By.ClassName("ComboBoxItem"));
|
||||
string selectedOption = string.Empty;
|
||||
if (sortOptions.Count > 1)
|
||||
{
|
||||
sortOptions[1].Click(); // Select second option
|
||||
selectedOption = sortDropdown.Text;
|
||||
Thread.Sleep(1000);
|
||||
}
|
||||
|
||||
// Restart editor
|
||||
RestartScopeExe();
|
||||
Thread.Sleep(2000);
|
||||
|
||||
// Verify sort option persisted
|
||||
sortDropdown = Find<ComboBox>("SortBy");
|
||||
Assert.AreEqual(selectedOption, sortDropdown.Text, "Sort option should persist after restart");
|
||||
}
|
||||
|
||||
[TestMethod("WorkspacesEditor.Editor.RemoveWorkspace")]
|
||||
[TestCategory("Workspaces UI")]
|
||||
public void TestRemoveWorkspace()
|
||||
{
|
||||
// Create a test workspace
|
||||
CreateTestWorkspace("WorkspaceToRemove");
|
||||
|
||||
// Find the workspace in the list
|
||||
var workspacesList = Find<Custom>("WorkspacesList");
|
||||
var workspaceItem = workspacesList.Find<Custom>(By.Name("WorkspaceToRemove"));
|
||||
|
||||
// Click remove button
|
||||
var removeButton = workspaceItem.Find<Button>("Remove");
|
||||
removeButton.Click();
|
||||
Thread.Sleep(1000);
|
||||
|
||||
// Confirm removal if dialog appears
|
||||
if (Has<Button>("Yes"))
|
||||
{
|
||||
Find<Button>("Yes").Click();
|
||||
Thread.Sleep(1000);
|
||||
}
|
||||
|
||||
// Verify workspace is removed
|
||||
Assert.IsFalse(Has(By.Name("WorkspaceToRemove")), "Workspace should be removed from list");
|
||||
}
|
||||
|
||||
[TestMethod("WorkspacesEditor.Editor.EditOpensEditingPage")]
|
||||
[TestCategory("Workspaces UI")]
|
||||
public void TestEditOpensEditingPage()
|
||||
{
|
||||
// Create a test workspace if none exist
|
||||
if (!Has<Custom>("WorkspacesList"))
|
||||
{
|
||||
CreateTestWorkspace("TestWorkspace");
|
||||
}
|
||||
|
||||
// Find first workspace
|
||||
var workspacesList = Find<Custom>("WorkspacesList");
|
||||
var workspaceItem = workspacesList.FindAll<Custom>(By.ClassName("WorkspaceItem"))[0];
|
||||
|
||||
// Click edit button
|
||||
var editButton = workspaceItem.Find<Button>("Edit");
|
||||
editButton.Click();
|
||||
Thread.Sleep(1000);
|
||||
|
||||
// Verify editing page opened
|
||||
Assert.IsTrue(Has<Button>("Save"), "Should have Save button on editing page");
|
||||
Assert.IsTrue(Has<Button>("Cancel"), "Should have Cancel button on editing page");
|
||||
|
||||
// Go back
|
||||
Find<Button>("Cancel").Click();
|
||||
Thread.Sleep(1000);
|
||||
}
|
||||
|
||||
[TestMethod("WorkspacesEditor.Editor.ClickWorkspaceOpensEditingPage")]
|
||||
[TestCategory("Workspaces UI")]
|
||||
public void TestClickWorkspaceOpensEditingPage()
|
||||
{
|
||||
// Create a test workspace if none exist
|
||||
if (!Has<Custom>("WorkspacesList"))
|
||||
{
|
||||
CreateTestWorkspace("TestWorkspace");
|
||||
}
|
||||
|
||||
// Find first workspace
|
||||
var workspacesList = Find<Custom>("WorkspacesList");
|
||||
var workspaceItem = workspacesList.FindAll<Custom>(By.ClassName("WorkspaceItem"))[0];
|
||||
|
||||
// Click on the workspace item itself
|
||||
workspaceItem.Click();
|
||||
Thread.Sleep(1000);
|
||||
|
||||
// Verify editing page opened
|
||||
Assert.IsTrue(Has<Button>("Save"), "Should have Save button on editing page");
|
||||
Assert.IsTrue(Has<Button>("Cancel"), "Should have Cancel button on editing page");
|
||||
|
||||
// Go back
|
||||
Find<Button>("Cancel").Click();
|
||||
Thread.Sleep(1000);
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
@@ -23,7 +23,6 @@
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\..\common\UITestAutomation\UITestAutomation.csproj" />
|
||||
<ProjectReference Include="..\WorkspacesEditor\WorkspacesEditor.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
@@ -1,100 +0,0 @@
|
||||
// Copyright (c) Microsoft Corporation
|
||||
// The Microsoft Corporation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using Microsoft.PowerToys.UITest;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
|
||||
namespace WorkspacesEditorUITest;
|
||||
|
||||
[TestClass]
|
||||
[Ignore("NOT STABLE")]
|
||||
public class WorkspacesLauncherTest : WorkspacesUiAutomationBase
|
||||
{
|
||||
public WorkspacesLauncherTest()
|
||||
: base()
|
||||
{
|
||||
}
|
||||
|
||||
[TestMethod("WorkspacesEditor.Launcher.LaunchFromEditor")]
|
||||
[TestCategory("Workspaces UI")]
|
||||
public void TestLaunchWorkspaceFromEditor()
|
||||
{
|
||||
ClearWorkspaces();
|
||||
var uuid = Guid.NewGuid().ToString("N").Substring(0, 8);
|
||||
CreateTestWorkspace(uuid);
|
||||
|
||||
CloseNotepad();
|
||||
|
||||
var launchButton = Find<Button>(By.Name("Launch"));
|
||||
launchButton.Click();
|
||||
|
||||
Task.Delay(2000).Wait();
|
||||
|
||||
var processes = System.Diagnostics.Process.GetProcessesByName("notepad");
|
||||
|
||||
Assert.IsTrue(processes?.Length > 0);
|
||||
}
|
||||
|
||||
[TestMethod("WorkspacesEditor.Launcher.CancelLaunch")]
|
||||
[TestCategory("Workspaces UI")]
|
||||
public void TestCancelLaunch()
|
||||
{
|
||||
// Create workspace with multiple apps
|
||||
CreateWorkspaceWithApps();
|
||||
|
||||
// Launch workspace
|
||||
var workspacesList = Find<Custom>("WorkspacesList");
|
||||
var workspaceItem = workspacesList.FindAll<Custom>(By.ClassName("WorkspaceItem"))[0];
|
||||
var launchButton = workspaceItem.Find<Button>("Launch");
|
||||
launchButton.Click();
|
||||
Thread.Sleep(1000);
|
||||
|
||||
// Cancel launch
|
||||
if (Has<Button>("Cancel launch"))
|
||||
{
|
||||
Find<Button>("Cancel launch").Click();
|
||||
Thread.Sleep(1000);
|
||||
|
||||
// Verify launcher closed
|
||||
Assert.IsFalse(Has<Window>("Workspaces Launcher"), "Launcher window should close after cancel");
|
||||
}
|
||||
|
||||
// Close any apps that may have launched
|
||||
CloseTestApplications();
|
||||
}
|
||||
|
||||
[TestMethod("WorkspacesEditor.Launcher.DismissKeepsLaunching")]
|
||||
[TestCategory("Workspaces UI")]
|
||||
public void TestDismissKeepsAppsLaunching()
|
||||
{
|
||||
// Create workspace with apps
|
||||
CreateWorkspaceWithApps();
|
||||
|
||||
// Launch workspace
|
||||
var workspacesList = Find<Custom>("WorkspacesList");
|
||||
var workspaceItem = workspacesList.FindAll<Custom>(By.ClassName("WorkspaceItem"))[0];
|
||||
var launchButton = workspaceItem.Find<Button>("Launch");
|
||||
launchButton.Click();
|
||||
Thread.Sleep(1000);
|
||||
|
||||
// Dismiss launcher
|
||||
if (Has<Button>("Dismiss"))
|
||||
{
|
||||
Find<Button>("Dismiss").Click();
|
||||
Thread.Sleep(1000);
|
||||
|
||||
// Verify launcher closed but apps continue launching
|
||||
Assert.IsFalse(Has<Window>("Workspaces Launcher"), "Launcher window should close after dismiss");
|
||||
|
||||
// Wait for apps to finish launching
|
||||
Thread.Sleep(3000);
|
||||
|
||||
// Verify apps launched (notepad should be open)
|
||||
Assert.IsTrue(WindowHelper.IsWindowOpen("Notepad"), "Apps should continue launching after dismiss");
|
||||
}
|
||||
|
||||
// Close launched apps
|
||||
CloseTestApplications();
|
||||
}
|
||||
}
|
||||
@@ -1,195 +0,0 @@
|
||||
// Copyright (c) Microsoft Corporation
|
||||
// The Microsoft Corporation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using Microsoft.PowerToys.UITest;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
|
||||
namespace WorkspacesEditorUITest;
|
||||
|
||||
[TestClass]
|
||||
public class WorkspacesSettingsTests : UITestBase
|
||||
{
|
||||
public WorkspacesSettingsTests()
|
||||
: base(PowerToysModule.PowerToysSettings, WindowSize.Medium)
|
||||
{
|
||||
}
|
||||
|
||||
[TestMethod("WorkspacesSettings.LaunchFromSettings")]
|
||||
[TestCategory("Workspaces Settings UI")]
|
||||
public void TestLaunchEditorFromSettingsPage()
|
||||
{
|
||||
GoToSettingsPageAndEnable();
|
||||
}
|
||||
|
||||
[TestMethod("WorkspacesSettings.ActivationShortcut")]
|
||||
[TestCategory("Workspaces Settings UI")]
|
||||
public void TestActivationShortcutCustomization()
|
||||
{
|
||||
GoToSettingsPageAndEnable();
|
||||
|
||||
// Find the activation shortcut control
|
||||
var shortcutButton = Find<Button>("Activation shortcut");
|
||||
Assert.IsNotNull(shortcutButton, "Activation shortcut control should exist");
|
||||
|
||||
// Test customizing the shortcut
|
||||
shortcutButton.Click();
|
||||
|
||||
Task.Delay(1000).Wait();
|
||||
|
||||
// Send new key combination (Win+Ctrl+W)
|
||||
SendKeys(Key.Win, Key.Ctrl, Key.W);
|
||||
|
||||
var saveButton = Find<Button>("Save");
|
||||
|
||||
Assert.IsNotNull(saveButton, "Save button should exist after editing shortcut");
|
||||
|
||||
saveButton.Click();
|
||||
|
||||
var helpText = shortcutButton.HelpText;
|
||||
Assert.AreEqual("Win + Ctrl + W", helpText, "Activation shortcut should be updated to Win + Ctrl + W");
|
||||
}
|
||||
|
||||
[TestMethod("WorkspacesSettings.EnableToggle")]
|
||||
[TestCategory("Workspaces Settings UI")]
|
||||
public void TestEnableDisableModule()
|
||||
{
|
||||
GoToSettingsPageAndEnable();
|
||||
|
||||
// Find the enable toggle
|
||||
var enableToggle = Find<ToggleSwitch>("Enable Workspaces");
|
||||
Assert.IsNotNull(enableToggle, "Enable Workspaces toggle should exist");
|
||||
|
||||
Assert.IsTrue(enableToggle.IsOn, "Enable Workspaces toggle should be in the 'on' state");
|
||||
|
||||
// Toggle the state
|
||||
enableToggle.Click();
|
||||
Task.Delay(500).Wait();
|
||||
|
||||
// Verify state changed
|
||||
Assert.IsFalse(enableToggle.IsOn, "Toggle state should change");
|
||||
|
||||
// Verify related controls are enabled/disabled accordingly
|
||||
var launchButton = Find<Button>("Launch editor");
|
||||
Assert.IsFalse(launchButton.Enabled, "Launch editor button should be disabled when module is disabled");
|
||||
}
|
||||
|
||||
[TestMethod("WorkspacesSettings.LaunchByActivationShortcut")]
|
||||
[TestCategory("Workspaces Settings UI")]
|
||||
[Ignore("Wait until settings & runner can be connected in framework")]
|
||||
public void TestLaunchEditorByActivationShortcut()
|
||||
{
|
||||
// Ensure module is enabled
|
||||
var enableToggle = Find<ToggleSwitch>("Enable Workspaces");
|
||||
if (!enableToggle.IsOn)
|
||||
{
|
||||
enableToggle.Click();
|
||||
Thread.Sleep(500);
|
||||
}
|
||||
|
||||
// Close settings window to test shortcut
|
||||
ExitScopeExe();
|
||||
Thread.Sleep(1000);
|
||||
|
||||
// Default shortcut is Win+Ctrl+`
|
||||
SendKeys(Key.Win, Key.Ctrl, Key.W);
|
||||
Thread.Sleep(2000);
|
||||
|
||||
// Verify editor opened
|
||||
Assert.IsTrue(WindowHelper.IsWindowOpen("Workspaces Editor"), "Workspaces Editor should open with activation shortcut");
|
||||
|
||||
// Reopen settings for next tests
|
||||
RestartScopeExe();
|
||||
NavigateToWorkspacesSettings();
|
||||
}
|
||||
|
||||
[TestMethod("WorkspacesSettings.DisableModuleNoLaunch")]
|
||||
[TestCategory("Workspaces Settings UI")]
|
||||
[Ignore("Wait until settings & runner can be connected in framework")]
|
||||
public void TestDisabledModuleDoesNotLaunchByShortcut()
|
||||
{
|
||||
// Disable the module
|
||||
var enableToggle = Find<ToggleSwitch>("Enable Workspaces");
|
||||
if (enableToggle.IsOn)
|
||||
{
|
||||
enableToggle.Click();
|
||||
Thread.Sleep(500);
|
||||
}
|
||||
|
||||
// Close settings to test shortcut
|
||||
ExitScopeExe();
|
||||
Thread.Sleep(1000);
|
||||
|
||||
// Try to launch with shortcut
|
||||
SendKeys(Key.Win, Key.Ctrl, Key.W);
|
||||
Thread.Sleep(2000);
|
||||
|
||||
// Verify editor did not open
|
||||
Assert.IsFalse(WindowHelper.IsWindowOpen("Workspaces Editor"), "Workspaces Editor should not open when module is disabled");
|
||||
|
||||
// Reopen settings and re-enable the module
|
||||
RestartScopeExe();
|
||||
NavigateToWorkspacesSettings();
|
||||
|
||||
enableToggle = Find<ToggleSwitch>("Enable Workspaces");
|
||||
if (!enableToggle.IsOn)
|
||||
{
|
||||
enableToggle.Click();
|
||||
Thread.Sleep(500);
|
||||
}
|
||||
}
|
||||
|
||||
[TestMethod("WorkspacesSettings.QuickAccessLaunch")]
|
||||
[TestCategory("Workspaces Settings UI")]
|
||||
[Ignore("Wait until tray icon supported is in framework")]
|
||||
public void TestLaunchFromQuickAccess()
|
||||
{
|
||||
// This test verifies the "quick access" mention in settings
|
||||
// Look for any quick access related UI elements
|
||||
var quickAccessInfo = FindAll(By.LinkText("quick access"));
|
||||
|
||||
if (quickAccessInfo.Count > 0)
|
||||
{
|
||||
Assert.IsTrue(quickAccessInfo.Count > 0, "Quick access information should be present in settings");
|
||||
}
|
||||
|
||||
// Note: Actual system tray/quick access interaction would require
|
||||
// more complex automation that might be platform-specific
|
||||
}
|
||||
|
||||
private void NavigateToWorkspacesSettings()
|
||||
{
|
||||
// Find and click Workspaces in the navigation
|
||||
var workspacesNavItem = Find<NavigationViewItem>("Workspaces");
|
||||
workspacesNavItem.Click();
|
||||
Thread.Sleep(1000);
|
||||
}
|
||||
|
||||
private void GoToSettingsPageAndEnable()
|
||||
{
|
||||
if (this.FindAll<NavigationViewItem>("Workspaces").Count == 0)
|
||||
{
|
||||
this.Find<NavigationViewItem>("Windowing & Layouts").Click();
|
||||
}
|
||||
|
||||
this.Find<NavigationViewItem>("Workspaces").Click();
|
||||
|
||||
var enableButton = this.Find<ToggleSwitch>("Enable Workspaces");
|
||||
Assert.IsNotNull(enableButton, "Enable Workspaces toggle should exist");
|
||||
|
||||
if (!enableButton.IsOn)
|
||||
{
|
||||
enableButton.Click();
|
||||
Task.Delay(500).Wait(); // Wait for the toggle animation and state change
|
||||
}
|
||||
|
||||
// Verify it's now enabled
|
||||
Assert.IsTrue(enableButton.IsOn, "Enable Workspaces toggle should be in the 'on' state");
|
||||
}
|
||||
|
||||
private void AttachWorkspacesEditor()
|
||||
{
|
||||
Task.Delay(200).Wait();
|
||||
this.Session.Attach(PowerToysModule.Workspaces);
|
||||
}
|
||||
}
|
||||
@@ -1,82 +0,0 @@
|
||||
// Copyright (c) Microsoft Corporation
|
||||
// The Microsoft Corporation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using Microsoft.PowerToys.UITest;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
using WorkspacesEditor.Utils;
|
||||
|
||||
namespace WorkspacesEditorUITest;
|
||||
|
||||
[TestClass]
|
||||
public class WorkspacesSnapshotTests : WorkspacesUiAutomationBase
|
||||
{
|
||||
public WorkspacesSnapshotTests()
|
||||
: base()
|
||||
{
|
||||
}
|
||||
|
||||
[TestMethod("WorkspacesSnapshot.CancelCapture")]
|
||||
[TestCategory("Workspaces Snapshot UI")]
|
||||
public void TestCaptureCancel()
|
||||
{
|
||||
AttachWorkspacesEditor();
|
||||
|
||||
var createButton = Find<Button>("Create Workspace");
|
||||
createButton.Click();
|
||||
|
||||
Task.Delay(1000).Wait();
|
||||
|
||||
AttachSnapshotWindow();
|
||||
|
||||
var cancelButton = Find<Button>("Cancel");
|
||||
|
||||
Assert.IsNotNull(cancelButton, "Capture button should exist");
|
||||
|
||||
cancelButton.Click();
|
||||
}
|
||||
|
||||
[TestMethod("WorkspacesSnapshot.CapturePackagedApps")]
|
||||
[TestCategory("Workspaces Snapshot UI")]
|
||||
public void TestCapturePackagedApplications()
|
||||
{
|
||||
OpenCalculator();
|
||||
|
||||
// OpenWindowsSettings();
|
||||
Task.Delay(2000).Wait();
|
||||
|
||||
AttachWorkspacesEditor();
|
||||
var createButton = Find<Button>("Create Workspace");
|
||||
createButton.Click();
|
||||
Task.Delay(1000).Wait();
|
||||
|
||||
AttachSnapshotWindow();
|
||||
var captureButton = Find<Button>("Capture");
|
||||
captureButton.Click();
|
||||
Task.Delay(3000).Wait();
|
||||
|
||||
// Verify captured windows by reading the temporary workspaces file as the ground truth.
|
||||
var editorIO = new WorkspacesEditorIO();
|
||||
var workspace = editorIO.ParseTempProject();
|
||||
|
||||
Assert.IsNotNull(workspace, "Workspace data should be deserialized.");
|
||||
Assert.IsNotNull(workspace.Applications, "Workspace should contain a list of apps.");
|
||||
|
||||
bool isCalculatorFound = workspace.Applications.Any(app => app.AppPath.Contains("Calculator", StringComparison.OrdinalIgnoreCase));
|
||||
|
||||
// bool isSettingsFound = workspace.Applications.Any(app => app.AppPath.Contains("Settings", StringComparison.OrdinalIgnoreCase));
|
||||
Assert.IsTrue(isCalculatorFound, "Calculator should be captured in the workspace data.");
|
||||
|
||||
// Assert.IsTrue(isSettingsFound, "Settings should be captured in the workspace data.");
|
||||
|
||||
// Cancel to clean up
|
||||
AttachWorkspacesEditor();
|
||||
Find<Button>("Cancel").Click();
|
||||
Task.Delay(1000).Wait();
|
||||
|
||||
// Close test applications
|
||||
CloseCalculator();
|
||||
|
||||
// CloseWindowsSettings();
|
||||
}
|
||||
}
|
||||
@@ -1,253 +0,0 @@
|
||||
// Copyright (c) Microsoft Corporation
|
||||
// The Microsoft Corporation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using System.Diagnostics;
|
||||
using Microsoft.PowerToys.UITest;
|
||||
|
||||
namespace WorkspacesEditorUITest
|
||||
{
|
||||
public class WorkspacesUiAutomationBase : UITestBase
|
||||
{
|
||||
public WorkspacesUiAutomationBase()
|
||||
: base(PowerToysModule.Workspaces, WindowSize.Medium)
|
||||
{
|
||||
}
|
||||
|
||||
protected void CreateTestWorkspace(string name)
|
||||
{
|
||||
// Open notepad for capture
|
||||
OpenNotepad();
|
||||
Task.Delay(1000).Wait();
|
||||
|
||||
// Create workspace
|
||||
AttachWorkspacesEditor();
|
||||
var createButton = Find<Button>("Create Workspace");
|
||||
createButton.Click();
|
||||
Task.Delay(500).Wait();
|
||||
|
||||
// Capture
|
||||
AttachSnapshotWindow();
|
||||
var captureButton = Find<Button>("Capture");
|
||||
captureButton.Click();
|
||||
Task.Delay(5000).Wait();
|
||||
|
||||
// Set name
|
||||
var nameTextBox = Find<TextBox>("EditNameTextBox");
|
||||
nameTextBox.SetText(name);
|
||||
|
||||
// Save
|
||||
Find<Button>("Save Workspace").Click();
|
||||
|
||||
// Close notepad
|
||||
CloseNotepad();
|
||||
}
|
||||
|
||||
// DO NOT USE UNTIL FRAMEWORK AVAILABLE, CAN'T FIND BUTTON FOR SECOND LOOP
|
||||
protected void ClearWorkspaces()
|
||||
{
|
||||
while (true)
|
||||
{
|
||||
try
|
||||
{
|
||||
var root = Find<Element>(By.AccessibilityId("WorkspacesItemsControl"));
|
||||
var buttons = root.FindAll<Button>(By.AccessibilityId("MoreButton"));
|
||||
|
||||
Debug.WriteLine($"Found {buttons.Count} button");
|
||||
|
||||
var button = buttons[^1];
|
||||
|
||||
button.Click();
|
||||
|
||||
Task.Delay(500).Wait();
|
||||
|
||||
var remove = Find<Button>(By.Name("Remove"));
|
||||
remove.Click();
|
||||
|
||||
Task.Delay(500).Wait();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Debug.WriteLine(ex.Message);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected void CreateWorkspaceWithApps()
|
||||
{
|
||||
// Open multiple test applications
|
||||
OpenTestApplications();
|
||||
Thread.Sleep(3000);
|
||||
|
||||
// Create workspace
|
||||
var createButton = Find<Button>("Create Workspace");
|
||||
createButton.Click();
|
||||
Thread.Sleep(1000);
|
||||
|
||||
// Capture
|
||||
var captureButton = Find<Button>("Capture");
|
||||
captureButton.Click();
|
||||
Thread.Sleep(2000);
|
||||
|
||||
// Save
|
||||
Find<Button>("Save").Click();
|
||||
Thread.Sleep(1000);
|
||||
|
||||
// Close test applications
|
||||
CloseTestApplications();
|
||||
}
|
||||
|
||||
protected void OpenTestApplications()
|
||||
{
|
||||
OpenNotepad();
|
||||
|
||||
// Could add more applications here
|
||||
Thread.Sleep(1000);
|
||||
}
|
||||
|
||||
protected void CloseTestApplications()
|
||||
{
|
||||
CloseNotepad();
|
||||
}
|
||||
|
||||
protected void CloseWorkspacesEditor()
|
||||
{
|
||||
// Find and close the Workspaces Editor window
|
||||
if (WindowHelper.IsWindowOpen("Workspaces Editor"))
|
||||
{
|
||||
var editorWindow = Find<Window>("Workspaces Editor");
|
||||
editorWindow.Close();
|
||||
Thread.Sleep(1000);
|
||||
}
|
||||
}
|
||||
|
||||
protected void ResetShortcutToDefault(Custom shortcutControl)
|
||||
{
|
||||
// Right-click on the shortcut control to open context menu
|
||||
shortcutControl.Click(rightClick: true);
|
||||
Thread.Sleep(500);
|
||||
|
||||
// Look for a "Reset to default" or similar option in the context menu
|
||||
try
|
||||
{
|
||||
// Try to find various possible menu item texts for reset option
|
||||
var resetOption = Find("Reset to default");
|
||||
resetOption?.Click();
|
||||
}
|
||||
catch
|
||||
{
|
||||
try
|
||||
{
|
||||
// Try alternative text
|
||||
var resetOption = Find("Reset");
|
||||
resetOption?.Click();
|
||||
}
|
||||
catch
|
||||
{
|
||||
try
|
||||
{
|
||||
// Try another alternative
|
||||
var resetOption = Find("Default");
|
||||
resetOption?.Click();
|
||||
}
|
||||
catch
|
||||
{
|
||||
// If context menu doesn't have reset option, try keyboard shortcut
|
||||
// ESC to close any open menus first
|
||||
SendKeys(Key.Esc);
|
||||
Thread.Sleep(200);
|
||||
|
||||
// Click on the control and try to clear it with standard shortcuts
|
||||
shortcutControl.Click();
|
||||
Thread.Sleep(200);
|
||||
|
||||
// Try Ctrl+A to select all, then Delete to clear
|
||||
SendKeys(Key.Ctrl, Key.A);
|
||||
Thread.Sleep(100);
|
||||
SendKeys(Key.Delete);
|
||||
Thread.Sleep(500);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected void OpenNotepad()
|
||||
{
|
||||
var process = System.Diagnostics.Process.Start("notepad.exe");
|
||||
Task.Delay(1000).Wait();
|
||||
}
|
||||
|
||||
protected void CloseNotepad()
|
||||
{
|
||||
var processes = System.Diagnostics.Process.GetProcessesByName("notepad");
|
||||
foreach (var process in processes)
|
||||
{
|
||||
try
|
||||
{
|
||||
process.Kill();
|
||||
process.WaitForExit();
|
||||
}
|
||||
catch
|
||||
{
|
||||
// ignore
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void AttachPowertoySetting()
|
||||
{
|
||||
Task.Delay(200).Wait();
|
||||
this.Session.Attach(PowerToysModule.PowerToysSettings);
|
||||
}
|
||||
|
||||
protected void AttachWorkspacesEditor()
|
||||
{
|
||||
Task.Delay(200).Wait();
|
||||
this.Session.Attach(PowerToysModule.Workspaces);
|
||||
}
|
||||
|
||||
protected void AttachSnapshotWindow()
|
||||
{
|
||||
Task.Delay(5000).Wait();
|
||||
this.Session.Attach("Snapshot Creator");
|
||||
}
|
||||
|
||||
protected void OpenCalculator()
|
||||
{
|
||||
Process.Start("calc.exe");
|
||||
Task.Delay(1000).Wait();
|
||||
}
|
||||
|
||||
protected void CloseCalculator()
|
||||
{
|
||||
foreach (var process in Process.GetProcessesByName("CalculatorApp"))
|
||||
{
|
||||
process.Kill();
|
||||
}
|
||||
|
||||
foreach (var process in Process.GetProcessesByName("Calculator"))
|
||||
{
|
||||
process.Kill();
|
||||
}
|
||||
}
|
||||
|
||||
protected void OpenWindowsSettings()
|
||||
{
|
||||
Process.Start(new ProcessStartInfo
|
||||
{
|
||||
FileName = "ms-settings:",
|
||||
UseShellExecute = true,
|
||||
});
|
||||
Task.Delay(500).Wait();
|
||||
}
|
||||
|
||||
protected void CloseWindowsSettings()
|
||||
{
|
||||
foreach (var process in Process.GetProcessesByName("SystemSettings"))
|
||||
{
|
||||
process.Kill();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
<ResourceDictionary
|
||||
<ResourceDictionary
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:system="clr-namespace:System;assembly=System.Runtime">
|
||||
|
||||
@@ -70,7 +70,6 @@ REG_SETTING RegSettings[] = {
|
||||
{ L"FontScale", SETTING_TYPE_DWORD, 0, &g_FontScale, static_cast<DOUBLE>(g_FontScale) },
|
||||
{ L"ShowExpiredTime", SETTING_TYPE_BOOLEAN, 0, &g_ShowExpiredTime, static_cast<DOUBLE>(g_ShowExpiredTime) },
|
||||
{ L"ShowTrayIcon", SETTING_TYPE_BOOLEAN, 0, &g_ShowTrayIcon, static_cast<DOUBLE>(g_ShowTrayIcon) },
|
||||
// NOTE: AnimateZoom is misspelled, but since it is a user setting stored in the registry we must continue to misspell it.
|
||||
{ L"AnimnateZoom", SETTING_TYPE_BOOLEAN, 0, &g_AnimateZoom, static_cast<DOUBLE>(g_AnimateZoom) },
|
||||
{ L"TelescopeZoomOut", SETTING_TYPE_BOOLEAN, 0, &g_TelescopeZoomOut, static_cast<DOUBLE>(g_TelescopeZoomOut) },
|
||||
{ L"SnapToGrid", SETTING_TYPE_BOOLEAN, 0, &g_SnapToGrid, static_cast<DOUBLE>(g_SnapToGrid) },
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user