Transcribe Bestie hold recordings into text on device (#9645)

Hold Bestie to record with the waveform and slide-up cancel interaction
from #8665, then release to send an on-device transcript as a normal
text message. Stay on Home with a loader inside Bestie until delivery
succeeds, then open chat. Failures expose Retry/Discard; saved
recordings and signed messages remain recoverable without duplicate
sends. Saved audio is excluded from OS backup. Existing composer voice
notes are unchanged.

Separate exploration from #8665. Transcription requires iOS 26 and a
supported language. Android reports unavailable before capture because
its generic recognizer cannot guarantee saved-file input.

Validation: at `b5dc83bbf5`, 5,046 Flutter tests (71 skipped), 27 crypto
tests, analysis and required push checks pass. Prior native changes at
`30a397f83c`: Android build and 33 tests pass; iOS simulator compilation
and backup-exclusion test pass, with one unchanged document-picker
timeout passing on isolated rerun. Earlier iPhone preview was tested
with saved profile preserved; these latest fixes have not been installed
on the physical phone.

---------

Signed-off-by: kenny lopez <klopez4212@gmail.com>
Signed-off-by: Tom Brow <tomb@block.xyz>
Co-authored-by: Terp <5856f6900e8e0a4e0ea1f4f8d2ee33e4753d2119bc122f94ecafc660b46c0511@buzz.block.builderlab.xyz>
Co-authored-by: Tom Brow <tomb@block.xyz>
Co-authored-by: studio <dc2fc481343672df31a689840c09299972e704dac592e0da6f18486646a7ee3e@buzz.block.builderlab.xyz>
Co-authored-by: corey <2dafccf60ea6d431a568f6d67fc600160d92a51e415e09dc8b213b8e360663d5@buzz.block.builderlab.xyz>
This commit is contained in:
klopez4212
2026-11-19 10:32:12 +00:00
committed by GitHub
parent b68c4edda5
commit 5bd9d2c5d2
35 changed files with 2916 additions and 215 deletions

View File

@@ -87,6 +87,7 @@
In particular, this is used by the Flutter engine in io.flutter.plugin.text.ProcessTextPlugin. -->
<queries>
<intent><action android:name="android.speech.RecognitionService" /></intent>
<intent>
<action android:name="android.intent.action.PROCESS_TEXT"/>
<data android:mimeType="text/plain"/>

View File

@@ -0,0 +1,25 @@
package xyz.block.buzz.mobile
import io.flutter.plugin.common.BinaryMessenger
import io.flutter.plugin.common.MethodChannel
/** Fail before capture: Android's generic recognizer cannot guarantee file input. */
class DeviceTranscriptionPlugin(messenger: BinaryMessenger) {
private val channel = MethodChannel(messenger, "buzz/transcription")
init {
channel.setMethodCallHandler { call, result ->
when (call.method) {
"cancel" -> result.success(null)
"prepare", "transcribe" -> result.error(
"unavailable",
"Transcribing saved recordings is not available on Android yet.",
null,
)
else -> result.notImplemented()
}
}
}
fun dispose() { channel.setMethodCallHandler(null) }
}

View File

@@ -130,6 +130,7 @@ class MainActivity : FlutterFragmentActivity() {
private var mediaUploadChannel: MethodChannel? = null
private var ageSignalChannel: MethodChannel? = null
private val ageSignalRequest = AgeSignalRequest()
private var deviceTranscriptionPlugin: DeviceTranscriptionPlugin? = null
private var huddleMediaPlugin: HuddleMediaPlugin? = null
private var hapticsPlugin: HapticsPlugin? = null
private var hostedHpkePlugin: HostedHpkePlugin? = null
@@ -138,6 +139,7 @@ class MainActivity : FlutterFragmentActivity() {
override fun configureFlutterEngine(flutterEngine: FlutterEngine) {
super.configureFlutterEngine(flutterEngine)
deviceTranscriptionPlugin = DeviceTranscriptionPlugin(flutterEngine.dartExecutor.binaryMessenger)
flutterEngine.platformViewsController.registry.registerViewFactory(
"buzz/transparent-avatar",
TransparentAvatarViewFactory(flutterEngine.dartExecutor.binaryMessenger),
@@ -236,6 +238,8 @@ class MainActivity : FlutterFragmentActivity() {
}
override fun onDestroy() {
deviceTranscriptionPlugin?.dispose()
deviceTranscriptionPlugin = null
browserAuthPlugin?.dispose()
browserAuthPlugin = null
identityFilePlugin?.dispose()

View File

@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Android 11 and lower. Same exclusions as data_extraction_rules.xml. -->
<full-backup-content>
<exclude domain="file" path="bestie-transcripts/"/>
<exclude domain="sharedpref" path="FlutterSecureStorage.xml"/>
<exclude domain="sharedpref" path="FlutterSecureKeyStorage.xml"/>
<exclude domain="sharedpref" path="FlutterSecureStorageConfiguration.xml"/>

View File

@@ -6,12 +6,14 @@
app data still backs up and transfers as before. -->
<data-extraction-rules>
<cloud-backup>
<exclude domain="file" path="bestie-transcripts/"/>
<exclude domain="sharedpref" path="FlutterSecureStorage.xml"/>
<exclude domain="sharedpref" path="FlutterSecureKeyStorage.xml"/>
<exclude domain="sharedpref" path="FlutterSecureStorageConfiguration.xml"/>
<exclude domain="file" path="diagnostics_install_id"/>
</cloud-backup>
<device-transfer>
<exclude domain="file" path="bestie-transcripts/"/>
<exclude domain="sharedpref" path="FlutterSecureStorage.xml"/>
<exclude domain="sharedpref" path="FlutterSecureKeyStorage.xml"/>
<exclude domain="sharedpref" path="FlutterSecureStorageConfiguration.xml"/>