Add React task frame bridge for manifest commands

Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
2026-11-13 16:46:09 +08:00
parent 452f0b976f
commit 4a45ffaf47
4 changed files with 35 additions and 32 deletions

View File

@@ -0,0 +1,24 @@
import React from "react";
export function TaskFrame({ module, command, onClose }: {
module: string;
command: string;
onClose: () => void;
}) {
const src = `/workbench.html?module=${encodeURIComponent(module)}&command=${encodeURIComponent(command)}`;
return <div className="parity-task-frame" role="dialog" aria-label={`${module} task: ${command}`}>
<style>{`
.parity-task-frame{position:fixed;inset:0;background:#000b;z-index:80;display:flex;align-items:center;justify-content:center;padding:20px}
.parity-task-frame>section{width:min(1280px,96vw);height:min(860px,92vh);background:#0f1419;border:1px solid #3f3f3f;border-radius:8px;display:flex;flex-direction:column;overflow:hidden}
.parity-task-frame header{display:flex;align-items:center;gap:10px;padding:8px 12px;background:#1b242c;border-bottom:1px solid #3f3f3f;color:#dbe6ee;font:13px system-ui,"Noto Sans SC",sans-serif}
.parity-task-frame header strong{font-size:13px}
.parity-task-frame header button{margin-left:auto;background:#2b2b2b;color:#dbe6ee;border:1px solid #555;border-radius:4px;padding:3px 10px;cursor:pointer}
.parity-task-frame iframe{flex:1;width:100%;border:0;background:#0f1419}
`}</style>
<section>
<header><strong>{module} · {command}</strong><span style={{ color: "#93a6b3" }}>任务桥(复用工作台任务面板)</span>
<button type="button" aria-label="Close task frame" onClick={onClose}>关闭</button></header>
<iframe title={`${module} ${command} task`} src={src} />
</section>
</div>;
}