Skip to content

[1.24] conhost: Make screen readers announce search results - #20533

Draft
Carlos Zamora (carlos-zamora) wants to merge 1 commit into
release-1.24from
dev/cazamor/conhost/bugfix-a11y-find-1.24
Draft

[1.24] conhost: Make screen readers announce search results#20533
Carlos Zamora (carlos-zamora) wants to merge 1 commit into
release-1.24from
dev/cazamor/conhost/bugfix-a11y-find-1.24

Conversation

@carlos-zamora

Copy link
Copy Markdown
Member

Summary of the Pull Request

Fixes a bug in console host where search results weren't being announced by the screen reader.

Adds 2 localized resources for announcements:

  • ID_CONSOLE_MSGFINDRESULT: "%1!d! of %2!d!"
  • ID_CONSOLE_MSGFINDNORESULT: "No results"

Updates the AccessibilityNotifier with a new AnnounceSearchResults() which handles making the announcements above using UiaRaiseNotificationEvent() (similar to how we make similar announcements in Windows Terminal).

The user experience itself is similar to Windows Terminal. The main difference being that Terminal announces the selection state after closing the search box (" selected"), and console host does not.

⚠️Keeping this in draft until I close on the desired UX above.

References and Relevant Issues

Port of #20532, with the following changes:

  • AccessibilityNotifier on main stores the UIA provider and has a batching system. We don't really have to care about the batching system here. Additionally, rather than retrieving the UIA provider, we delegate the work using Window::SignalUiaAnnouncement() --> WindowUiaProvider::SignalAnnouncement() --> UiaRaiseNotificationEvent().

⚠️#20152: the off-by-1 error effects search results in this branch

Validation Steps Performed

Opened the search box and performed a search with...
✅ results --> "<1-indexed num> of "
✅no results --> "no results"

PR Checklist

Closes https://dev.azure.com/microsoft/OS/_workitems/edit/37170192/?view=edit

@github-actions

Copy link
Copy Markdown

check-spelling-bot Report

🔴 Please review

See the 📂 files view, the 📜action log, 👼 SARIF report, or 📝 job summary for details.

