feat(flutter): surface bound PTT key label in capability badge (SDD-091 follow-up)
After a user saved a PTT binding through _PttBindingCaptureDialog,
the capability badge showed the resolved level + backend (e.g.
'PTT: L2WindowsRawInput (windows-raw-input)') but never told the
user which key they had actually bound. Reported on the Windows
verification round as 'do you think we should tell user what key
they have set and then they will know what to press'.
This commit caches the captured platform-neutral key label in
_BetaHomeState whenever _onConfigurePtt succeeds, and threads it
through _AudioControls to a new boundKeyLabel prop on
PttCapabilityBadge. When the prop is non-empty the badge renders
a second line below the existing row:
PTT: L2WindowsRawInput (windows-raw-input) [ⓘ] [Configure]
Key: Space
The label uses bodySmall + monospace + onSurfaceVariant to stay
visually subordinate to the capability descriptor. Two new l10n
entries (en + zh) cover the 'Key: {key}' string.
Privacy: the displayed label is the same platform-neutral
LogicalKeyboardKey.keyLabel string the dialog already shows
during capture and that already crosses the bridge as
PttBinding.platform_key. No raw OS key code is introduced
(DEC-027 / SDD-077 compliance preserved).
State scope: display-only cache that resets on app restart. The
bridge-side PttController (SDD-088) holds the authoritative
binding; this UI cache is purely for display continuity within
a single process.
Verified on Linux: flutter analyze clean, cargo test --workspace
55/0/3.
This commit is contained in:
@@ -253,6 +253,12 @@ abstract class AppL10n {
|
||||
/// **'PTT: {level} ({backend})'**
|
||||
String pttCapabilityBadge(String level, String backend);
|
||||
|
||||
/// No description provided for @pttCapabilityBoundKey.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Key: {key}'**
|
||||
String pttCapabilityBoundKey(String key);
|
||||
|
||||
/// No description provided for @pttCapabilityExplainTitle.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
|
||||
@@ -96,6 +96,11 @@ class AppL10nEn extends AppL10n {
|
||||
return 'PTT: $level ($backend)';
|
||||
}
|
||||
|
||||
@override
|
||||
String pttCapabilityBoundKey(String key) {
|
||||
return 'Key: $key';
|
||||
}
|
||||
|
||||
@override
|
||||
String get pttCapabilityExplainTitle => 'Push-to-Talk capability';
|
||||
|
||||
|
||||
@@ -93,6 +93,11 @@ class AppL10nZh extends AppL10n {
|
||||
return '对讲能力:$level($backend)';
|
||||
}
|
||||
|
||||
@override
|
||||
String pttCapabilityBoundKey(String key) {
|
||||
return '按键:$key';
|
||||
}
|
||||
|
||||
@override
|
||||
String get pttCapabilityExplainTitle => '对讲能力说明';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user