Address book: first-letter (type-ahead) navigation in the contact and group lists (#371)#372
Merged
Merged
Conversation
…er lists (#371) Typing a letter with focus on the address book's contact list did nothing. The list uses an ItemTemplate whose root is a Grid, so WPF's TextSearch had no text to match against and type-ahead silently did nothing. Declare IsTextSearchEnabled + TextSearch.TextPath on the contact list, the groups list, and the group-members list. Contacts match on a new TypeAheadText property: the display name, falling back to the address for prior-recipient contacts stored without a name (a TextPath binds to exactly one property, so the fallback has to live on the model). Groups match on their name. This restores the standard Windows list behavior the user expects: letters accumulate within the type-ahead timeout to match a longer prefix, and a repeated letter cycles through the contacts starting with it. Tests drive real TextInput events through the WPF input pipeline and cover first-letter, repeat-letter cycling, multi-letter prefix, the name-less contact fallback, and the groups list. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #371.
The bug
With focus on the address book's contact list, typing a letter did nothing. The list renders each row through an
ItemTemplatewhose root is aGrid, so WPF'sTextSearchhad no text to match — and with noTextSearch.TextPathdeclared, type-ahead was silently a no-op.The fix
ContactList,GroupsList, andGroupMembersListnow declareIsTextSearchEnabled="True"plus aTextSearch.TextPath.ContactModel.TypeAheadText: the display name, falling back to the email address for prior-recipient contacts stored without a name. ATextPathbinds to exactly one property, so that fallback has to live on the model. Groups match onName.WPF's built-in behavior then gives what the issue asks for: letters accumulate within the system type-ahead timeout ("br" lands on Brenda, not Bob), and repeating the same letter cycles through the contacts starting with it.
Tests
QuickMail.Tests/AddressBookTypeAheadTests.csraises realTextInputevents through the WPF input pipeline (not just asserting the XAML attribute), covering:All 6 pass locally; full suite run as well.
Notes
docs/release-notes-v0.8.37.md(new file — this work ships in 0.8.37).Ctrl+Shift+M) has its own lists that were not touched here. Worth a follow-up if the same typing behavior is wanted there.