Skip to content

feat(todos): rich detail overlay with line navigation, commenting, and streamlined flow#40

Open
Fatih0234 wants to merge 2 commits into
mitsuhiko:mainfrom
Fatih0234:feat/todos-rich-overlay
Open

feat(todos): rich detail overlay with line navigation, commenting, and streamlined flow#40
Fatih0234 wants to merge 2 commits into
mitsuhiko:mainfrom
Fatih0234:feat/todos-rich-overlay

Conversation

@Fatih0234
Copy link
Copy Markdown

This replaces the read-only detail overlay with an interactive one and streamlines the list→detail flow.

Overlay improvements:

  • Line-by-line cursor navigation (↑/↓) with auto-scroll
  • Page scroll (←/→ or PgUp/PgDn)
  • Multi-select mode (v) to select body lines (s)
  • Comment extraction (n) — quotes selected/current line and prefills editor
  • Direct actions: Enter work, r refine, c close/reopen, d delete, Esc back

Flow changes:

  • Enter on list item goes straight to detail overlay (was: action menu)
  • a opens action menu for copy/release/delete operations
  • Unified delete confirmation used by both overlay and action menu

Closes #34

…d streamlined flow

This replaces the read-only detail overlay with an interactive one and
streamlines the list->detail flow.

Overlay improvements:
- Line-by-line cursor navigation (↑/↓) with auto-scroll
- Page scroll (←/→ or PgUp/PgDn)
- Multi-select mode (v) to select body lines (s)
- Comment extraction (n) — quotes selected/current line and prefills editor
- Direct actions: Enter work, r refine, c close/reopen, d delete, Esc back

Flow changes:
- Enter on list item goes straight to detail overlay (was: action menu)
- a opens action menu for copy/release/delete operations
- Unified delete confirmation used by both overlay and action menu

Closes mitsuhiko#34
Copilot AI review requested due to automatic review settings April 24, 2026 23:32
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR upgrades the todos TUI from a read-only detail overlay to an interactive overlay and streamlines list→detail navigation to make todos more usable and action-oriented.

Changes:

  • Adds an interactive todo detail overlay with cursor navigation, multi-select, comment extraction, and inline actions (work/refine/close/delete).
  • Changes the list flow so Enter opens the detail overlay directly and a opens the action menu.
  • Introduces a shared delete confirmation flow usable from both overlay and action menu paths.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread extensions/todos.ts Outdated
Comment on lines +449 to +453
if (keyData === "a" || keyData === "A") {
const selected = this.filteredTodos[this.selectedIndex];
if (selected && this.onActionMenu) this.onActionMenu(selected);
return;
}
Copy link

Copilot AI Apr 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Binding plain "a" to open the action menu prevents users from typing the letter "a" into the search input (since this handler runs before passing input to this.searchInput.handleInput). Consider using a modified key (e.g., Ctrl/Alt+...)
, or only triggering the action menu when the list (not the input) has focus.

Copilot uses AI. Check for mistakes.
Comment thread extensions/todos.ts Outdated
Comment on lines 2092 to 2096
deleteConfirm = new TodoDeleteConfirmComponent(theme, message, (confirmed) => {
if (!confirmed) {
setActiveComponent(selector);
return;
}
Copy link

Copilot AI Apr 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

confirmDelete always returns to the selector when the user cancels (!confirmed). When delete is initiated from the action menu, this changes the prior flow (cancel used to return to the action menu) and makes it impossible to continue from the menu after backing out. Consider letting confirmDelete accept a "return" component/callback (e.g., selector vs actionMenu) and using the appropriate one per caller.

Copilot uses AI. Check for mistakes.
Comment thread extensions/todos.ts Outdated
Comment on lines +2098 to +2105
const result = await deleteTodo(todosDir, record.id, ctx);
if ("error" in result) {
ctx.ui.notify(result.error, "error");
} else {
const updatedTodos = await listTodos(todosDir);
selector?.setTodos(updatedTodos);
ctx.ui.notify(`Deleted todo ${formatTodoId(record.id)}`, "info");
}
Copy link

Copilot AI Apr 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

confirmDelete duplicates the delete+refresh+notify logic that already exists in applyTodoAction for "delete". This duplication risks behavioral drift (e.g., notifications, refresh behavior, future error handling). Consider reusing the existing applyTodoAction(record, "delete") path (or extracting a shared helper) and then handling the post-action navigation (setActiveComponent(...)) in one place.

Suggested change
const result = await deleteTodo(todosDir, record.id, ctx);
if ("error" in result) {
ctx.ui.notify(result.error, "error");
} else {
const updatedTodos = await listTodos(todosDir);
selector?.setTodos(updatedTodos);
ctx.ui.notify(`Deleted todo ${formatTodoId(record.id)}`, "info");
}
await applyTodoAction(record, "delete");

Copilot uses AI. Check for mistakes.
Comment thread extensions/todos.ts Outdated
Comment on lines +254 to +257
function stripAnsi(str: string): string {
// eslint-disable-next-line no-control-regex
return str.replace(/\x1B\[[0-9;]*m/g, "");
}
Copy link

Copilot AI Apr 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is already a similar ANSI-stripping regex defined in extensions/prompt-editor.ts (inline in its render). Consider centralizing this helper (e.g., a shared util) to avoid duplicated regexes diverging over time.

Copilot uses AI. Check for mistakes.
- Bind action menu to Ctrl+A instead of plain 'a' to avoid clashing with search input
- Fix confirmDelete to return to action menu when canceled from there
- Reuse applyTodoAction for delete instead of duplicating logic
- Extract shared stripAnsi utility into extensions/lib/utils.ts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Todos are not usable

2 participants