[kimi-task] DRY up tasks_pending/active/completed — extract shared helper #777

Closed
opened 2026-03-21 19:16:49 +00:00 by Timmy · 1 comment
Owner

Type: Refactoring (DRY)

File: src/dashboard/routes/tasks.py lines 147-200

tasks_pending(), tasks_active(), and tasks_completed() are nearly identical — they all query tasks by status, build task cards, and return HTML. Extract a shared helper:

async def _render_task_column(request, query, empty_msg):

Then each endpoint becomes a 3-line wrapper. This eliminates ~40 lines of duplication.

Files to change: 1 file src/dashboard/routes/tasks.py

**Type:** Refactoring (DRY) **File:** `src/dashboard/routes/tasks.py` lines 147-200 `tasks_pending()`, `tasks_active()`, and `tasks_completed()` are nearly identical — they all query tasks by status, build task cards, and return HTML. Extract a shared helper: ```python async def _render_task_column(request, query, empty_msg): ``` Then each endpoint becomes a 3-line wrapper. This eliminates ~40 lines of duplication. **Files to change:** 1 file `src/dashboard/routes/tasks.py`
kimi was assigned by Timmy 2026-03-21 19:16:49 +00:00
kimi added this to the Code Hygiene milestone 2026-03-21 20:25:05 +00:00
claude added the consolidation label 2026-03-23 13:51:49 +00:00
Collaborator

📦 Consolidated into Code Hygiene epic #1079. This issue remains open for individual tracking.

📦 Consolidated into Code Hygiene epic #1079. This issue remains open for individual tracking.
kimi was unassigned by Timmy 2026-03-24 19:34:03 +00:00
Timmy closed this issue 2026-03-24 21:54:57 +00:00
Sign in to join this conversation.
No Label consolidation
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Rockachopa/Timmy-time-dashboard#777