New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Migrate LogicalKeySet to SingleActivator #80756
Conversation
…er into migrate-single-shortcuts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Even though this didn't break any customer tests, you should probably write a migration guide and list this as a breaking change. The fact that several tests needed to be updated is an indication that this is likely to affect apps that use shortcuts. It did mine 🙂 |
@dkwingsmt did you write a migration guide for this? |
@tvolkert I'll do it next week. Thanks for reminder. |
@tvolkert Sorry to have responded so late. I've tried the tests that got changed in this PR, but all of them still compile. What breakage did you encounter? The only thing I can think of is if you wanted to trigger a system shortcut in a deprecated fashion (e.g. trigger |
Here's my code that needed updating: final Iterable<LogicalKeyboardKey> activateKeys = WidgetsApp.defaultShortcuts.entries
.where((MapEntry<LogicalKeySet, Intent> entry) => entry.value is ActivateIntent)
.map<LogicalKeySet>((MapEntry<LogicalKeySet, Intent> entry) => entry.key)
.where((LogicalKeySet keySet) => keySet.keys.length == 1)
.map<LogicalKeyboardKey>((LogicalKeySet keySet) => keySet.keys.single); Again, since no client tests broke, this isn't technically a breaking change according to our policy, but since we had to update so many tests in this PR, it seemed like a good indication that clients may also have to be updated, in which case I think a migration guide may help them. |
@dkwingsmt was a migration guide made for this? |
No I didn't. Was about to make but was stalled by the flutter/website rework. Will do. |
This PR follows #78522, which introduced
SingleActivator
andShortcutActivator
, and applies the change to existing code, by replacing all occurrences ofLogicalKeySet
toSingleActivator
orShortcutActivator
.This is part of the general keyboard project as in #44918, and resolves the shortcut problems described in #78522 in existing components.
Pre-launch Checklist
///
).If you need help, consider asking for advice on the #hackers-new channel on Discord.