fix: use merge-base for diffStat in merger and show files changed on done task cards
The merger was using `git diff HEAD..branch --stat` which includes artifacts from other tasks when branches fork from older main commits. Switch to `git diff $(merge-base)..branch --stat` so commit messages only describe the branch's own changes. Also surface the "files changed" button on done task cards using mergeDetails, opening the same ChangedFilesModal with commit-backed diffs (matching the Changes tab in the task modal). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -44,7 +44,7 @@ interface TaskCardProps {
|
||||
) => Promise<Task>;
|
||||
onArchiveTask?: (id: string) => Promise<Task>;
|
||||
onUnarchiveTask?: (id: string) => Promise<Task>;
|
||||
onOpenFilesForTask?: (taskId: string, worktree: string | undefined, column: string) => void;
|
||||
onOpenFilesForTask?: (taskId: string, worktree: string | undefined, column: string, commitSha?: string) => void;
|
||||
}
|
||||
|
||||
function areTaskBadgeInfosEqual(
|
||||
@@ -688,6 +688,20 @@ function TaskCardComponent({
|
||||
</span>
|
||||
</button>
|
||||
)}
|
||||
{task.column === "done" && task.mergeDetails?.filesChanged != null && task.mergeDetails.filesChanged > 0 && (
|
||||
<button
|
||||
type="button"
|
||||
className="card-session-files"
|
||||
onClick={(e) => {
|
||||
e.stopPropagation();
|
||||
onOpenFilesForTask?.(task.id, task.worktree, task.column, task.mergeDetails?.commitSha);
|
||||
}}
|
||||
disabled={!onOpenFilesForTask}
|
||||
>
|
||||
<Folder size={12} />
|
||||
<span>{task.mergeDetails.filesChanged} files changed</span>
|
||||
</button>
|
||||
)}
|
||||
{((task.dependencies && task.dependencies.length > 0) || queued || task.status === "queued" || task.blockedBy) && (
|
||||
<div className="card-meta">
|
||||
{task.dependencies && task.dependencies.length > 0 && (
|
||||
|
||||
Reference in New Issue
Block a user