From 265f8cf14fec9d7116d09af49e4b48b357faceda Mon Sep 17 00:00:00 2001 From: soryu Date: Thu, 22 Jan 2026 13:17:17 +0000 Subject: Fix completion actions: default to PR and support remote repos (#21) * Fix completion actions: default to PR and support remote repos - Change default completion action from 'branch' to 'pr' for tasks using daemon working directory - Allow PR completion action to work without target_repo_path if the worktree already has an origin remote configured (e.g., when cloned from a remote URL) - Update create_pull_request to accept optional target_repo parameter Co-Authored-By: Claude Opus 4.5 * Add dismiss functionality for completed standalone tasks ## Changes ### Backend - Add 'hidden' field to Task model (models.rs) - Add database migration for hidden column (20250122000000_add_task_hidden.sql) - Update task listing queries to include hidden field and filter out hidden tasks - Update update_task_for_owner to handle hidden field ### Frontend - Add hidden field to TaskSummary interface (api.ts) - Add dismissTask API function (api.ts) - Add hideTask function to useTasks hook - Add Dismiss button to TaskList for completed standalone tasks - Wire up onDismiss handler in mesh.tsx route ## Behavior - Completed standalone tasks (tasks without a contract) show a "Dismiss" button - Dismissing a task sets hidden=true and removes it from the task list - Hidden tasks are filtered out by default in all task listing queries Co-Authored-By: Claude Opus 4.5 --------- Co-authored-by: Claude Opus 4.5 --- makima/src/db/models.rs | 12 ++++++++++++ makima/src/db/repository.rs | 25 +++++++++++++++---------- 2 files changed, 27 insertions(+), 10 deletions(-) (limited to 'makima/src/db') diff --git a/makima/src/db/models.rs b/makima/src/db/models.rs index bf95a3a..6ede268 100644 --- a/makima/src/db/models.rs +++ b/makima/src/db/models.rs @@ -525,6 +525,12 @@ pub struct Task { /// Used to track the origin of "what if" explorations. #[serde(skip_serializing_if = "Option::is_none")] pub branched_from_task_id: Option, + + // UI visibility + /// Whether this task is hidden from the UI (user dismissed it). + /// Standalone completed tasks can be dismissed by the user. + #[serde(default)] + pub hidden: bool, } impl Task { @@ -564,6 +570,9 @@ pub struct TaskSummary { /// True for contract supervisor tasks #[serde(default)] pub is_supervisor: bool, + /// Whether this task is hidden from the UI (user dismissed it) + #[serde(default)] + pub hidden: bool, pub created_at: DateTime, pub updated_at: DateTime, } @@ -586,6 +595,7 @@ impl From for TaskSummary { subtask_count: 0, // Would need separate query version: task.version, is_supervisor: task.is_supervisor, + hidden: task.hidden, created_at: task.created_at, updated_at: task.updated_at, } @@ -670,6 +680,8 @@ pub struct UpdateTaskRequest { /// Explicitly clear daemon_id (set to NULL) #[serde(default)] pub clear_daemon_id: bool, + /// Whether this task is hidden from the UI (user dismissed it) + pub hidden: Option, /// Version for optimistic locking pub version: Option, } diff --git a/makima/src/db/repository.rs b/makima/src/db/repository.rs index 7387735..84afc8d 100644 --- a/makima/src/db/repository.rs +++ b/makima/src/db/repository.rs @@ -733,6 +733,7 @@ pub async fn get_task(pool: &PgPool, id: Uuid) -> Result, sqlx::Err } /// List all top-level tasks (no parent), ordered by created_at DESC. +/// Hidden tasks are excluded by default. pub async fn list_tasks(pool: &PgPool) -> Result, sqlx::Error> { sqlx::query_as::<_, TaskSummary>( r#" @@ -742,10 +743,10 @@ pub async fn list_tasks(pool: &PgPool) -> Result, sqlx::Error> 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, - t.version, t.is_supervisor, t.created_at, t.updated_at + t.version, t.is_supervisor, COALESCE(t.hidden, false) as hidden, t.created_at, t.updated_at FROM tasks t LEFT JOIN contracts c ON t.contract_id = c.id - WHERE t.parent_task_id IS NULL + WHERE t.parent_task_id IS NULL AND COALESCE(t.hidden, false) = false ORDER BY t.priority DESC, t.created_at DESC "#, ) @@ -763,7 +764,7 @@ pub async fn list_subtasks(pool: &PgPool, parent_id: Uuid) -> Result