fix(goal): make cancellation a user-only control (#6667)

This commit is contained in:
chengyongru authored and GitHub committed 2026-11-14 23:48:13 +08:00
1 parent c927808aff
commit 12a86eaa86
33 files changed
+641 -63

No files matched your search

+4 -3
View File
@@ -93,11 +93,12 @@ function ComposerPreview() {
function GoalPreview() {
const { t } = useGalleryTranslation();
const [status, setStatus] = useState<"active" | "blocked">("active");
const [cancelled, setCancelled] = useState(false);
return <div>
<StatePicker label={t("previews.goal.state")} value={status} options={["active", "blocked"]} onChange={setStatus} />
<StatePicker label={t("previews.goal.state")} value={status} options={["active", "blocked"]} onChange={(next) => { setStatus(next); setCancelled(false); }} />
<div className="thread-header-container relative h-56 overflow-hidden rounded-control border bg-background">
<GoalIsland goal={{ active: status === "active", status, ui_summary: t("previews.goal.summary"), objective: t("previews.goal.objective"),
...(status === "blocked" ? { recap: t("previews.goal.recap") } : {}) }} />
{!cancelled && <GoalIsland goal={{ active: status === "active", status, ui_summary: t("previews.goal.summary"), objective: t("previews.goal.objective"),
...(status === "blocked" ? { recap: t("previews.goal.recap") } : {}) }} cancelDisabled={false} onCancel={async () => setCancelled(true)} />}
</div>
</div>;
}