feat(ui): synthesis/superseded badges + merge provenance in lessons-tab (#162)
עוצב ואושר דרך שער-העיצוב (Claude Design 12c-training-lessons.html). - lessons-tab: SOURCE_BADGE['synthesis']="סינתזה" (navy מלא) · REVIEW_BADGE['superseded']="מוזג" (אפור-מעומעם, לא נדחה); שורות superseded מעומעמות (opacity). - provenance: לקח-על מציג "⤷ מוזג מ-N לקחים · דחייה תשחזר אותם". - backend: list_decision_lessons + _lesson_to_json מחזירים synthesized_from; training.ts DecisionLesson — 'synthesis'/'superseded' ל-unions + synthesized_from?: string[]. הבאדג'ים היו מוגנים-fallback קודם (ללא קריסה) — כעת מתויגים נכון. closes #162. בדיקות: py_compile ✓ · leak-guard ✓ · tsc --noEmit ✓. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -54,6 +54,9 @@ const SOURCE_BADGE: Record<string, { label: string; cls: string }> = {
|
||||
curator: { label: "הרמס (סקירה)", cls: "bg-info-bg text-info" },
|
||||
style_analyzer: { label: "מנתח-סגנון", cls: "bg-success-bg text-success" },
|
||||
"panel:deepseek+gemini": { label: "פאנל: דיפסיק+גמיני", cls: "bg-gold-wash text-gold-deep" },
|
||||
// #158/INV-LRN8 — a super-lesson merging overlapping lessons; navy-filled so it
|
||||
// reads as the consolidated/elevated one.
|
||||
synthesis: { label: "סינתזה", cls: "bg-navy text-parchment" },
|
||||
};
|
||||
|
||||
const SOURCE_BADGE_FALLBACK = { label: "פאנל", cls: "bg-rule-soft text-ink-soft" };
|
||||
@@ -63,6 +66,9 @@ const REVIEW_BADGE: Record<string, { label: string; cls: string }> = {
|
||||
proposed: { label: "ממתין לאישור", cls: "bg-gold-wash text-gold-deep border-gold/40" },
|
||||
approved: { label: "מאושר · זורם לכותב", cls: "bg-success-bg text-success border-success/40" },
|
||||
rejected: { label: "נדחה", cls: "bg-rule-soft text-ink-muted line-through" },
|
||||
// #158/INV-LRN8 — merged into a synthesis super-lesson; kept as provenance, no
|
||||
// longer fed to the writer. Muted (not struck — it wasn't rejected).
|
||||
superseded: { label: "מוזג", cls: "bg-rule-soft text-ink-muted" },
|
||||
};
|
||||
|
||||
export function LessonsTab({ corpusId }: { corpusId: string }) {
|
||||
@@ -201,8 +207,10 @@ function LessonItem({
|
||||
}
|
||||
};
|
||||
|
||||
const mergedCount = lesson.source === "synthesis" ? (lesson.synthesized_from?.length ?? 0) : 0;
|
||||
|
||||
return (
|
||||
<Card className="bg-surface border-rule">
|
||||
<Card className={`bg-surface border-rule ${lesson.review_status === "superseded" ? "opacity-70" : ""}`}>
|
||||
<CardContent className="px-4 py-3 space-y-2">
|
||||
<div className="flex items-center gap-2 text-[0.72rem]">
|
||||
<Badge variant="outline"
|
||||
@@ -220,6 +228,12 @@ function LessonItem({
|
||||
</span>
|
||||
</div>
|
||||
|
||||
{mergedCount > 0 && (
|
||||
<div className="text-[0.72rem] text-ink-muted">
|
||||
⤷ מוזג מ-<b className="text-navy font-semibold">{mergedCount} לקחים</b> · דחייה תשחזר אותם
|
||||
</div>
|
||||
)}
|
||||
|
||||
{editing ? (
|
||||
<>
|
||||
<Textarea value={text} onChange={(e) => setText(e.target.value)}
|
||||
|
||||
Reference in New Issue
Block a user