@@ -12,7 +12,6 @@ import androidx.compose.material3.Surface
1212import androidx.compose.runtime.Composable
1313import androidx.compose.runtime.LaunchedEffect
1414import androidx.compose.runtime.remember
15- import androidx.compose.runtime.withFrameNanos
1615import androidx.compose.ui.Modifier
1716import androidx.compose.ui.focus.FocusRequester
1817import androidx.compose.ui.input.pointer.pointerInput
@@ -36,9 +35,11 @@ import com.softartdev.notedelight.feature.console.ui.theme.rememberConsoleTheme
3635 * - Inside, a single scrolling [Column] contains the read-only [ConsoleHistoryCanvas] followed
3736 * directly by the active [ConsoleInputRow]. The two share typography and palette from
3837 * [ConsoleTheme] so visually the input is the last line of the transcript.
39- * - [FocusRequester] is requested on first composition so the keyboard pops without an extra
40- * tap. A transparent tap-gesture detector on the surface re-focuses the input when the user
41- * taps anywhere in the history — a common terminal affordance.
38+ * - A transparent tap-gesture detector on the surface focuses the input when the user taps
39+ * anywhere in the history — a common terminal affordance. Auto-focus on entry is deliberately
40+ * omitted: `requestFocus()` triggers an async `bringIntoView()` that crashes before layout
41+ * completes on Android, and `withFrameNanos` (which would defer it past layout) blocks
42+ * `waitForIdle()` on wasmJs Chrome Headless in CI.
4243 * - [Modifier.imePadding] prevents the Android soft keyboard from hiding the input line.
4344 * - Auto-scroll fires on either (a) the buffer growing (execution appended history) or (b) the
4445 * input gaining/losing a `\n` (continuation line added/removed), keeping the caret visible.
@@ -58,15 +59,6 @@ fun ConsoleSurface(
5859 val focusRequester: FocusRequester = remember { FocusRequester () }
5960 val scrollState = rememberScrollState()
6061
61- // Auto-focus the input on entry so the keyboard pops without an extra tap.
62- // Wait one frame so the surrounding layout (verticalScroll Column) is placed before the
63- // BasicTextField's internal BringIntoViewRequester reacts to focus — otherwise it throws
64- // "Expected BringIntoViewRequester to not be used before parents are placed."
65- LaunchedEffect (Unit ) {
66- withFrameNanos { }
67- runCatching { focusRequester.requestFocus() }
68- }
69-
7062 // Auto-scroll to the bottom whenever history or multi-line input grows/shrinks.
7163 val inputNewlineCount: Int = inputText.count { it == ' \n ' }
7264 LaunchedEffect (buffer.lineCount, inputNewlineCount, running) {
0 commit comments