Add focus activation, 3-zone drag nesting, and click-to-navigate
Some checks failed
Node.js build / build (22.x) (push) Has been cancelled
Node.js build / build (20.x) (push) Has been cancelled

Implement remaining Round 3 enhancements:
- ArrowDown when panel unfocused activates it at first item (like Outline view)
- 3-zone drag-drop: top/bottom thirds insert above/below, middle third nests as child
- Click on todo text to focus it in editor (onClick callback)
- Dragging parent automatically moves nested children (stopPropagation fix)
- Cross-file move inserts todo below heading with blank line (addBlankLine param)
- Updated CLAUDE.md with sidebar view architecture documentation

Build: 85 tests pass, production build succeeds.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-02-20 10:17:27 -08:00
parent 349810aecf
commit a00b96231c
8 changed files with 263 additions and 31 deletions

View File

@@ -4,6 +4,7 @@ import type { TodoItem } from '../core/types';
export interface TodoItemCallbacks {
onToggle: (todo: TodoItem) => void;
onMoveClick: (todo: TodoItem) => void;
onClick: (todo: TodoItem) => void;
onDragStart: (evt: DragEvent, todo: TodoItem) => void;
onDragEnd: (evt: DragEvent) => void;
}
@@ -40,12 +41,16 @@ export function createTodoItemEl(
callbacks.onToggle(todo);
});
// Text content
// Text content — click to navigate to editor
const textEl = itemEl.createEl('span', { cls: 'todo-tracker-item-text' });
textEl.setText(todo.text);
if (todo.completed) {
textEl.addClass('todo-tracker-item-completed');
}
textEl.addEventListener('click', (evt) => {
evt.stopPropagation();
callbacks.onClick(todo);
});
// Right-click context menu
itemEl.addEventListener('contextmenu', (evt) => {
@@ -65,12 +70,14 @@ export function createTodoItemEl(
menu.showAtMouseEvent(evt);
});
// Drag events
// Drag events — stopPropagation so nested children don't bubble to parent
itemEl.addEventListener('dragstart', (evt) => {
evt.stopPropagation();
callbacks.onDragStart(evt, todo);
});
itemEl.addEventListener('dragend', (evt) => {
evt.stopPropagation();
callbacks.onDragEnd(evt);
});