From 44cfe3f714ed74e0a8c0f0405e8f80f597449a2c Mon Sep 17 00:00:00 2001 From: Bendt Date: Fri, 19 Dec 2025 16:39:01 -0500 Subject: [PATCH] Fix search input stealing focus on app launch - explicitly focus main widget --- src/calendar/app.py | 3 +++ src/tasks/app.py | 3 +++ 2 files changed, 6 insertions(+) diff --git a/src/calendar/app.py b/src/calendar/app.py index 96b7f4a..1ff6d09 100644 --- a/src/calendar/app.py +++ b/src/calendar/app.py @@ -236,6 +236,9 @@ class CalendarApp(App): self._update_status() self._update_title() + # Focus the week grid (not the hidden search input) + self.query_one("#week-grid", WeekGrid).focus() + def _on_ipc_message(self, message: IPCMessage) -> None: """Handle IPC messages from sync daemon.""" if message.event == "refresh": diff --git a/src/tasks/app.py b/src/tasks/app.py index aa655fc..ad37345 100644 --- a/src/tasks/app.py +++ b/src/tasks/app.py @@ -315,6 +315,9 @@ class TasksApp(App): # Load tasks (filtered by current filters) self.load_tasks() + # Focus the task table (not the hidden search input) + table.focus() + def _setup_columns(self, table: DataTable, columns: list[str]) -> None: """Setup table columns with dynamic widths based on available space.""" # Minimum widths for each column type