Add remove completed tasks to memo actions
- 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.
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.tsxweb/src/components/MemoActionMenu/hooks.tsweb/src/locales/en-GB.jsonweb/src/locales/en.jsonweb/src/utils/markdown-task-actions.tsweb/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.
Comment @coderabbitai help to get the list of available commands and usage tips.