memos icon indicating copy to clipboard operation
memos copied to clipboard

Add remove completed tasks to memo actions

Open kv1sidisi opened this issue 5 months ago â€ĸ 1 comments

  • Remove completed task items from the memo task menu using the existing markdown task helpers.
  • Add regression coverage for multi-line task removal and preserve code-block content.

kv1sidisi avatar Jun 09 '26 17:06 kv1sidisi

Review Change Stack

No actionable comments were generated in the recent review. 🎉

â„šī¸ Recent review info
âš™ī¸ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 7b315d70-5df8-41d8-bec7-29845f63a88a

đŸ“Ĩ Commits

Reviewing files that changed from the base of the PR and between 8080bd10e1301a03609bc188800371c541fcf004 and 167f76ddbab58f09317decadeb5f0a1994828ee7.

📒 Files selected for processing (6)
  • web/src/components/MemoActionMenu/MemoActionMenu.tsx
  • web/src/components/MemoActionMenu/hooks.ts
  • web/src/locales/en-GB.json
  • web/src/locales/en.json
  • web/src/utils/markdown-task-actions.ts
  • web/tests/markdown-task-actions.test.ts

📝 Walkthrough

Walkthrough

This PR adds a "Remove completed tasks" feature to the memo editor. Task items are extended to track their full-line ranges in the markdown, a utility function removes completed items by clearing those ranges, the action is wired through the menu hook and handler, and a trash-icon UI control with i18n labels renders the feature in the task-actions submenu.

Changes

Remove Completed Tasks

Layer / File(s) Summary
Task item line range tracking
web/src/utils/markdown-task-actions.ts
ParsedTaskItem now includes lineRange to record each task's full-line offsets. parseTaskItems() computes line ranges from the task's start offset through the next line boundary (or markdown end), enabling precise deletion of entire task lines.
Task removal utility
web/src/utils/markdown-task-actions.ts
New removeCompletedTasks(markdown: string) function exports removal logic. It identifies completed tasks and applies blank edits across each item's line range to delete them from the content.
Action handler wiring
web/src/components/MemoActionMenu/hooks.ts
useMemoActionHandlers hook imports the removal utility and creates handleRemoveCompletedTaskListItemsClick, which invokes updateMemoContent() with the removal logic and an appropriate context string, then exports the handler.
Component UI and localization
web/src/components/MemoActionMenu/MemoActionMenu.tsx, web/src/locales/en.json, web/src/locales/en-GB.json
MemoActionMenu imports Trash2Icon, destructures the removal handler, and renders a new dropdown menu item in the task-actions submenu (disabled when no completed tasks exist). English locale files add the task-actions.remove-completed label "Remove completed tasks".
Test coverage
web/tests/markdown-task-actions.test.ts
New test suite validates that removeCompletedTasks removes completed task lines, preserves remaining content, handles edge cases (empty input, no completed tasks), and correctly ignores task-like patterns inside fenced and inline code blocks.
đŸšĨ Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage âš ī¸ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Add remove completed tasks to memo actions' clearly and concisely summarizes the main change: adding a new feature to remove completed tasks from the memo action menu.
Description check ✅ Passed The description is directly related to the changeset, explaining the core functionality (removing completed task items using markdown helpers) and test coverage (regression tests for multi-line removal and code-block preservation).
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

âœī¸ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

â¤ī¸ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

coderabbitai[bot] avatar Jun 09 '26 17:06 coderabbitai[bot]