fix(speech to text): speech to text now working. Also fixed overflow caused by tooltop message

This commit is contained in:
sienna-sterling 2025-03-14 16:21:04 -04:00 committed by GitHub
parent 19a21155bc
commit 41ada11b53
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 40 additions and 45 deletions

View file

@ -148,7 +148,7 @@ class MessageOverlayController extends State<MessageSelectionOverlay>
Future<void> _setInitialToolbarMode() async {
if (pangeaMessageEvent?.isAudioMessage ?? false) {
updateToolbarMode(MessageMode.messageTextToSpeech);
updateToolbarMode(MessageMode.messageSpeechToText);
return;
}

View file

@ -176,51 +176,46 @@ class MessageSpeechToTextCardState extends State<MessageSpeechToTextCard> {
}
//TODO: find better icons
return Padding(
padding: const EdgeInsets.all(16),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
const SizedBox(height: 8),
RichText(
text: transcriptText!,
return ConstrainedBox(
constraints: const BoxConstraints(
maxWidth: AppConfig.toolbarMinWidth,
maxHeight: AppConfig.toolbarMaxHeight,
),
child: SingleChildScrollView(
child: Padding(
padding: const EdgeInsets.all(16),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
const SizedBox(height: 8),
RichText(
text: transcriptText!,
),
if (widget.messageEvent.senderId ==
Matrix.of(context).client.userID)
Column(
children: [
const SizedBox(height: 16),
Row(
mainAxisSize: MainAxisSize.min,
children: [
IconNumberWidget(
icon: Icons.speed,
number: wordsPerMinuteString != null
? "$wordsPerMinuteString"
: "??",
toolTip: L10n.of(context).wordsPerMinute,
),
],
),
const InstructionsInlineTooltip(
instructionsEnum: InstructionsEnum.speechToText,
),
],
),
],
),
if (widget.messageEvent.senderId == Matrix.of(context).client.userID)
Column(
children: [
const SizedBox(height: 16),
Row(
mainAxisSize: MainAxisSize.min,
children: [
// IconNumberWidget(
// icon: Symbols.target,
// number:
// "${selectedToken?.confidence ?? speechToTextResponse!.transcript.confidence}%",
// toolTip: L10n.of(context).accuracy,
// ),
// const SizedBox(width: 16),
IconNumberWidget(
icon: Icons.speed,
number: wordsPerMinuteString != null
? "$wordsPerMinuteString"
: "??",
toolTip: L10n.of(context).wordsPerMinute,
),
],
),
const Row(
mainAxisSize: MainAxisSize.min,
children: [
Expanded(
child: InstructionsInlineTooltip(
instructionsEnum: InstructionsEnum.speechToText,
),
),
],
),
],
),
],
),
),
);
}