feat(web): show owner response human decision queue

This commit is contained in:
Your Name
2026-05-21 18:04:29 +08:00
parent 13ca0bd0df
commit 956fa9a9a6
8 changed files with 418 additions and 3 deletions

View File

@@ -155,6 +155,14 @@ type OwnerResponseReviewOutcomeLane = {
tone: 'steady' | 'warn' | 'locked'
}
type OwnerResponseHumanDecisionQueueItem = {
key: string
queue: string
value: string
icon: typeof ShieldCheck
tone: 'steady' | 'warn' | 'locked'
}
type CoverageGroup = {
key: string
count: string
@@ -657,6 +665,35 @@ const ownerResponseReviewOutcomeBoundaries = [
'github_primary_switch_authorized=false',
]
const ownerResponseHumanDecisionQueueItems: OwnerResponseHumanDecisionQueueItem[] = [
{ key: 'decisionPacketDraft', queue: 'D1', value: '0', icon: FileText, tone: 'warn' },
{ key: 'evidenceTraceBundle', queue: 'D2', value: '0', icon: SearchCheck, tone: 'warn' },
{ key: 'reviewerAssignment', queue: 'D3', value: '0', icon: ClipboardCheck, tone: 'warn' },
{ key: 'rollbackWindowCandidate', queue: 'D4', value: '0', icon: Clock3, tone: 'warn' },
{ key: 'runtimeGateSeparated', queue: 'D5', value: '0', icon: ShieldCheck, tone: 'locked' },
{ key: 'sourceControlCutoverSeparated', queue: 'D6', value: '0', icon: GitBranch, tone: 'locked' },
]
const ownerResponseHumanDecisionQueueBoundaries = [
'owner_response_human_decision_queue_item_count=6',
'owner_response_human_decision_ready_count=0',
'owner_response_human_decision_approved_count=0',
'owner_response_human_decision_runtime_gate_count=0',
'owner_response_human_decision_record_created=false',
'owner_response_human_decision_auto_approval_allowed=false',
'owner_response_human_decision_requires_reviewer=true',
'owner_response_human_decision_only_prepares_packet=true',
'runtime_execution_authorized=false',
'active_runtime_gate_count=0',
'action_buttons_allowed=false',
'not_authorization=true',
'repo_creation_authorized=false',
'refs_sync_authorized=false',
'workflow_modification_authorized=false',
'github_primary_switch_authorized=false',
'gitea_disablement_authorized=false',
]
const coverageGroups: CoverageGroup[] = [
{
key: 'signals',
@@ -2122,6 +2159,126 @@ function OwnerResponseReviewOutcomeBoard() {
)
}
function OwnerResponseHumanDecisionQueueCard({ item }: { item: OwnerResponseHumanDecisionQueueItem }) {
const t = useTranslations('iwooos.ownerResponseHumanDecisionQueueBoard')
const Icon = item.icon
const textWrap = { overflowWrap: 'anywhere' as const, wordBreak: 'break-word' as const }
return (
<div style={{ ...band, minHeight: 190, padding: 16, ...textWrap }}>
<div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between', gap: 12 }}>
<div style={{ display: 'flex', alignItems: 'center', gap: 9, minWidth: 0 }}>
<Icon size={18} color={toneColors[item.tone]} style={{ flex: '0 0 auto' }} />
<span style={{ fontSize: 11, color: '#87867f' }}>{t('queueLabel')}</span>
</div>
<span style={{ fontSize: 11, color: toneColors[item.tone] }}>{item.queue}</span>
</div>
<div style={{ fontSize: 28, fontWeight: 700, color: toneColors[item.tone], marginTop: 12, lineHeight: 1 }}>
{item.value}
</div>
<h2 style={{ fontSize: 14, margin: '10px 0 6px', color: '#141413' }}>
{t(`items.${item.key}.title` as never)}
</h2>
<p style={{ fontSize: 12, lineHeight: 1.55, color: '#6f6d66', margin: 0, ...textWrap }}>
{t(`items.${item.key}.body` as never)}
</p>
<div style={{ marginTop: 10, display: 'grid', gap: 5 }}>
<span style={{ fontSize: 11, color: '#87867f' }}>{t('prepLabel')}</span>
<span style={{ fontSize: 11, color: toneColors[item.tone], lineHeight: 1.45, ...textWrap }}>
{t(`items.${item.key}.prep` as never)}
</span>
<span style={{ fontSize: 11, color: '#87867f', marginTop: 4 }}>{t('guardLabel')}</span>
<span style={{ fontSize: 11, color: '#6f6d66', lineHeight: 1.45, ...textWrap }}>
{t(`items.${item.key}.guard` as never)}
</span>
</div>
</div>
)
}
function OwnerResponseHumanDecisionQueueBoard() {
const t = useTranslations('iwooos.ownerResponseHumanDecisionQueueBoard')
const summaryItems = [
{ key: 'queueItems', value: '6', tone: 'warn' as const },
{ key: 'ready', value: '0', tone: 'warn' as const },
{ key: 'approved', value: '0', tone: 'locked' as const },
{ key: 'runtime', value: '0', tone: 'locked' as const },
]
return (
<section style={{ marginBottom: 14 }} data-testid="iwooos-owner-response-human-decision-queue-board">
<div style={{ marginBottom: 14 }}>
<h2 style={{ fontSize: 16, margin: 0 }}>{t('title')}</h2>
<p style={{ fontSize: 12, color: '#6f6d66', margin: '6px 0 0', lineHeight: 1.55 }}>
{t('subtitle')}
</p>
</div>
<div
style={{
display: 'grid',
gridTemplateColumns: 'repeat(auto-fit, minmax(150px, 1fr))',
gap: 10,
marginBottom: 12,
}}
>
{summaryItems.map(item => (
<div key={item.key} style={{ ...band, padding: 14, minHeight: 96 }}>
<div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between', gap: 8 }}>
<span style={{ fontSize: 11, color: '#87867f' }}>{t(`summary.${item.key}.label` as never)}</span>
<ToneDot tone={item.tone} />
</div>
<div style={{ fontSize: 24, fontWeight: 700, lineHeight: 1, marginTop: 9, color: '#141413' }}>
{item.value}
</div>
<p style={{ fontSize: 11, color: '#6f6d66', lineHeight: 1.45, margin: '8px 0 0' }}>
{t(`summary.${item.key}.detail` as never)}
</p>
</div>
))}
</div>
<div
style={{
display: 'grid',
gridTemplateColumns: 'repeat(auto-fit, minmax(230px, 1fr))',
gap: 12,
}}
>
{ownerResponseHumanDecisionQueueItems.map(item => (
<OwnerResponseHumanDecisionQueueCard key={item.key} item={item} />
))}
</div>
<div style={{ ...band, marginTop: 12, padding: 16 }}>
<div style={{ display: 'flex', alignItems: 'center', gap: 8, marginBottom: 10 }}>
<ShieldCheck size={16} color={toneColors.locked} />
<h3 style={{ fontSize: 14, margin: 0 }}>{t('boundaryTitle')}</h3>
</div>
<div
style={{
display: 'grid',
gridTemplateColumns: 'repeat(auto-fit, minmax(230px, 1fr))',
gap: 7,
}}
>
{ownerResponseHumanDecisionQueueBoundaries.map(item => (
<span
key={item}
style={{
border: '0.5px solid #eee9dd',
borderRadius: 8,
padding: '7px 9px',
color: '#4f4c45',
fontSize: 11,
lineHeight: 1.4,
overflowWrap: 'anywhere',
}}
>
{item}
</span>
))}
</div>
</div>
</section>
)
}
function CoverageCard({ item }: { item: CoverageGroup }) {
const t = useTranslations('iwooos.coverage')
const Icon = item.icon
@@ -3261,6 +3418,8 @@ export default function IwoooSPage({ params }: { params: { locale: string } }) {
<OwnerResponseReviewOutcomeBoard />
<OwnerResponseHumanDecisionQueueBoard />
<section style={{ marginBottom: 14 }}>
<div style={{ marginBottom: 14 }}>
<h2 style={{ fontSize: 16, margin: 0 }}>{t('awooopReadOnlyLandingReadiness.title')}</h2>