// 移动版 · 四个 Tab 视图:任务 / 审批 / 事件 / 项目
function MobTaskRow({ task, depth = 0, expandedId, setExpandedId }) {
const { ComplexityBadge, StatusChip } = window.MaestroDesignSystem_a6a290;
const kids = task.children || [];
const expanded = expandedId === task.id;
const isGate = ['plan_review', 'spec_review', 'exec_review'].includes(task.status);
return (
setExpandedId(expanded ? null : task.id)} style={{
display: 'flex', flexDirection: 'column', gap: 6,
padding: '12px 14px', minHeight: 44, cursor: 'pointer',
paddingLeft: 14 + depth * 16,
borderBottom: '1px solid var(--line-soft)',
borderLeft: depth ? '1px solid var(--line-soft)' : 'none',
background: expanded ? 'var(--panel-2)' : isGate ? 'rgba(184,142,245,.05)' : 'transparent',
}}>
{task.title}
{task.id}
{task.prio}
{expanded ? (
{(task.doc || task.ops) ? (
{task.doc ? '改动方案(SPEC)' : '将执行的操作(OPERATIONS)'}
{task.doc || task.ops}
) : (
待 Claude Code 产出(经 MCP 写入并提交评审)
)}
) : null}
{kids.map((k) => )}
);
}
function MobTasks({ tasks, agents }) {
const { SectionHead } = window.MaestroDesignSystem_a6a290;
const [expandedId, setExpandedId] = React.useState(null);
return (
{agents.length ? (
{agents[0].title}
{agents[0].kind}
) : null}
{tasks.map((t) => )}
);
}
function MobGatePreview({ item, onDecide, onClose }) {
const { ComplexityBadge, Button, Textarea } = window.MaestroDesignSystem_a6a290;
const [rejecting, setRejecting] = React.useState(false);
const [reason, setReason] = React.useState('');
if (!item) return null;
return (
{item.gateLabel}
{item.title}
{item.meta}
{item.docLabel ?
{item.docLabel}
: null}
{item.doc}
{rejecting ? (
) : (
)}
);
}
function MobGates({ approvals, onDecide }) {
const { GateCard, GateStripe, Button, Textarea, SectionHead } = window.MaestroDesignSystem_a6a290;
const [rejecting, setRejecting] = React.useState(null);
const [reason, setReason] = React.useState('');
const [preview, setPreview] = React.useState(null);
if (!approvals.length) {
return 无待裁决审批
;
}
return (
{approvals.map((a) => (
}>
{rejecting === a.id ? (
) : null}
))}
setPreview(null)} />
);
}
function MobEvents({ events }) {
const { EventItem, SectionHead } = window.MaestroDesignSystem_a6a290;
return (
);
}
function MobProjects({ projects, currentId, onSelect, project }) {
const { SectionHead, Select, Input, Button } = window.MaestroDesignSystem_a6a290;
return (
{projects.map((p) => {
const active = p.id === currentId;
return (
- onSelect(p.id)} style={{
display: 'flex', alignItems: 'center', gap: 10, minHeight: 52,
padding: '10px 14px', cursor: 'pointer',
borderBottom: '1px solid var(--line-soft)',
borderLeft: '2px solid ' + (active ? 'var(--green)' : 'transparent'),
background: active ? 'var(--panel-2)' : 'transparent',
color: active ? 'var(--green)' : 'var(--muted)',
}}>
{p.name}
{p.path}
{active ? 当前 : null}
);
})}
);
}
Object.assign(window, { MaestroMobTasks: MobTasks, MaestroMobGates: MobGates, MaestroMobEvents: MobEvents, MaestroMobProjects: MobProjects });