From 5a273ba667c5f4f59f8e0bea1737fcb485c38b2a Mon Sep 17 00:00:00 2001 From: AJ Isaacs Date: Sun, 1 Mar 2026 23:29:49 -0500 Subject: [PATCH] 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 --- TaskTracker.Api/wwwroot/js/app.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/TaskTracker.Api/wwwroot/js/app.js b/TaskTracker.Api/wwwroot/js/app.js index 3f9ea52..217f678 100644 --- a/TaskTracker.Api/wwwroot/js/app.js +++ b/TaskTracker.Api/wwwroot/js/app.js @@ -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.