From e3033b6a71b61d7e560404583e96ac80356029a0 Mon Sep 17 00:00:00 2001 From: Louis Knight-Webb Date: Thu, 19 Jun 2025 21:41:18 -0400 Subject: [PATCH] Add merged flag --- backend/src/models/task_attempt.rs | 3 +++ frontend/src/pages/task-attempt-compare.tsx | 25 +++++++++++++-------- shared/types.ts | 8 +++---- 3 files changed, 23 insertions(+), 13 deletions(-) diff --git a/backend/src/models/task_attempt.rs b/backend/src/models/task_attempt.rs index 9a9abc29..26d3b506 100644 --- a/backend/src/models/task_attempt.rs +++ b/backend/src/models/task_attempt.rs @@ -129,6 +129,7 @@ pub struct BranchStatus { pub commits_behind: usize, pub commits_ahead: usize, pub up_to_date: bool, + pub merged: bool, } impl TaskAttempt { @@ -776,6 +777,7 @@ impl TaskAttempt { commits_behind: 0, commits_ahead: 0, up_to_date: true, + merged: attempt.merge_commit.is_some(), }); } @@ -798,6 +800,7 @@ impl TaskAttempt { commits_behind, commits_ahead, up_to_date: commits_behind == 0 && commits_ahead == 0, + merged: attempt.merge_commit.is_some(), }) } diff --git a/frontend/src/pages/task-attempt-compare.tsx b/frontend/src/pages/task-attempt-compare.tsx index a409d389..2225c99a 100644 --- a/frontend/src/pages/task-attempt-compare.tsx +++ b/frontend/src/pages/task-attempt-compare.tsx @@ -376,7 +376,12 @@ export function TaskAttemptComparePage() { )} - {/* Success Messages */} + {/* Status Messages */} + {branchStatus?.merged && ( +
+ ✓ Changes have been merged +
+ )} {rebaseSuccess && (
Branch rebased successfully! @@ -390,7 +395,7 @@ export function TaskAttemptComparePage() { {/* Action Buttons */}
- {branchStatus && branchStatus.is_behind === true && ( + {branchStatus && branchStatus.is_behind === true && !branchStatus.merged && ( + {!branchStatus?.merged && ( + + )}
diff --git a/shared/types.ts b/shared/types.ts index 512f872e..3b3e73a7 100644 --- a/shared/types.ts +++ b/shared/types.ts @@ -31,11 +31,11 @@ export type UpdateTask = { title: string | null, description: string | null, sta export type TaskAttemptStatus = "init" | "setuprunning" | "setupcomplete" | "setupfailed" | "executorrunning" | "executorcomplete" | "executorfailed" | "paused"; -export type TaskAttempt = { id: string, task_id: string, worktree_path: string, base_commit: string | null, merge_commit: string | null, executor: string | null, stdout: string | null, stderr: string | null, created_at: string, updated_at: string, }; +export type TaskAttempt = { id: string, task_id: string, worktree_path: string, merge_commit: string | null, executor: string | null, stdout: string | null, stderr: string | null, created_at: string, updated_at: string, }; -export type CreateTaskAttempt = { task_id: string, worktree_path: string, base_commit: string | null, merge_commit: string | null, executor: string | null, }; +export type CreateTaskAttempt = { task_id: string, worktree_path: string, merge_commit: string | null, executor: string | null, }; -export type UpdateTaskAttempt = { worktree_path: string | null, base_commit: string | null, merge_commit: string | null, }; +export type UpdateTaskAttempt = { worktree_path: string | null, merge_commit: string | null, }; export type TaskAttemptActivity = { id: string, task_attempt_id: string, status: TaskAttemptStatus, note: string | null, created_at: string, }; @@ -51,4 +51,4 @@ export type FileDiff = { path: string, chunks: Array, }; export type WorktreeDiff = { files: Array, }; -export type BranchStatus = { is_behind: boolean, commits_behind: number, commits_ahead: number, up_to_date: boolean, }; \ No newline at end of file +export type BranchStatus = { is_behind: boolean, commits_behind: number, commits_ahead: number, up_to_date: boolean, merged: boolean, }; \ No newline at end of file