feat(web): add "New Task" button scroll-to-input behavior

Clicking the header "New Task" button now scrolls to and focuses
the create-task input in the Pending column.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-01 23:29:49 -05:00
parent 6ea0e40d38
commit 5a273ba667

View File

@@ -111,6 +111,18 @@
// Initialize Kanban drag-and-drop on page load
document.addEventListener('DOMContentLoaded', function() {
initKanban();
// "New Task" header button — scroll to and focus the create-task input in the Pending column
var newTaskBtn = document.getElementById('new-task-trigger');
if (newTaskBtn) {
newTaskBtn.addEventListener('click', function() {
var input = document.querySelector('.create-task-form input[name="title"]');
if (input) {
input.scrollIntoView({ behavior: 'smooth', block: 'center' });
input.focus();
}
});
}
});
// Re-initialize after htmx swaps that affect the kanban board.