Unrecognized words (780)
aarch
abcd
abcde
ABCDEFG
abcdefghijk
ABCDEFGHIJKLMNOPQRST
ABCDEFGHIJKLMNOPQRSTUVWXY
abcdefghijklmnopqrstuvwxyz
abi
ACL'd
activatable
ACTIVEBORDER
ACTIVECAPTION
addressof
admins
alloc
ALLUSERSPROFILE
amd
antialias
apc
api
APPDATA
APPICON
appid
appium
applet
apps
architected
argb
argc
args
argv
asan
ASDF
asm
attr
autocomplete
autocompletion
autocrlf
autogenerated
AVI
AVX
backend
backport
backpressure
bashrc
baz
bcrypt
bezier
bgcolor
BGR
bitmask
bitset
blog
bmp
bookmarking
Bopomofo
BOTTOMLEFT
BOTTOMRIGHT
BRK
bstr
btn
buf
bugfix
bugfixes
byref
bytearray
bytebuffer
cac
callee
calt
cbegin
cbuffer
cci
cctype
CDATA
cdecl
cend
cerr
cfg
CFlags
changelist
changelog
charset
chcp
checkbox
checkboxes
Checkin
chk
chrono
cielab
cjk
CLE
clig
clocale
cls
clsid
cmath
Cmdlet
cmdline
cmp
cmt
cmyk
cnt
CNTRL
codebase
codepage
codepath
codepoint
codeql
colorref
colorscheme
colorspaces
combobox
COMDAT
commandline
COMMITID
compat
componentization
concat
config
configurability
conint
constexpr
constness
CONTEXTMENU
coord
copymode
cout
cpp
crbegin
cred
cref
crend
crlf
cron
Crt
csharp
csproj
Csr
css
cstdarg
cstddef
cstdio
cstdlib
cstr
cstring
csv
ctime
ctor
ctx
ctype
CUI
curated
cwchar
cwctype
cwd
cxx
cybersecurity
cygwin
CYRL
DATAVIEW
DATAW
dbg
dealloc
debounce
debounced
declspec
decltype
declval
Dedupe
deduplicate
deduplicated
deduplicating
deiconify
delims
deps
deque
deref
deserialization
deserialize
deserialized
deserializer
deserializing
dest
Devops
Dirs
distro
dll
dllexport
dllimport
DLOAD
dns
doc'd
DOCTYPE
downlevel
dpi
dropdown
DROPDOWNLIST
dst
DTest
dtor
dword
editorconfig
elems
elif
elseif
emacs
endian
endif
endl
endlocal
endregion
endswith
ENQ
enqueuing
entrypoint
enum
envvar
eol
ERANGE
errno
errorlevel
espt
ETB
ETX
EVENTID
exe
executables
fabs
failfast
fallthrough
fclose
fenv
fgetc
fgetwc
fileno
filepath
filesystem
FILETYPE
finalizer
FINDSTR
FINDUP
floorf
flyout
FONTFAMILY
fontlist
FONTSIZE
FONTWEIGHT
forceinline
foreach
fprintf
Free'd
freopen
frontend
FSCTL
fstream
ftp
fullscreen
func
fuzzer
GAUSSIAN
gcc
gcy
getch
getchar
GETFONTSIZE
getline
GETPOS
GETSTATE
GETTEXT
getwriter
github
globals
gmail
GNUC
GPUs
grayscale
grep
groupbox
GTR
gui
GURMUKHI
HALFWIDTH
hardcode
hardcoded
hashmap
hashtable
hfile
HIGHLIGHTTEXT
HINSTANCE
hlocal
hls
HMENU
HMONITOR
HOMEDRIVE
HOMEPATH
horiz
HORZ
hostname
HOTFIX
hpp
Hread
HRSRC
HSL
hstring
hsv
html
http
hyperlink
icacls
ico
Iconified
iconify
icu
idx
ifdef
ifndef
ifstream
IGNORECASE
imagemagick
Imatch
img
impl
inheritdoc
ini
inlined
inlines
inlining
inout
inplace
intellisense
Interner
interop
interoperability
INTRINSICS
ioctl
iomanip
iostream
iot
ipconfig
iswdigit
jpeg
jpg
json
jsonc
JUnit
kbd
keybinding
keycode
keydown
keymap
keyscan
keyup
LATN
LBound
LEFTSHIFT
len
LFs
lhs
linkpath
Linq
linux
listbox
listdir
LLVM
lnk
localhost
lorem
lowercased
LPBYTE
LPCOLORREF
LPCSTR
LPCWSTR
LPDWORD
LPINT
LPPOINT
LPRECT
LPVOID
lrint
lrintf
lroundf
lru
lss
ltrim
ltype
Lua
malloc
markdownlint
matrix'd
MAXLENGTH
memcmp
memcpy
memmove
memset
MENUITEM
Mersenne
metadata
mimetype
mingw
minimap
Minimatch
mkdir
MMIX
monospaced
monostate
MOUSEMOVE
mousewheel
Mozilla
msbuild
msdn
msvc
msvcrt
msys
mui
mul
multiline
Munged
mutex
mutexes
nameof
namespace
namespaced
nano
natvis
nbsp
NDEBUG
NEQ
nodiscard
noexcept
NOHELP
noinline
Nop
noreply
noreturn
nothrow
NOTNULL
NOUPDATE
novtable
nowait
nowrap
npm
npos
nuget
nullability
nullopt
nullptr
numlock
numpad
nuspec
NVR
oauth
oem
offboarded
Ogonek
oklab
OOM
OPENTYPE
ostream
ostringstream
Outof
OUTOFMEMORY
params
parm
passthrough
pathext
PBOOL
PBYTE
PCHAR
pcs
pdb
pdbonly
PDWORD
perl
pgdn
pgup
PHANDLE
pid
pkey
placeholders
PLARGE
plist
plugin
png
popd
POPF
popup
positionals
pragma
prebuilt
precomp
prefilled
prefs
PRELOAD
premultiplied
prepopulated
printf
Productize
proj
psd
pseudoterminal
PSHORT
psm
ptr
ptrdiff
PULONG
punycode
pushd
putchar
putwchar
PVOID
PWCHAR
PWORD
pwsh
qos
queryable
rar
rasterizer
rawinput
rbegin
RCDATA
rcl
rdbuf
readline
readme
readonly
READWRITE
realloc
rects
Recv
refactor
refactoring
refcount
Reference'd
referer
regex
regexes
remoting
renamer
reparent
resizable
resync
retval
rgb
rgba
RGBCOLOR
rhs
RMENU
rng
roadmap
roundtrip
rst
rtf
Rtl
rtrim
RTTI
ruleset
rvalue
safearray
sapi
scancode
screenshot
scrollable
scrollbar
Scroller
scursor
sdk
sdl
searchbox
SELECTALL
selectany
serializers
SETCOLOR
setfill
SETFONT
setlocal
setlocale
setmode
SETPOS
SETTITLE
setw
SHRT
sinf
Singleline
sizeof
SND
somefile
spam
SPDX
spec'd
sprintf
srand
src
sre
srgb
Srv
ssh
sstream
standalone
Statusline
stdcall
stderr
stdexcept
stdin
STDIO
stdout
stl
stoul
strikethrough
Stringable
Stringify
stringstream
strlen
strrev
strtok
strtoull
structs
STX
subfolder
subkey
submenu
subspan
substr
sudo
svg
swappable
swprintf
symlink
sync'd
sys
targetnametoken
targetsize
taskbar
tearoff
telnet
telnetd
tempdir
templated
testapp
testenv
texel
textarea
Textbox
threadpool
timeline
titlebar
tmux
todo
tok
tokenizing
toolbar
tooltip
TOPLEFT
toplevel
TOPRIGHT
touchpad
towlower
towupper
transcoder
TREX
trie
truetype
trunc
tsf
ttf
typedef
typeid
typeinfo
typelib
typename
typeof
typeparam
ubuntu
uchar
ucs
UDM
Uid
uint
uintptr
UIs
ULLONG
ulong
umul
umulh
uncomment
undef
Unescape
unfocus
unicode
uninit
Uninitialize
Uninstall
unittest
unpause
unregister
Unregistering
upvote
uri
url
USASCII
USERDATA
USERDOMAIN
username
userprofile
ushort
Utc
utf
utils
uuid
uuidof
Validator
Vals
vcpkg
vcxproj
vec
vectorize
vectorized
versioned
versioning
viewports
virtualization
Virtualizing
VPATH
vsnprintf
vsprintf
vtable
walkthrough
wav
WCAG
wchar
wcout
wcscmp
wcscpy
wcslen
wcsrchr
wcstod
wcstof
wcstoul
website
websocket
WEOF
whitelisting
whitespaces
wifstream
Wiki
Wikipedia
wildcards
WINDOWFRAME
WINDOWTEXT
WINDOWTITLE
winsock
wmemchr
workaround
workflow
wprintf
WSA
wsl
wsmatch
wss
wstring
wstringstream
xaml
xargs
xml
xmlns
xor
XPosition
xsd
xsize
xterm
xvalue
yaml
YDPI
yml
YOffset
YPosition
YSize
zero'd
zsh
zwj
These words are not needed and should be removed APCs bitmasks changelists clsids Cmts codepages COLORREFs colorschemes distros DPIs DWORDs ESFCIB flyouts foob frontends Fullscreens fuzzyfinder Ioctl keydowns keyups lstrcmpi noexcepts nullopts OEMs oob pdbs popups reparented rgbs scancodes screenshots subkeys testenvs titlebars toolbars UChars UINTs unittests wchars websites wstrings xamls ZWJs

Some files were automatically ignored 🙈

These sample patterns would exclude them:

^\Qsrc/host/ft_host/Host.Tests.Feature.rc\E$
^src/host/runut\.bat$

You should consider adding them to:

.github/actions/spelling/excludes.txt

File matching is via Perl regular expressions.

To check these files, more of their words need to be in the dictionary than not. You can use patterns.txt to exclude portions, add items to the dictionary (e.g. by adding them to allow.txt), or fix typos.

To accept these unrecognized words as correct, update file exclusions, and remove the previously acknowledged and now absent words, you could run the following commands

... in a clone of the git@github.com:microsoft/terminal.git repository
on the dev/cazamor/conhost/bugfix-a11y-find-1.24 branch (ℹ️ how do I use this?):

curl -s -S -L 'https://raw.githubusercontent.com/check-spelling/check-spelling/cfb6f7e75bbfc89c71eaa30366d0c166f1bd9c8c/apply.pl' |
perl - 'https://github.com/microsoft/terminal/actions/runs/31443821264/attempts/1' &&
git commit -m 'Update check-spelling metadata'
Available 📚 dictionaries could cover words (expected and unrecognized) not in the 📘 dictionary

This includes both expected items (2080) from .github/actions/spelling/expect/alphabet.txt .github/actions/spelling/expect/expect.txt .github/actions/spelling/expect/web.txt and unrecognized words (780)

