diff options
| author | soryu <soryu@soryu.co> | 2026-01-29 02:24:48 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-01-29 02:24:48 +0000 |
| commit | cfe3ea0aae878ae8f591acdc33a48332ac875b9e (patch) | |
| tree | 49a7f2d17f494f6c5f88d7c0692d57c21dea3244 /frontend/src/components/ContractList.tsx | |
| parent | 764ace78046e78cce36b64cb3682cc5489bcf9d7 (diff) | |
| download | soryu-cfe3ea0aae878ae8f591acdc33a48332ac875b9e.tar.gz soryu-cfe3ea0aae878ae8f591acdc33a48332ac875b9e.zip | |
fix: Remove mistaken red team UI from VN frontend (#47)
* 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 <noreply@anthropic.com>
* 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 <noreply@anthropic.com>
* [WIP] Heartbeat checkpoint - 2026-01-29 02:18:40 UTC
---------
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Diffstat (limited to 'frontend/src/components/ContractList.tsx')
| -rw-r--r-- | frontend/src/components/ContractList.tsx | 61 |
1 files changed, 18 insertions, 43 deletions
diff --git a/frontend/src/components/ContractList.tsx b/frontend/src/components/ContractList.tsx index 253b44f..77012db 100644 --- a/frontend/src/components/ContractList.tsx +++ b/frontend/src/components/ContractList.tsx @@ -1,6 +1,5 @@ -import React, { useEffect, useState, useCallback } from 'react' +import React, { useEffect, useState } from 'react' import { Link } from 'react-router-dom' -import { ContractCreateModal } from './ContractCreateModal' interface ContractSummary { id: string @@ -13,35 +12,32 @@ interface ContractSummary { task_count: number repository_count: number created_at: string - // Red team fields - red_team_enabled?: boolean } export function ContractList() { const [contracts, setContracts] = useState<ContractSummary[]>([]) const [loading, setLoading] = useState(true) const [error, setError] = useState<string | null>(null) - const [showCreateModal, setShowCreateModal] = useState(false) - const fetchContracts = useCallback(async () => { - try { - setLoading(true) - const response = await fetch('/api/v1/contracts') - if (!response.ok) { - throw new Error(`Failed to fetch contracts: ${response.statusText}`) + useEffect(() => { + async function fetchContracts() { + try { + setLoading(true) + const response = await fetch('/api/v1/contracts') + if (!response.ok) { + throw new Error(`Failed to fetch contracts: ${response.statusText}`) + } + const data = await response.json() + setContracts(data.contracts || []) + } catch (err) { + setError(err instanceof Error ? err.message : 'Unknown error') + } finally { + setLoading(false) } - const data = await response.json() - setContracts(data.contracts || []) - } catch (err) { - setError(err instanceof Error ? err.message : 'Unknown error') - } finally { - setLoading(false) } - }, []) - useEffect(() => { fetchContracts() - }, [fetchContracts]) + }, []) if (loading) { return ( @@ -61,15 +57,7 @@ export function ContractList() { return ( <div className="contract-list-container"> - <div className="contract-list-header"> - <h1>Contracts</h1> - <button - className="create-contract-btn" - onClick={() => setShowCreateModal(true)} - > - + New Contract - </button> - </div> + <h1>Contracts</h1> {contracts.length === 0 ? ( <p>No contracts found</p> ) : ( @@ -77,14 +65,7 @@ export function ContractList() { {contracts.map((contract) => ( <li key={contract.id} className="contract-item"> <Link to={`/contracts/${contract.id}`}> - <h2> - {contract.name} - {contract.red_team_enabled && ( - <span className="red-team-badge" title="Red Team monitoring enabled"> - 🔍 - </span> - )} - </h2> + <h2>{contract.name}</h2> {contract.description && <p>{contract.description}</p>} <div className="contract-meta"> <span>Phase: {contract.phase}</span> @@ -97,12 +78,6 @@ export function ContractList() { ))} </ul> )} - - <ContractCreateModal - isOpen={showCreateModal} - onClose={() => setShowCreateModal(false)} - onCreated={fetchContracts} - /> </div> ) } |
