after deleting multiple subtasks, select subtask directly before selected chunk

Hunter
Sunday, March 8th, 2026 at 12:02 AM

index.html+4 

index.html
621  									const toDelete = selected.filter(t => t !== taskPath[0] && t !== currentTask)
622  									// Don't delete if it would leave the root task with no subtasks
623  									if (toDelete.length > 0 && !(currentTask.id === 'root' && toDelete.length >= currentTask.subtasks.length)) {
624 +										// Find the index of the first task to delete (for post-delete selection)
625 +										const firstDeleteIdx = Math.min(...toDelete.map(t => currentTask.subtasks.findIndex(s => s.id === t.id)).filter(i => i !== -1))
626  										for (const t of toDelete) {
627  											const idx = currentTask.subtasks.findIndex(s => s.id === t.id)
628  											if (idx !== -1) currentTask.subtasks.splice(idx, 1)

633  											navigateToParentTask()
634  										} else {
635  											renderCurrentView()
636 +											const targetIndex = Math.max(0, firstDeleteIdx - 1)
637 +											selectAndFocusTask(currentTask.subtasks[targetIndex])
638  										}
639  										scheduleSave()
640  									} else {