Update edit launcher title to use case oneliner

Use the current case's oneliner text as the title for the remote input
intent. This ensures consistency with the CaseListScreen's display when
no oneliner is present, showing a "…" placeholder. This improves the
user experience by making the system input picker's title match what the
user just selected.
This commit is contained in:
2026-05-03 21:14:59 +02:00
parent 99a481bda5
commit d5f234e159
@@ -93,12 +93,15 @@ fun CaseDetailScreen(
}
val launchEdit: () -> Unit = {
// Mirror CaseListScreen's "…" placeholder when no oneliner exists yet,
// so the system input picker shows the same title the user just tapped.
val currentTitle = case?.oneliner?.displayText() ?: ""
val languageExtras = Bundle().apply {
putString(RecognizerIntent.EXTRA_LANGUAGE, VOICE_INPUT_LANGUAGE)
putString(RecognizerIntent.EXTRA_LANGUAGE_PREFERENCE, VOICE_INPUT_LANGUAGE)
}
val remoteInput = RemoteInput.Builder(ONELINER_INPUT_KEY)
.setLabel("OneLiner")
.setLabel(currentTitle)
.setAllowFreeFormInput(true)
.addExtras(languageExtras)
.build()
@@ -107,7 +110,7 @@ fun CaseDetailScreen(
putExtra(RecognizerIntent.EXTRA_LANGUAGE_PREFERENCE, VOICE_INPUT_LANGUAGE)
}
RemoteInputIntentHelper.putRemoteInputsExtra(intent, listOf(remoteInput))
RemoteInputIntentHelper.putTitleExtra(intent, "OneLiner")
RemoteInputIntentHelper.putTitleExtra(intent, currentTitle)
editLauncher.launch(intent)
}