[claude] DRY up tasks_pending/active/completed in tasks.py (#942) #1020
Reference in New Issue
Block a user
Delete Branch "claude/issue-942"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fixes #942
Extracts a
_render_task_list()helper that consolidates the identical fetch→render→join pattern shared by the three HTMX partial endpoints (tasks_pending,tasks_active,tasks_completed).Before: Each endpoint had ~15 lines of duplicated logic (DB query, row conversion, template rendering loop, empty-state fallback).
After: Each endpoint is a 4-line call to the shared helper. Net reduction: 15 lines (-45/+30).
All existing tests pass (10 pre-existing failures in calm/tools are unrelated).