Skip to content

Open keyboard and focus title field when editing a task#6

Merged
benju69 merged 1 commit into
mainfrom
copilot/open-keyboard-on-task-edit
Apr 12, 2026
Merged

Open keyboard and focus title field when editing a task#6
benju69 merged 1 commit into
mainfrom
copilot/open-keyboard-on-task-edit

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 12, 2026

When opening the task editor for an existing task, the keyboard wasn't shown and the title field wasn't focused — focus was only requested for new tasks.

Change

Removed the else guard so titleFocusRequester.requestFocus() runs unconditionally after loadTask is dispatched, covering both create and edit flows:

LaunchedEffect(taskId) {
    if (taskId != null) {
        viewModel.loadTask(taskId)
    }
    try {
        titleFocusRequester.requestFocus()
    } catch (e: IllegalStateException) {
        // Ignore focus request failures, e.g., if the view is not yet attached
    }
}

loadTask is async (IO dispatcher), so focus is requested while the coroutine loads data in the background — no UX delay.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Ensures the task editor automatically focuses the title field (and shows the keyboard) when editing an existing task, not only when creating a new one.

Changes:

  • Removed the else guard so titleFocusRequester.requestFocus() runs for both “new” and “edit” flows after optionally dispatching loadTask.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-actions
Copy link
Copy Markdown

📦 Debug APK ready

Download app-debug.apk

@benju69 benju69 merged commit 677740b into main Apr 12, 2026
5 checks passed
@benju69 benju69 deleted the copilot/open-keyboard-on-task-edit branch April 12, 2026 13:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants