- Phase 3: startReviewPlanJobAction, cancelIdeaJobAction, status transitions (REVIEWING_PLAN / PLAN_REVIEWED / PLAN_REVIEW_FAILED), status colors, job-card/jobs-column filters, idea-list status tabs - Phase 4: review-plan-job.md prompt (multi-model orchestration with codex injection + active plan revision via update_idea_plan_md after each round), runbook, 13 unit tests - Phase 5: ReviewLogViewer component (rounds, convergence, approval, issues), idea-detail integration, proper ReviewLog TypeScript types exported from component - Phase 6.1: wait-for-job discriminator wired (IDEA_REVIEW_PLAN), plan-revision step made mandatory in prompt (was previously optional/missing) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
69 lines
2.3 KiB
TypeScript
69 lines
2.3 KiB
TypeScript
// Mapping van IdeaStatus → Tailwind/MD3-classes voor badge-rendering.
|
|
// Hergebruikt de bestaande --status-*-tokens (zie app/styles/theme.css).
|
|
// CLAUDE.md hardstop: nooit `bg-blue-500` o.i.d.; altijd MD3-tokens.
|
|
|
|
import type { IdeaStatus } from '@prisma/client'
|
|
|
|
export interface IdeaStatusBadge {
|
|
label: string
|
|
classes: string
|
|
pulse?: boolean
|
|
}
|
|
|
|
const PILL = 'inline-flex items-center rounded-full border px-2 py-0.5 text-xs font-medium'
|
|
|
|
// Per-status: label + Tailwind-classes + optionele pulse-indicator.
|
|
// in-progress + status-blocked + status-review + status-done worden hergebruikt.
|
|
const TABLE: Record<IdeaStatus, IdeaStatusBadge> = {
|
|
DRAFT: {
|
|
label: 'Concept',
|
|
classes: `${PILL} bg-surface-variant text-on-surface-variant border-outline-variant`,
|
|
},
|
|
GRILLING: {
|
|
label: 'Grillen…',
|
|
classes: `${PILL} bg-status-in-progress/15 text-status-in-progress border-status-in-progress/30`,
|
|
pulse: true,
|
|
},
|
|
GRILL_FAILED: {
|
|
label: 'Grill mislukt',
|
|
classes: `${PILL} bg-status-blocked/15 text-status-blocked border-status-blocked/30`,
|
|
},
|
|
GRILLED: {
|
|
label: 'Gegrilld',
|
|
classes: `${PILL} bg-status-review/15 text-status-review border-status-review/30`,
|
|
},
|
|
PLANNING: {
|
|
label: 'Plannen…',
|
|
classes: `${PILL} bg-status-in-progress/15 text-status-in-progress border-status-in-progress/30`,
|
|
pulse: true,
|
|
},
|
|
PLAN_FAILED: {
|
|
label: 'Plan mislukt',
|
|
classes: `${PILL} bg-status-blocked/15 text-status-blocked border-status-blocked/30`,
|
|
},
|
|
PLAN_READY: {
|
|
label: 'Plan klaar',
|
|
classes: `${PILL} bg-status-review/15 text-status-review border-status-review/30`,
|
|
},
|
|
REVIEWING_PLAN: {
|
|
label: 'Plan beoordelen…',
|
|
classes: `${PILL} bg-status-in-progress/15 text-status-in-progress border-status-in-progress/30`,
|
|
pulse: true,
|
|
},
|
|
PLAN_REVIEW_FAILED: {
|
|
label: 'Beoordeling mislukt',
|
|
classes: `${PILL} bg-status-blocked/15 text-status-blocked border-status-blocked/30`,
|
|
},
|
|
PLAN_REVIEWED: {
|
|
label: 'Plan beoordeeld',
|
|
classes: `${PILL} bg-status-done/15 text-status-done border-status-done/30`,
|
|
},
|
|
PLANNED: {
|
|
label: 'Gepland',
|
|
classes: `${PILL} bg-status-done/15 text-status-done border-status-done/30`,
|
|
},
|
|
}
|
|
|
|
export function getIdeaStatusBadge(status: IdeaStatus): IdeaStatusBadge {
|
|
return TABLE[status]
|
|
}
|