fix(ui,voice): consolidate to single Voice settings entry point

The capability badge had its own 'Configure' TextButton that opened
the bind-key flow, while the Voice Bar's settings gear also reached
bind-key through the settings dialog. Two paths, same destination —
confusing and pointless duplication that the user flagged.

Resolution: the gear is the only configuration entry point. The
capability badge becomes information-only — it still shows the
detected PTT level + backend and (for L0Focused) the info-icon
explanation sheet, but no Configure button. The badge no longer
takes  or  props. The Voice Bar drops
the  callback added in 6a41a0b.

Also removed the dead  legacy widget class (lines
1001-1181) — it had no callers since the VoiceBar refactor in
ba444d9 but was still cluttering the file and even held a stale
reference to PttCapabilityBadge's old constructor signature.

The bound-key string is no longer duplicated either: the Voice Bar's
PTT-only secondary line ('PTT: Space   ·   Release tail: 200ms')
remains the only place that shows the bound key, since it's also
the only PTT-mode-gated surface.

flutter analyze: clean (6 pre-existing Radio.groupValue infos).
This commit is contained in:
EdisonJwa
2026-05-15 23:52:23 +08:00
parent 8cd919cffc
commit 64878e3a7d
2 changed files with 35 additions and 250 deletions
@@ -27,7 +27,6 @@ class VoiceBar extends StatelessWidget {
required this.pttBoundKeyLabel,
required this.onToggleMute,
required this.onConfigure,
required this.onBindKey,
required this.onLeave,
});
@@ -68,14 +67,12 @@ class VoiceBar extends StatelessWidget {
/// Toggle the hard-mute clamp.
final VoidCallback onToggleMute;
/// Open the voice settings dialog (mode + release tail).
/// Open the voice settings dialog. This is the SINGLE entry point
/// for transmit-mode selection, PTT key binding, and release-tail
/// configuration. The capability badge below is information-only
/// and intentionally does NOT have its own configure affordance.
final VoidCallback onConfigure;
/// Open the bind-key capture flow directly (skips the settings
/// dialog). Surfaced from the capability badge when PTT mode is
/// active.
final VoidCallback onBindKey;
/// Leave the voice channel.
final VoidCallback onLeave;
@@ -208,13 +205,15 @@ class VoiceBar extends StatelessWidget {
// PTT capability badge — only relevant when PTT mode is
// active. Hidden for Continuous / Voice Activity since
// there's no key binding to surface a capability for.
// The badge is information-only; the user reaches the
// bind-key flow through the Voice Bar's settings gear
// (single configuration entry point — see the comment
// on `onConfigure`).
if (isPtt)
PttCapabilityBadge(
level: pttLevel,
backendId: pttBackendId,
boundInputClass: pttBoundInputClass,
boundKeyLabel: pttBoundKeyLabel,
onConfigure: onBindKey,
),
if (inChannel) ...[
const SizedBox(height: 6),