Skip to content

Commit f698445

Browse files
committed
refactor: derive worst-tone from GROUP_TONE in WorkspaceLifecycleToolCall
The header summary pill computed its tone with hardcoded "danger"/"warn"/"muted" literals that duplicated the existing GROUP_TONE mapping (already used for the dot chips just below). Pick the most severe non-empty OutcomeGroup and map it through GROUP_TONE so the group->tone relationship is single-sourced. Behavior-preserving: GROUP_TONE.failed/blocked/settled equal the prior literals.
1 parent 55f4235 commit f698445

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/browser/features/Tools/WorkspaceLifecycleToolCall.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,11 @@ const HeaderBadge: React.FC<{ rows: TaskWorkspaceLifecycleTargetResult[]; execut
239239
}
240240

241241
const counts = summarizeOutcomeGroups(props.rows);
242-
const worst: Tone = counts.failed > 0 ? "danger" : counts.blocked > 0 ? "warn" : "muted";
242+
// Pick the most severe non-empty group and map it to its tone via GROUP_TONE so the
243+
// group→tone mapping stays single-sourced (the dot chips below read from it too).
244+
const worstGroup: OutcomeGroup =
245+
counts.failed > 0 ? "failed" : counts.blocked > 0 ? "blocked" : "settled";
246+
const worst: Tone = GROUP_TONE[worstGroup];
243247
const chips: Array<{ group: OutcomeGroup; n: number; label: string }> = [
244248
{ group: "settled", n: counts.settled, label: "done" },
245249
{ group: "blocked", n: counts.blocked, label: "blocked" },

0 commit comments

Comments
 (0)