fix(ui): inject Spec Kit architectural templates directly into Architect mode prompt

This commit is contained in:
2026-05-19 19:38:40 -07:00
parent 02de32958f
commit 665c2ffa06

View File

@@ -135,11 +135,36 @@ function ObjectiveView({ plan, projectId, onChange }: { plan: Plan, projectId: s
<div> <div>
</div> </div>
{!editing && ( <div style={{ display: "flex", gap: 12 }}>
<button onClick={() => setEditing(true)} className="btn-ghost"> <button
<Pencil size={12} /> Edit onClick={async () => {
if (!confirm("This will overwrite the PRD and Execution Plan based on the current objective. Continue?")) return;
setSaving(true);
try {
const r = await fetch(`/api/projects/${projectId}/plan/generate`, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ objective: draft }),
});
const d = await r.json();
if (d.plan) onChange(d.plan);
} finally {
setSaving(false);
setEditing(false);
}
}}
disabled={saving || !draft.trim()}
className="btn-primary"
style={{ fontWeight: 600, fontSize: "0.85rem", padding: "6px 16px", borderRadius: 6 }}
>
{saving ? <><Loader2 size={12} className="animate-spin" /> Generating...</> : "Generate Complete PRD"}
</button> </button>
)} {!editing && (
<button onClick={() => setEditing(true)} className="btn-ghost">
<Pencil size={12} /> Edit
</button>
)}
</div>
</div> </div>
{editing ? ( {editing ? (
@@ -153,36 +178,11 @@ function ObjectiveView({ plan, projectId, onChange }: { plan: Plan, projectId: s
}} }}
placeholder="Describe the business objective..." placeholder="Describe the business objective..."
/> />
<div style={{ display: "flex", justifyContent: "space-between", padding: "12px 20px", background: INK.bgHover, borderTop: `1px solid ${INK.border}` }}> <div style={{ display: "flex", justifyContent: "flex-end", gap: 8, padding: "12px 20px", background: INK.bgHover, borderTop: `1px solid ${INK.border}` }}>
<button <button onClick={() => setEditing(false)} className="btn-ghost">Cancel</button>
onClick={async () => { <button onClick={save} disabled={saving} className="btn-primary">
if (!confirm("This will overwrite the PRD and Execution Plan based on the current objective. Continue?")) return; {saving ? "Saving..." : "Save Objective"}
setSaving(true);
try {
const r = await fetch(`/api/projects/${projectId}/plan/generate`, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ objective: draft }),
});
const d = await r.json();
if (d.plan) onChange(d.plan);
} finally {
setSaving(false);
setEditing(false);
}
}}
disabled={saving}
className="btn-secondary"
style={{ background: "#fff", borderColor: INK.border }}
>
{saving ? "Generating PRD..." : "Generate Complete PRD"}
</button> </button>
<div style={{ display: "flex", gap: 8 }}>
<button onClick={() => setEditing(false)} className="btn-ghost">Cancel</button>
<button onClick={save} disabled={saving} className="btn-primary">
{saving ? "Saving..." : "Save Objective"}
</button>
</div>
</div> </div>
</div> </div>
) : ( ) : (