summaryrefslogtreecommitdiff
path: root/makima/frontend/src/hooks/useTasks.ts
diff options
context:
space:
mode:
authorsoryu <soryu@soryu.co>2026-01-22 13:17:17 +0000
committerGitHub <noreply@github.com>2026-01-22 13:17:17 +0000
commit265f8cf14fec9d7116d09af49e4b48b357faceda (patch)
treec98ff8be7dd5f01692446e01c7b568279b0635ac /makima/frontend/src/hooks/useTasks.ts
parenta363bfdd7a3e81b75bf230e45d001b80f759ca57 (diff)
downloadsoryu-265f8cf14fec9d7116d09af49e4b48b357faceda.tar.gz
soryu-265f8cf14fec9d7116d09af49e4b48b357faceda.zip
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 <noreply@anthropic.com> * 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 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Diffstat (limited to 'makima/frontend/src/hooks/useTasks.ts')
-rw-r--r--makima/frontend/src/hooks/useTasks.ts17
1 files changed, 17 insertions, 0 deletions
diff --git a/makima/frontend/src/hooks/useTasks.ts b/makima/frontend/src/hooks/useTasks.ts
index 6e6c992..4667c4c 100644
--- a/makima/frontend/src/hooks/useTasks.ts
+++ b/makima/frontend/src/hooks/useTasks.ts
@@ -5,6 +5,7 @@ import {
createTask,
updateTask,
deleteTask,
+ dismissTask,
VersionConflictError,
type TaskSummary,
type TaskWithSubtasks,
@@ -110,6 +111,21 @@ export function useTasks() {
[fetchTasks]
);
+ const hideTask = useCallback(
+ async (id: string): Promise<boolean> => {
+ setError(null);
+ try {
+ await dismissTask(id);
+ await fetchTasks(); // Refresh list
+ return true;
+ } catch (e) {
+ setError(e instanceof Error ? e.message : "Failed to dismiss task");
+ return false;
+ }
+ },
+ [fetchTasks]
+ );
+
// Initial fetch
useEffect(() => {
fetchTasks();
@@ -126,5 +142,6 @@ export function useTasks() {
saveTask,
editTask,
removeTask,
+ hideTask,
};
}