Review fixes: keep the keyboard off the settings form, and key the waits apart
The settings dialog was a dialog, so the platform moved it off the keyboard; a screen is not, and the lower half of the form was under it. A tool call registered its abandonable wait under the call's own id, which the model chooses -- one named `generating` would have taken the turn's entry and left the other wait with nobody to answer it.
This commit is contained in:
1 parent
7278a58387
commit
4b5ed6e398
2 files changed
+9
-3
No files matched your search
@@ -8,6 +8,7 @@ import androidx.compose.foundation.layout.Spacer
|
||||
import androidx.compose.foundation.layout.fillMaxSize
|
||||
import androidx.compose.foundation.layout.fillMaxWidth
|
||||
import androidx.compose.foundation.layout.height
|
||||
import androidx.compose.foundation.layout.imePadding
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.foundation.layout.width
|
||||
import androidx.compose.foundation.rememberScrollState
|
||||
@@ -300,7 +301,9 @@ fun SessionSettingsScreen(
|
||||
BackHandler(onBack = onDismiss)
|
||||
var tab by remember(sessionId) { mutableIntStateOf(0) }
|
||||
Surface(Modifier.fillMaxSize()) {
|
||||
Column(Modifier.fillMaxSize()) {
|
||||
// The keyboard covers the lower half of a form of fields, and this is a screen rather
|
||||
// than a dialog now -- nothing else is going to move it out of the way.
|
||||
Column(Modifier.fillMaxSize().imePadding()) {
|
||||
Row(
|
||||
verticalAlignment = Alignment.CenterVertically,
|
||||
modifier = Modifier.fillMaxWidth().padding(horizontal = 16.dp),
|
||||
|
||||
@@ -1433,7 +1433,9 @@ fn run_tool(
|
||||
// Read here rather than in the thread: the filter is live, and this is the
|
||||
// call it applies to.
|
||||
let chosen = shared.tools_wanted.lock().unwrap().clone();
|
||||
awaiting(shared, &call.id, cancel, move || {
|
||||
// Keyed apart from the turn's own wait, which the model could otherwise
|
||||
// collide with by naming a call `generating`.
|
||||
awaiting(shared, &format!("call:{}", call.id), cancel, move || {
|
||||
match tools.execute(&name, &arguments, cwd.as_deref(), &chosen) {
|
||||
Ok(output) => output,
|
||||
// Reaching the tool failed, which is this server's problem and not
|
||||
@@ -1448,7 +1450,8 @@ fn run_tool(
|
||||
|
||||
/// The id [`awaiting`] registers a completion under. One name is enough: a
|
||||
/// session runs one turn at a time, and an abandoned turn's entry is taken by
|
||||
/// the abandoning.
|
||||
/// the abandoning. A tool call's id is prefixed rather than used raw, so the
|
||||
/// model cannot name a call this and take the turn's own entry.
|
||||
const GENERATING: &str = "generating";
|
||||
|
||||
/// Runs `work` on a thread of its own and waits for it in a way an interrupt
|
||||
|
||||
Reference in new issue
Block a user