Add deferred focus retry after worker completes and log focus restoration
- SHA
11a976f9fc40d880c12506e4d98b8bf9861c8d24- Parents
-
ac30b95 - Tree
b29f575
11a976f
11a976f9fc40d880c12506e4d98b8bf9861c8d24ac30b95
b29f575| Status | File | + | - |
|---|---|---|---|
| M |
src/loader/ui/app.py
|
5 | 1 |
src/loader/ui/app.pymodified@@ -571,7 +571,11 @@ class LoaderApp(App): | ||
| 571 | 571 | self.query_one(StatusLine).set_generating(False) |
| 572 | 572 | self.query_one(StatusLine).update_turn_phase("") |
| 573 | 573 | # Restore input focus so user can type the next message |
| 574 | - self.query_one(InputArea).focus_input() | |
| 574 | + self._debug_log("worker done — restoring input focus") | |
| 575 | + input_area = self.query_one(InputArea) | |
| 576 | + input_area.focus_input() | |
| 577 | + # Deferred retry in case the immediate focus is too early | |
| 578 | + self.set_timer(0.2, input_area.focus_input) | |
| 575 | 579 | |
| 576 | 580 | # Message handlers from adapter |
| 577 | 581 | def on_thinking_started(self, message: ThinkingStarted) -> None: |