commit e0108411fee7f6fc172f9794dd30a30019242df1
parent c5022f1898b9cf06ec27f06b8d3cb752931b73b5
Author: Hunter
Date:   Mon, 31 Mar 2025 23:45:40 -0400

center active task when navigating up/down with arrow keys

Diffstat:
M.gitignore | 2++
Mindex.html | 13+++++++++++++
2 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/.gitignore b/.gitignore @@ -1 +1,3 @@ CLAUDE.md + +**/CLAUDE.local.md diff --git a/index.html b/index.html @@ -912,6 +912,19 @@ updateBreadcrumbs(task); lastSubtaskDownArrowReleased = isLastSubtask(task); input.focus(); + + // Center the active task in the viewport + setTimeout(() => { + const activeTaskElement = document.querySelector('.task-container.active'); + if (activeTaskElement && activeTaskElement.parentElement && activeTaskElement.parentElement.tagName === 'LI') { + // Use scrollIntoView with block: "center" to center the element vertically + activeTaskElement.scrollIntoView({ + behavior: 'auto', // Use 'auto' for immediate scrolling + block: 'center', // Center vertically + inline: 'nearest' // Don't change horizontal scroll + }); + } + }, 10); } function updateBreadcrumbs(selectedTask) {