Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

chore: files changed app/src/components/ui/ConfirmDialog.tsx

Steven Enamakel06dd922b4805
diff --git a/app/src/components/ui/ConfirmDialog.tsx b/app/src/components/ui/ConfirmDialog.tsx
index 133f7a3b4b..c7178bc5db 100644
--- a/app/src/components/ui/ConfirmDialog.tsx
+++ b/app/src/components/ui/ConfirmDialog.tsx
@@ -14,6 +14,25 @@ export interface ConfirmDialogProps {
busyLabel?: ReactNode;
confirmDisabled?: boolean;
destructive?: boolean;
+ /**
+ * `data-testid` for the dialog panel. No default — see `ModalShell.testId`.
+ */
+ testId?: string;
+ /**
+ * `data-testid` for the confirming button.
+ *
+ * Defaults to the value this component has always hardcoded, so every
+ * existing call site and the specs reading it are unaffected.
+ */
+ confirmTestId?: string;
+ /**
+ * `data-testid` for the cancelling button.
+ *
+ * Deliberately undefaulted, unlike `confirmTestId`: there is no historical
+ * value to preserve, and emitting an invented one would add an attribute to
+ * every dialog in the app for the benefit of the handful migrating here.
+ */
+ cancelTestId?: string;
onConfirm: () => void;
onCancel: () => void;
}
@@ -37,6 +56,9 @@ export function ConfirmDialog({
busyLabel,
confirmDisabled = false,
destructive = false,
+ testId,
+ confirmTestId = 'confirm-dialog-confirm',
+ cancelTestId,
onConfirm,
onCancel,
}: ConfirmDialogProps) {
@@ -49,19 +71,25 @@ export function ConfirmDialog({
<ModalShell
title={title}
titleId={titleId}
+ testId={testId}
onClose={onCancel}
maxWidthClassName="max-w-sm"
closePolicy={busy ? { escape: false, backdrop: false, button: false } : undefined}
footer={
<div className="flex justify-end gap-2">
- <Button variant="secondary" size="sm" onClick={onCancel} disabled={busy}>
+ <Button
+ variant="secondary"
+ size="sm"
+ data-testid={cancelTestId}
+ onClick={onCancel}
+ disabled={busy}>
{resolvedCancelLabel}
</Button>
<Button
variant="primary"
size="sm"
tone={destructive ? 'danger' : undefined}
- data-testid="confirm-dialog-confirm"
+ data-testid={confirmTestId}
onClick={onConfirm}
disabled={busy || confirmDisabled}>
{busy ? resolvedBusyLabel : resolvedConfirmLabel}