fix(#206): read clarify.request question/choices from gateway (#355)

* fix(#206): read clarify.request question/choices from gateway

The Hermes TUI gateway sends clarify.request payloads with "question" and "choices" fields, but the Android parser was looking for "text" and "options" — so the text was always null and the dialog showed only the input box.

Fix reads "question"/"choices" first, falls back to "text"/"options" for backward compat.

Test added for the new field names; existing test for legacy names still passes.

* fix(#206): clear default text in clarify input field

The input box was pre-filled with the clarify question text because the initial state was set to clarify.text instead of empty string.

* fix: use JsonRpcResponse instead of undefined WsResponse in EventParserTest

---------

Co-authored-by: M57 <hy4ri@users.noreply.github.com>
This commit is contained in:
M57andM57 authored and GitHub committed 2026-06-24 23:54:47 +03:00
1 parent e7b2973c1c
commit 1bd56270b3
3 files changed
+35 -3

No files matched your search

@@ -842,7 +842,7 @@ private fun ClarifyDialog(
onOptionSelected: (String) -> Unit,
onDismiss: () -> Unit,
) {
var typedText by rememberSaveable(clarify.text) { mutableStateOf(clarify.text) }
var typedText by rememberSaveable(clarify.text) { mutableStateOf("") }
AlertDialog(
onDismissRequest = onDismiss,