From cfe3ea0aae878ae8f591acdc33a48332ac875b9e Mon Sep 17 00:00:00 2001 From: soryu Date: Thu, 29 Jan 2026 02:24:48 +0000 Subject: fix: Remove mistaken red team UI from VN frontend (#47) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: Add Red Team UI to makima/frontend contract creation - Add redTeamEnabled and redTeamPrompt state to contracts page - Add "Enable Red Team Monitoring" checkbox with description - Add conditional "Custom Review Criteria" textarea when enabled - Include redTeamEnabled/redTeamPrompt in CreateContractRequest - Reset red team fields when canceling contract creation - Add redTeamEnabled to ContractSummary and Contract types - Add redTeamEnabled/redTeamPrompt to CreateContractRequest type - Add Red Team badge (🔍) to ContractList for enabled contracts Co-Authored-By: Claude Opus 4.5 * fix: Remove mistaken red team UI from VN frontend PR #39 accidentally added red team UI code to the wrong frontend directory (frontend/ instead of makima/frontend/). The correct implementation is already in makima/frontend/. This commit removes the mistaken changes: - Delete ContractCreateModal.tsx (was added by mistake) - Revert ContractList.tsx to remove red team badge and create modal - Revert ContractDetail.tsx to remove red team tab and notifications - Revert types.ts to remove contract/task types - Revert pc98.css to remove red team styling Co-Authored-By: Claude Opus 4.5 * [WIP] Heartbeat checkpoint - 2026-01-29 02:18:40 UTC --------- Co-authored-by: Claude Opus 4.5 --- frontend/src/components/ContractCreateModal.tsx | 185 ------------------------ 1 file changed, 185 deletions(-) delete mode 100644 frontend/src/components/ContractCreateModal.tsx (limited to 'frontend/src/components/ContractCreateModal.tsx') diff --git a/frontend/src/components/ContractCreateModal.tsx b/frontend/src/components/ContractCreateModal.tsx deleted file mode 100644 index e1d9732..0000000 --- a/frontend/src/components/ContractCreateModal.tsx +++ /dev/null @@ -1,185 +0,0 @@ -import React, { useState } from 'react' - -interface ContractCreateModalProps { - isOpen: boolean - onClose: () => void - onCreated: () => void -} - -interface CreateContractForm { - name: string - description: string - contractType: string - redTeamEnabled: boolean - redTeamPrompt: string -} - -export function ContractCreateModal({ isOpen, onClose, onCreated }: ContractCreateModalProps) { - const [form, setForm] = useState({ - name: '', - description: '', - contractType: 'simple', - redTeamEnabled: false, - redTeamPrompt: '', - }) - const [loading, setLoading] = useState(false) - const [error, setError] = useState(null) - - if (!isOpen) return null - - const handleSubmit = async (e: React.FormEvent) => { - e.preventDefault() - setLoading(true) - setError(null) - - try { - const response = await fetch('/api/v1/contracts', { - method: 'POST', - headers: { - 'Content-Type': 'application/json', - }, - body: JSON.stringify({ - name: form.name, - description: form.description || undefined, - contract_type: form.contractType, - red_team_enabled: form.redTeamEnabled, - red_team_prompt: form.redTeamEnabled && form.redTeamPrompt ? form.redTeamPrompt : undefined, - }), - }) - - if (!response.ok) { - const errorData = await response.json().catch(() => ({})) - throw new Error(errorData.message || `Failed to create contract: ${response.statusText}`) - } - - // Reset form and close modal - setForm({ - name: '', - description: '', - contractType: 'simple', - redTeamEnabled: false, - redTeamPrompt: '', - }) - onCreated() - onClose() - } catch (err) { - setError(err instanceof Error ? err.message : 'Unknown error') - } finally { - setLoading(false) - } - } - - return ( -
-
e.stopPropagation()}> -
-

Create Contract

- -
- -
-
- {error && ( -
- {error} -
- )} - -
-

Contract Details

- -
- -
- -
-