summaryrefslogtreecommitdiff
path: root/makima/src/db/repository.rs
diff options
context:
space:
mode:
authorsoryu <soryu@soryu.co>2026-01-18 18:02:08 +0000
committerGitHub <noreply@github.com>2026-01-18 18:02:08 +0000
commite0da93a20a965125ba4cbb46e3e0e179f06c2a08 (patch)
tree5d127394e1dfa921c5d09fe8f10d716f6548d168 /makima/src/db/repository.rs
parent869f21ee2efaefed6a5aa4fbd417c25df8dec02a (diff)
downloadsoryu-e0da93a20a965125ba4cbb46e3e0e179f06c2a08.tar.gz
soryu-e0da93a20a965125ba4cbb46e3e0e179f06c2a08.zip
Improve Mesh Tab: Organize by contract with status filter (#5)
* Add status filter toggle to Mesh Tab TaskList component Add a filter toggle at the top of the TaskList that allows filtering by contract status (All, Active, Completed, Archive) with Active as the default. Changes: - Backend: Add contract_status field to TaskSummary struct in models.rs - Backend: Update all SQL queries returning TaskSummary to include c.status as contract_status from the contracts table join - Frontend: Add contractStatus to TaskSummary TypeScript type - Frontend: Add useState for statusFilter with 'active' as default - Frontend: Add filter button group in header area next to '+ New Task' - Frontend: Update groupedTasks useMemo to filter based on contract status - Frontend: Update empty state message to reflect current filter Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * Task completion checkpoint * feat(mesh): show all contract tasks for supervisor tasks When viewing a supervisor task (task.isSupervisor === true), the TaskDetail component now shows all tasks in the contract instead of showing the subtasks tree. Changes: - Add contractTasks prop to TaskDetailProps for passing contract tasks - Add displayTasks computed value that uses contractTasks for supervisors - Change section header from "Subtasks" to "Contract Tasks" for supervisors - Hide the "+ Add Subtask" button for supervisor tasks - Update empty state message for supervisors - Fetch contract tasks in mesh.tsx when viewing a supervisor task - Filter out the supervisor itself from the contract tasks list Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * Task completion checkpoint * Task completion checkpoint --------- Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Diffstat (limited to 'makima/src/db/repository.rs')
-rw-r--r--makima/src/db/repository.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/makima/src/db/repository.rs b/makima/src/db/repository.rs
index 3d1efd1..36e6bc1 100644
--- a/makima/src/db/repository.rs
+++ b/makima/src/db/repository.rs
@@ -735,6 +735,7 @@ pub async fn list_tasks(pool: &PgPool) -> Result<Vec<TaskSummary>, sqlx::Error>
r#"
SELECT
t.id, t.contract_id, c.name as contract_name, c.phase as contract_phase,
+ c.status as contract_status,
t.parent_task_id, t.depth, t.name, t.status, t.priority,
t.progress_summary,
(SELECT COUNT(*) FROM tasks WHERE parent_task_id = t.id) as subtask_count,
@@ -755,6 +756,7 @@ pub async fn list_subtasks(pool: &PgPool, parent_id: Uuid) -> Result<Vec<TaskSum
r#"
SELECT
t.id, t.contract_id, c.name as contract_name, c.phase as contract_phase,
+ c.status as contract_status,
t.parent_task_id, t.depth, t.name, t.status, t.priority,
t.progress_summary,
(SELECT COUNT(*) FROM tasks WHERE parent_task_id = t.id) as subtask_count,
@@ -1129,6 +1131,7 @@ pub async fn list_tasks_for_owner(
r#"
SELECT
t.id, t.contract_id, c.name as contract_name, c.phase as contract_phase,
+ c.status as contract_status,
t.parent_task_id, t.depth, t.name, t.status, t.priority,
t.progress_summary,
(SELECT COUNT(*) FROM tasks WHERE parent_task_id = t.id) as subtask_count,
@@ -1154,6 +1157,7 @@ pub async fn list_subtasks_for_owner(
r#"
SELECT
t.id, t.contract_id, c.name as contract_name, c.phase as contract_phase,
+ c.status as contract_status,
t.parent_task_id, t.depth, t.name, t.status, t.priority,
t.progress_summary,
(SELECT COUNT(*) FROM tasks WHERE parent_task_id = t.id) as subtask_count,
@@ -1671,6 +1675,7 @@ pub async fn list_sibling_tasks(
r#"
SELECT
t.id, t.contract_id, c.name as contract_name, c.phase as contract_phase,
+ c.status as contract_status,
t.parent_task_id, t.depth, t.name, t.status, t.priority,
t.progress_summary,
(SELECT COUNT(*) FROM tasks WHERE parent_task_id = t.id) as subtask_count,
@@ -1692,6 +1697,7 @@ pub async fn list_sibling_tasks(
r#"
SELECT
t.id, t.contract_id, c.name as contract_name, c.phase as contract_phase,
+ c.status as contract_status,
t.parent_task_id, t.depth, t.name, t.status, t.priority,
t.progress_summary,
(SELECT COUNT(*) FROM tasks WHERE parent_task_id = t.id) as subtask_count,
@@ -2669,6 +2675,7 @@ pub async fn list_tasks_in_contract(
r#"
SELECT
t.id, t.contract_id, c.name as contract_name, c.phase as contract_phase,
+ c.status as contract_status,
t.parent_task_id, t.depth, t.name, t.status, t.priority,
t.progress_summary,
(SELECT COUNT(*) FROM tasks WHERE parent_task_id = t.id) as subtask_count,