feat: inline edit and delete for subtasks (#25) #30

Merged
maximus merged 1 commit from issue-25-edit-delete-subtasks into master 2026-03-31 00:13:04 +00:00
Owner

Fixes #25

Summary

  • Long-press a subtask to edit its title inline (TextInput with auto-focus)
  • Enter/blur saves, empty title cancels
  • X button on each subtask with delete confirmation
  • Tap still toggles completion
  • Added FR/EN translations for task.deleteSubtaskConfirm

Test plan

  • Long-press a subtask → TextInput appears with current title
  • Edit title + press Enter → title updated in DB
  • Clear title + blur → original title restored
  • Tap subtask → toggles completion (no conflict with long-press)
  • Tap X → confirmation alert → subtask deleted
  • Verify FR and EN translations
Fixes #25 ## Summary - Long-press a subtask to edit its title inline (TextInput with auto-focus) - Enter/blur saves, empty title cancels - X button on each subtask with delete confirmation - Tap still toggles completion - Added FR/EN translations for `task.deleteSubtaskConfirm` ## Test plan - [ ] Long-press a subtask → TextInput appears with current title - [ ] Edit title + press Enter → title updated in DB - [ ] Clear title + blur → original title restored - [ ] Tap subtask → toggles completion (no conflict with long-press) - [ ] Tap X → confirmation alert → subtask deleted - [ ] Verify FR and EN translations
maximus added 1 commit 2026-03-30 23:36:38 +00:00
Long-press a subtask to edit its title inline. Tap X to delete
with confirmation. Tap still toggles completion.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
maximus added the
status:review
label 2026-03-30 23:36:45 +00:00
Author
Owner

Review — APPROVE

Clean, focused implementation of inline subtask editing (long-press) and deletion (X button with confirmation). Code follows project conventions, translations are in both languages, and the logic is correct.

Suggestions (non-blocking)

  1. app/task/[id].tsx L427-428handleSaveSubtaskEdit is bound to both onSubmitEditing and onBlur. Pressing Enter triggers both events, causing a double invocation. The if (!editingSubtaskId) return guard prevents a crash, but due to React's async state batching, both calls could race and fire updateTask twice. Consider using a useRef flag to guarantee single execution.

  2. app/task/[id].tsx L410onPress={() => editingSubtaskId === sub.id ? undefined : handleToggleSubtask(sub.id)} — returning undefined from the press handler works but is a bit subtle. A slightly clearer pattern: onPress={() => { if (editingSubtaskId === sub.id) return; handleToggleSubtask(sub.id); }}.


Reviewed by Claude Code

## Review — APPROVE ✅ Clean, focused implementation of inline subtask editing (long-press) and deletion (X button with confirmation). Code follows project conventions, translations are in both languages, and the logic is correct. ### Suggestions (non-blocking) 1. **`app/task/[id].tsx` L427-428** — `handleSaveSubtaskEdit` is bound to both `onSubmitEditing` and `onBlur`. Pressing Enter triggers both events, causing a double invocation. The `if (!editingSubtaskId) return` guard prevents a crash, but due to React's async state batching, both calls could race and fire `updateTask` twice. Consider using a `useRef` flag to guarantee single execution. 2. **`app/task/[id].tsx` L410** — `onPress={() => editingSubtaskId === sub.id ? undefined : handleToggleSubtask(sub.id)}` — returning `undefined` from the press handler works but is a bit subtle. A slightly clearer pattern: `onPress={() => { if (editingSubtaskId === sub.id) return; handleToggleSubtask(sub.id); }}`. --- *Reviewed by Claude Code*
maximus merged commit 9b1f7e79c9 into master 2026-03-31 00:13:04 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: maximus/simpl-liste#30
No description provided.