Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

fix: block armed merge confirmations while actions are disabled

[._.]/ Adam Eivya8cb89bed2d0
diff --git a/client/src/components/apps/tabs/PullRequestActionControls.jsx b/client/src/components/apps/tabs/PullRequestActionControls.jsx
index 4443e732ff..ea464f5752 100644
--- a/client/src/components/apps/tabs/PullRequestActionControls.jsx
+++ b/client/src/components/apps/tabs/PullRequestActionControls.jsx
@@ -63,7 +63,7 @@ export function MergeAction({
);
}
return (
- <div className="flex flex-wrap items-center gap-2 px-2 py-1.5 bg-port-bg border border-port-border rounded-lg">
+ <fieldset disabled={disabled || merging} className="flex min-w-0 flex-wrap items-center gap-2 px-2 py-1.5 bg-port-bg border border-port-border rounded-lg">
<MergeOptions idPrefix={idPrefix} subject={`#${pullRequest.number}`} method={method} onMethodChange={onMethodChange}
deleteBranch={deleteBranch} onDeleteBranchChange={onDeleteBranchChange} disabled={disabled || merging} />
<ConfirmButtonPair
@@ -73,10 +73,10 @@ export function MergeAction({
busy={merging}
busyText="Merging…"
ariaLabel={`Confirm merging #${pullRequest.number}`}
- onConfirm={onConfirm}
+ onConfirm={() => { if (!disabled && !merging) onConfirm(); }}
onCancel={onCancel}
/>
- </div>
+ </fieldset>
);
}
diff --git a/client/src/components/apps/tabs/PullRequestActionControls.test.jsx b/client/src/components/apps/tabs/PullRequestActionControls.test.jsx
new file mode 100644
index 0000000000..919c8734db
--- /dev/null
+++ b/client/src/components/apps/tabs/PullRequestActionControls.test.jsx
@@ -0,0 +1,16 @@
+import { fireEvent, render, screen } from '@testing-library/react';
+import { expect, it, vi } from 'vitest';
+import { MergeAction } from './PullRequestActionControls';
+
+it('does not confirm an armed merge after it becomes disabled', () => {
+ const onConfirm = vi.fn();
+ const props = { pullRequest: { number: 7 }, idPrefix: 'merge-example', armed: true, merging: false,
+ method: 'merge', onMethodChange: vi.fn(), deleteBranch: false, onDeleteBranchChange: vi.fn(), onConfirm, onCancel: vi.fn() };
+ const view = render(<MergeAction {...props} />);
+ expect(screen.getByRole('button', { name: 'Merge #7' })).toBeEnabled();
+ view.rerender(<MergeAction {...props} disabled />);
+ const confirm = screen.getByRole('button', { name: 'Merge #7' });
+ fireEvent.click(confirm);
+ expect(onConfirm).not.toHaveBeenCalled();
+ expect(confirm).toBeDisabled();
+});