Dictionary Entries Covers Uniquely
cspell:software-terms/dict/softwareTerms.txt 1288 172 45
cspell:cpp/src/stdlib-cpp.txt 252 54 31
cspell:cpp/src/stdlib-c.txt 278 58 29
cspell:python/src/python/python-lib.txt 2417 124 15
cspell:php/dict/php.txt 1689 111 11

Consider adding to the extra_dictionaries array (in the .github/actions/spelling/config.json file):

    "cspell:software-terms/dict/softwareTerms.txt",
    "cspell:cpp/src/stdlib-cpp.txt",
    "cspell:cpp/src/stdlib-c.txt",
    "cspell:python/src/python/python-lib.txt",
    "cspell:php/dict/php.txt",

To stop checking additional dictionaries, put (in the .github/actions/spelling/config.json file):

"check_extra_dictionaries": []
Pattern suggestions ✂️ (5)

You could add these patterns to .github/actions/spelling/patterns/bbadde62e965ac787b478c0f3cf826296bd2111b.txt:

# Automatically suggested patterns

# hit-count: 6 file-count: 4
# imports
^import\s+(?:(?:static|type)\s+|)(?:[\w.]|\{\s*\w*?(?:,\s*(?:\w*|\*))+\s*\})+

# hit-count: 2 file-count: 1
# https/http/file urls
(?:\b(?:https?|ftp|file)://)[-A-Za-z0-9+&@#/*%?=~_|!:,.;]+[-A-Za-z0-9+&@#/*%=~_|]

# hit-count: 1 file-count: 1
# #pragma lib
^\s*#pragma comment\(lib, ".*?"\)

# hit-count: 1 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: 1 file-count: 1
# French
# This corpus only had capital letters, but you probably want lowercase ones as well.
\b[LN]'+[a-z]{2,}\b

Alternatively, if a pattern suggestion doesn't make sense for this project, add a # to the beginning of the line in the candidates file with the pattern to stop suggesting it.

Errors, Warnings, and Notices ❌ (5)

See the 📂 files view, the 📜action log, 👼 SARIF report, or 📝 job summary for details.

❌ Errors, Warnings, and Notices Count
ℹ️ candidate-pattern 7
❌ check-file-path 2815
⚠️ duplicate-pattern 1
⚠️ ignored-expect-variant 1
⚠️ noisy-file 2

See ❌ Event descriptions for more information.

✏️ Contributor please read this

By default the command suggestion will generate a file named based on your commit. That's generally ok as long as you add the file to your commit. Someone can reorganize it later.

If the listed items are:

  • ... misspelled, then please correct them instead of using the command.
  • ... names, please add them to .github/actions/spelling/allow/names.txt.
  • ... APIs, you can add them to a file in .github/actions/spelling/allow/.
  • ... just things you're using, please add them to an appropriate file in .github/actions/spelling/expect/.
  • ... tokens you only need in one place and shouldn't generally be used, you can add an item in an appropriate file in .github/actions/spelling/patterns/.

See the README.md in each directory for more information.

🔬 You can test your commits without appending to a PR by creating a new branch with that extra change and pushing it to your fork. The check-spelling action will run in response to your push -- it doesn't require an open pull request. By using such a branch, you can limit the number of typos your peers see you make. 😉

If the flagged items are 🤯 false positives

If items relate to a ...

  • binary file (or some other file you wouldn't want to check at all).

    Please add a file path to the excludes.txt file matching the containing file.

    File paths are Perl 5 Regular Expressions - you can test yours before committing to verify it will match your files.

    ^ refers to the file's path from the root of the repository, so ^README\.md$ would exclude README.md (on whichever branch you're using).

  • well-formed pattern.

    If you can write a pattern that would match it,
    try adding it to the patterns.txt file.

    Patterns are Perl 5 Regular Expressions - you can test yours before committing to verify it will match your lines.

    Note that patterns can't match multiline strings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant