feat(pilot): TemplateMatchPanel — explicit 'I ran this' action
Generate and Copy alone don't declare a run — the engineer can walk away after copying. Phase 9 §5 defines an explicit run-declaration affordance so applied_at only stamps on the engineer's positive commitment. Wiring from AssistantChatPage lands in Task 13. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -28,6 +28,9 @@ interface TemplateMatchPanelProps {
|
||||
fix: SessionSuggestedFix
|
||||
sessionId: string
|
||||
onClose: () => void
|
||||
/** Fires when the engineer declares the script was run. Parent calls
|
||||
* applyFix() to stamp applied_at. */
|
||||
onMarkRun?: () => void
|
||||
}
|
||||
|
||||
interface ParamSchemaEntry {
|
||||
@@ -39,7 +42,7 @@ interface ParamSchemaEntry {
|
||||
options?: Array<{ label: string; value: string }>
|
||||
}
|
||||
|
||||
export function TemplateMatchPanel({ fix, sessionId, onClose }: TemplateMatchPanelProps) {
|
||||
export function TemplateMatchPanel({ fix, sessionId, onClose, onMarkRun }: TemplateMatchPanelProps) {
|
||||
const [template, setTemplate] = useState<ScriptTemplateDetail | null>(null)
|
||||
const [templateLoading, setTemplateLoading] = useState(true)
|
||||
const [templateError, setTemplateError] = useState<string | null>(null)
|
||||
@@ -243,6 +246,16 @@ export function TemplateMatchPanel({ fix, sessionId, onClose }: TemplateMatchPan
|
||||
>
|
||||
Edit parameters
|
||||
</button>
|
||||
{onMarkRun && (
|
||||
<button
|
||||
onClick={onMarkRun}
|
||||
className="inline-flex items-center gap-1.5 px-3 py-1.5 rounded text-[0.75rem] font-semibold bg-accent text-[#0a0d14] hover:brightness-110 transition-colors"
|
||||
aria-label="Mark the script as applied to start verifying the fix"
|
||||
>
|
||||
<Check size={12} aria-hidden="true" />
|
||||
I ran this
|
||||
</button>
|
||||
)}
|
||||
</div>
|
||||
</>
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user