Enhance Slot Evaluation and Scoring Mechanisms
Deploy Development / deploy (push) Successful in 46s
Test Suite / pytest-backend (push) Successful in 44s
Test Suite / lint-backend (push) Successful in 0s
Test Suite / build-frontend (push) Successful in 14s
Test Suite / k6 /health Baseline (push) Successful in 33s
Test Suite / playwright-tests (push) Successful in 1m26s
Deploy Development / deploy (push) Successful in 46s
Test Suite / pytest-backend (push) Successful in 44s
Test Suite / lint-backend (push) Successful in 0s
Test Suite / build-frontend (push) Successful in 14s
Test Suite / k6 /health Baseline (push) Successful in 33s
Test Suite / playwright-tests (push) Successful in 1m26s
- Introduced new functions `_off_topic_semantic_scores_by_slot` and `_score_exercise_stage_fit_for_spec` to improve the evaluation of off-topic steps and exercise stage fit, enhancing the quality assessment process. - Updated `_run_unified_slot_improvement_review` to incorporate off-topic scores and exercise stage fit scoring, refining the decision-making process for slot suggestions. - Enhanced existing logic to streamline the handling of slot scores and improve the overall robustness of slot management in path evaluations.
This commit is contained in:
1 parent
e9bf5bd1a5
commit
cd457e3ea0
5 files changed
+654
-437
No files matched your search
@@ -501,53 +501,75 @@ export default function ProgressionGraphEditor({ graphId, embedded = false, onSa
|
||||
const mergedAfterEval = mergeGapOffersForDraft(evaluated, baselineRes)
|
||||
setGapFillOffers(mergedAfterEval.length > 0 ? mergedAfterEval : remainingOffers)
|
||||
|
||||
setMatchNotice('Schritt 2/2: Verbesserungsvorschläge für gemeldete Schachstellen…')
|
||||
const reviewRes = await api.suggestProgressionPath({
|
||||
...buildEvaluateRequest(synced),
|
||||
evaluate_only: false,
|
||||
unified_slot_review: true,
|
||||
baseline_evaluate_steps: slotsToEvaluateSteps(synced),
|
||||
baseline_path_qa_snapshot: baselineRes?.path_qa || null,
|
||||
baseline_quality_score:
|
||||
baselineRes?.path_qa?.quality_score != null
|
||||
? Number(baselineRes.path_qa.quality_score)
|
||||
: null,
|
||||
include_llm_intent: false,
|
||||
auto_rematch_after_qa: false,
|
||||
})
|
||||
|
||||
if (!reviewRes?.unified_slot_review) {
|
||||
throw new Error(
|
||||
'Match-Review nicht verfügbar — Backend-Stand prüfen (unified_slot_review fehlt in der Antwort).',
|
||||
)
|
||||
setMatchNotice('Schritt 2/2: Slot-Alternativen prüfen…')
|
||||
let compareRes
|
||||
let reviewError = null
|
||||
try {
|
||||
const reviewRes = await api.suggestProgressionPath({
|
||||
...buildEvaluateRequest(synced),
|
||||
evaluate_only: false,
|
||||
unified_slot_review: true,
|
||||
baseline_evaluate_steps: slotsToEvaluateSteps(synced),
|
||||
baseline_path_qa_snapshot: baselineRes?.path_qa || null,
|
||||
baseline_quality_score:
|
||||
baselineRes?.path_qa?.quality_score != null
|
||||
? Number(baselineRes.path_qa.quality_score)
|
||||
: null,
|
||||
include_llm_intent: false,
|
||||
auto_rematch_after_qa: false,
|
||||
})
|
||||
if (!reviewRes?.unified_slot_review) {
|
||||
reviewError =
|
||||
'Slot-Review nicht verfügbar — Backend neu starten/deployen (unified_slot_review fehlt).'
|
||||
compareRes = buildProgressionComparePayload(baselineRes, {
|
||||
...reviewRes,
|
||||
unified_slot_review: true,
|
||||
slot_reviews: [],
|
||||
review_error: reviewError,
|
||||
})
|
||||
} else {
|
||||
compareRes = buildProgressionComparePayload(baselineRes, reviewRes)
|
||||
}
|
||||
setGapFillOffers(mergeGapOffersForDraft(evaluated, baselineRes, reviewRes))
|
||||
} catch (e) {
|
||||
reviewError = e.message || 'Slot-Review fehlgeschlagen'
|
||||
compareRes = buildProgressionComparePayload(baselineRes, {
|
||||
unified_slot_review: true,
|
||||
slot_reviews: [],
|
||||
review_error: reviewError,
|
||||
path_qa: baselineRes?.path_qa,
|
||||
})
|
||||
}
|
||||
|
||||
const compareRes = buildProgressionComparePayload(baselineRes, reviewRes)
|
||||
setGapFillOffers(mergeGapOffersForDraft(evaluated, baselineRes, reviewRes))
|
||||
presentMatchCompare(compareRes, { source })
|
||||
presentMatchCompare(compareRes, { source, reviewError })
|
||||
return compareRes
|
||||
}
|
||||
|
||||
const presentMatchCompare = (res, { source = 'manual' } = {}) => {
|
||||
const presentMatchCompare = (res, { source = 'manual', reviewError = null } = {}) => {
|
||||
setSemanticBrief(res?.semantic_brief_summary || null)
|
||||
setTargetSummary(res?.target_profile_summary || null)
|
||||
setComparePayload(res)
|
||||
setComparePayload(reviewError ? { ...res, review_error: reviewError } : res)
|
||||
setCompareSource(source)
|
||||
setProposedPathQa(res?.proposed_path_qa_pipeline || null)
|
||||
setCompareOpen(true)
|
||||
|
||||
const baselineQa = res?.baseline_path_qa || null
|
||||
const diffCount = res?.slot_diff_count ?? compareDiffsForDialog(res).length
|
||||
const slotReviews = res?.slot_reviews || []
|
||||
const autoCount = slotReviews.filter((r) => r?.library_alternative?.auto_select).length
|
||||
const diffCount = autoCount || res?.slot_diff_count || 0
|
||||
const rejectedCount = res?.slot_diff_count_rejected ?? rejectedCompareDiffs(res).length
|
||||
const problemCount = res?.match_summary?.problem_slot_count
|
||||
?? (res?.problem_slots ? Object.keys(res.problem_slots).length : 0)
|
||||
const bPct = pathQaQualityPercent(baselineQa)
|
||||
let notice =
|
||||
diffCount > 0
|
||||
? `Match: ${diffCount} Verbesserung(en) für gemeldete Schachstellen.`
|
||||
: problemCount > 0
|
||||
? `Match: ${problemCount} Schachstelle(n) erkannt, aber kein Bibliotheks-Ersatz mit Gewinn — KI-Angebote im Panel prüfen.`
|
||||
: 'Match: Keine Schachstellen — Pfad wirkt konsistent.'
|
||||
let notice = reviewError
|
||||
? `Match: Dialog geöffnet — ${reviewError}`
|
||||
: slotReviews.length > 0
|
||||
? `Match: ${slotReviews.length} Slot(s) geprüft, ${autoCount} Empfehlung(en) vorausgewählt.`
|
||||
: diffCount > 0
|
||||
? `Match: ${diffCount} Verbesserung(en).`
|
||||
: problemCount > 0
|
||||
? `Match: ${problemCount} Schachstelle(n), keine bessere Bibliotheks-Alternative.`
|
||||
: 'Match: Pfad geprüft — siehe Dialog.'
|
||||
if (rejectedCount > 0) {
|
||||
notice += ` ${rejectedCount} Vorschlag/Vorschläge verworfen (Verschlechterung oder neutral).`
|
||||
}
|
||||
|
||||
@@ -1,13 +1,16 @@
|
||||
/**
|
||||
* Gegenüberstellung: Verbesserungsvorschläge mit Slot-Bewertung (Pro/Contra).
|
||||
* Slot-Match-Dialog: je Slot Bewertung, Bibliotheks-Alternative, optional KI.
|
||||
*/
|
||||
import React, { useMemo, useState } from 'react'
|
||||
import FormModalOverlay from './FormModalOverlay'
|
||||
import {
|
||||
compareDiffsForDialog,
|
||||
compareSlotReviews,
|
||||
defaultSelectedCompareDiffs,
|
||||
pathQaQualityPercent,
|
||||
qualityDeltaPercent,
|
||||
rejectedCompareDiffs,
|
||||
slotFitScorePercent,
|
||||
slotReviewSelectionKey,
|
||||
} from '../utils/progressionGraphDraft'
|
||||
|
||||
function qaLabel(pathQa) {
|
||||
@@ -17,12 +20,10 @@ function qaLabel(pathQa) {
|
||||
return ok ? 'OK' : 'Hinweise'
|
||||
}
|
||||
|
||||
function deltaLabel(diff) {
|
||||
const pct = qualityDeltaPercent(diff)
|
||||
if (pct == null) return null
|
||||
if (pct > 0) return `+${pct} % Pfad-QS`
|
||||
if (pct === 0) return '±0 % Pfad-QS'
|
||||
return `${pct} % Pfad-QS`
|
||||
function slotScoreLabel(score) {
|
||||
const pct = slotFitScorePercent(score)
|
||||
if (pct == null) return '—'
|
||||
return `${pct} % Stufen-Fit`
|
||||
}
|
||||
|
||||
function ProContraList({ title, items, tone = 'neutral' }) {
|
||||
@@ -41,89 +42,157 @@ function ProContraList({ title, items, tone = 'neutral' }) {
|
||||
)
|
||||
}
|
||||
|
||||
function DiffRow({ diff, checked, onToggle, applying }) {
|
||||
const midx = Number(diff.roadmap_major_step_index)
|
||||
const delta = deltaLabel(diff)
|
||||
const pc = diff.pro_contra || {}
|
||||
const isAi = diff.suggestion_type === 'ai_gap' || diff.proposed_is_ai_proposal
|
||||
const isFill = diff.baseline_exercise_id == null && !isAi
|
||||
function SlotReviewRow({ review, selected, onToggle, applying }) {
|
||||
const midx = Number(review.roadmap_major_step_index)
|
||||
const lib = review.library_alternative
|
||||
const ai = review.ai_alternative
|
||||
const libKey = slotReviewSelectionKey(midx, 'library')
|
||||
const aiKey = slotReviewSelectionKey(midx, 'ai')
|
||||
const pc = lib?.pro_contra || {}
|
||||
const pathDelta = qualityDeltaPercent({ quality_delta: lib?.quality_delta })
|
||||
const slotDelta = lib?.slot_score_delta
|
||||
|
||||
return (
|
||||
<li
|
||||
style={{
|
||||
padding: '10px 12px',
|
||||
padding: '12px',
|
||||
borderRadius: '8px',
|
||||
border: '1px solid var(--border)',
|
||||
background: checked ? 'var(--surface2)' : 'var(--surface)',
|
||||
border: `1px solid ${review.slot_problem ? 'var(--danger)' : 'var(--border)'}`,
|
||||
background: 'var(--surface)',
|
||||
fontSize: '12px',
|
||||
}}
|
||||
>
|
||||
<label style={{ display: 'flex', gap: '8px', alignItems: 'flex-start', cursor: 'pointer' }}>
|
||||
<input
|
||||
type="checkbox"
|
||||
checked={checked}
|
||||
onChange={() => onToggle(midx)}
|
||||
disabled={applying}
|
||||
style={{ marginTop: '3px' }}
|
||||
/>
|
||||
<span style={{ flex: 1 }}>
|
||||
<div style={{ display: 'flex', flexWrap: 'wrap', gap: '6px', alignItems: 'center' }}>
|
||||
<strong>Slot {midx + 1}</strong>
|
||||
{isFill ? (
|
||||
<span style={{ fontSize: '10px', color: 'var(--accent-dark)' }}>Lücke füllen</span>
|
||||
) : isAi ? (
|
||||
<span style={{ fontSize: '10px', color: 'var(--accent-dark)' }}>KI-Alternative</span>
|
||||
) : diff.off_topic ? (
|
||||
<span style={{ fontSize: '10px', color: 'var(--danger)' }}>Passt nicht — Ersatz</span>
|
||||
) : (
|
||||
<span style={{ fontSize: '10px', color: 'var(--text2)' }}>Bessere Übung</span>
|
||||
)}
|
||||
{delta ? (
|
||||
<span
|
||||
style={{
|
||||
fontSize: '10px',
|
||||
fontWeight: 600,
|
||||
color: qualityDeltaPercent(diff) > 0 ? 'var(--accent-dark)' : 'var(--text2)',
|
||||
}}
|
||||
>
|
||||
{delta}
|
||||
</span>
|
||||
) : null}
|
||||
</div>
|
||||
<div style={{ display: 'flex', flexWrap: 'wrap', gap: '6px', alignItems: 'center', marginBottom: '8px' }}>
|
||||
<strong>Slot {midx + 1}</strong>
|
||||
{review.slot_problem ? (
|
||||
<span style={{ fontSize: '10px', color: 'var(--danger)' }}>Schachstelle</span>
|
||||
) : review.off_topic ? (
|
||||
<span style={{ fontSize: '10px', color: 'var(--danger)' }}>Passt nicht</span>
|
||||
) : (
|
||||
<span style={{ fontSize: '10px', color: 'var(--text2)' }}>OK</span>
|
||||
)}
|
||||
{review.roadmap_learning_goal ? (
|
||||
<span style={{ fontSize: '10px', color: 'var(--text3)', flex: '1 1 100%' }}>
|
||||
{review.roadmap_learning_goal}
|
||||
</span>
|
||||
) : null}
|
||||
</div>
|
||||
|
||||
<div
|
||||
style={{
|
||||
display: 'grid',
|
||||
gridTemplateColumns: '1fr 1fr',
|
||||
gap: '10px',
|
||||
marginTop: '8px',
|
||||
}}
|
||||
>
|
||||
<div>
|
||||
<div style={{ fontSize: '10px', fontWeight: 600, color: 'var(--text3)', marginBottom: '4px' }}>
|
||||
Aktuell
|
||||
</div>
|
||||
<div style={{ color: 'var(--text2)' }}>
|
||||
{diff.baseline_title || '— leer —'}
|
||||
{diff.baseline_exercise_id != null ? ` (#${diff.baseline_exercise_id})` : ''}
|
||||
</div>
|
||||
<ProContraList title="Pro" items={pc.current_pro} tone="pro" />
|
||||
<ProContraList title="Contra" items={pc.current_contra} tone="contra" />
|
||||
</div>
|
||||
<div>
|
||||
<div style={{ fontSize: '10px', fontWeight: 600, color: 'var(--text3)', marginBottom: '4px' }}>
|
||||
Vorschlag
|
||||
</div>
|
||||
<div
|
||||
style={{
|
||||
display: 'grid',
|
||||
gridTemplateColumns: '1fr 1fr',
|
||||
gap: '10px',
|
||||
marginBottom: lib || ai ? '10px' : 0,
|
||||
}}
|
||||
>
|
||||
<div>
|
||||
<div style={{ fontSize: '10px', fontWeight: 600, color: 'var(--text3)', marginBottom: '4px' }}>
|
||||
Aktuell
|
||||
</div>
|
||||
<div style={{ color: 'var(--text2)' }}>
|
||||
{review.baseline_title || '— leer —'}
|
||||
{review.baseline_exercise_id != null ? ` (#${review.baseline_exercise_id})` : ''}
|
||||
</div>
|
||||
<div style={{ fontSize: '10px', color: 'var(--text3)', marginTop: '4px' }}>
|
||||
{slotScoreLabel(review.baseline_slot_score)}
|
||||
</div>
|
||||
{(review.problem_reasons || []).slice(0, 3).map((text, i) => (
|
||||
<p key={`pr-${i}`} style={{ margin: '4px 0 0', color: 'var(--danger)', fontSize: '11px' }}>
|
||||
{text}
|
||||
</p>
|
||||
))}
|
||||
</div>
|
||||
<div>
|
||||
<div style={{ fontSize: '10px', fontWeight: 600, color: 'var(--text3)', marginBottom: '4px' }}>
|
||||
Beste Bibliotheks-Alternative
|
||||
</div>
|
||||
{lib ? (
|
||||
<>
|
||||
<div style={{ color: 'var(--accent-dark)' }}>
|
||||
{diff.proposed_title || '—'}
|
||||
{diff.proposed_exercise_id != null ? ` (#${diff.proposed_exercise_id})` : isAi ? ' (KI)' : ''}
|
||||
{lib.title || '—'}
|
||||
{lib.exercise_id != null ? ` (#${lib.exercise_id})` : ''}
|
||||
</div>
|
||||
<div style={{ fontSize: '10px', color: 'var(--text3)', marginTop: '4px' }}>
|
||||
{slotScoreLabel(lib.slot_score)}
|
||||
{slotDelta != null && Number(slotDelta) !== 0 ? (
|
||||
<span style={{ marginLeft: '6px', color: Number(slotDelta) > 0 ? 'var(--accent-dark)' : 'var(--text2)' }}>
|
||||
({Number(slotDelta) > 0 ? '+' : ''}{Math.round(Number(slotDelta) * 100)} PP)
|
||||
</span>
|
||||
) : null}
|
||||
{pathDelta != null ? (
|
||||
<span style={{ marginLeft: '6px' }}>· Pfad {pathDelta > 0 ? `+${pathDelta}` : pathDelta} %</span>
|
||||
) : null}
|
||||
</div>
|
||||
<ProContraList title="Pro" items={pc.proposed_pro} tone="pro" />
|
||||
<ProContraList title="Contra" items={pc.proposed_contra} tone="contra" />
|
||||
</div>
|
||||
</div>
|
||||
</span>
|
||||
</label>
|
||||
</>
|
||||
) : (
|
||||
<div style={{ color: 'var(--text3)' }}>Kein passender Bibliotheks-Treffer</div>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{lib ? (
|
||||
<label
|
||||
style={{
|
||||
display: 'flex',
|
||||
gap: '8px',
|
||||
alignItems: 'flex-start',
|
||||
cursor: 'pointer',
|
||||
padding: '8px',
|
||||
borderRadius: '6px',
|
||||
background: selected.has(libKey) ? 'var(--surface2)' : 'transparent',
|
||||
border: '1px solid var(--border)',
|
||||
marginBottom: ai ? '8px' : 0,
|
||||
}}
|
||||
>
|
||||
<input
|
||||
type="checkbox"
|
||||
checked={selected.has(libKey)}
|
||||
onChange={() => onToggle(libKey, 'library')}
|
||||
disabled={applying}
|
||||
style={{ marginTop: '3px' }}
|
||||
/>
|
||||
<span>
|
||||
<strong>Bibliothek übernehmen</strong>
|
||||
<span style={{ display: 'block', fontSize: '11px', color: 'var(--text3)', marginTop: '2px' }}>
|
||||
{lib.auto_select
|
||||
? 'Empfohlen — Stufen-Fit besser als aktuell'
|
||||
: 'Optional — nicht besser als aktuell bewertet'}
|
||||
</span>
|
||||
</span>
|
||||
</label>
|
||||
) : null}
|
||||
|
||||
{ai ? (
|
||||
<label
|
||||
style={{
|
||||
display: 'flex',
|
||||
gap: '8px',
|
||||
alignItems: 'flex-start',
|
||||
cursor: 'pointer',
|
||||
padding: '8px',
|
||||
borderRadius: '6px',
|
||||
background: selected.has(aiKey) ? 'var(--surface2)' : 'transparent',
|
||||
border: '1px solid var(--border)',
|
||||
}}
|
||||
>
|
||||
<input
|
||||
type="checkbox"
|
||||
checked={selected.has(aiKey)}
|
||||
onChange={() => onToggle(aiKey, 'ai')}
|
||||
disabled={applying}
|
||||
style={{ marginTop: '3px' }}
|
||||
/>
|
||||
<span>
|
||||
<strong>KI-Vorschlag nutzen</strong>
|
||||
<span style={{ display: 'block', fontSize: '11px', color: 'var(--text3)', marginTop: '2px' }}>
|
||||
{ai.title_hint || 'Neue Übung per KI entwerfen'}
|
||||
</span>
|
||||
</span>
|
||||
</label>
|
||||
) : null}
|
||||
</li>
|
||||
)
|
||||
}
|
||||
@@ -136,10 +205,10 @@ export default function ProgressionOptimizeCompareModal({
|
||||
onApplySelected,
|
||||
applying = false,
|
||||
}) {
|
||||
const dialogDiffs = useMemo(() => compareDiffsForDialog(comparison), [comparison])
|
||||
const slotReviews = useMemo(() => compareSlotReviews(comparison), [comparison])
|
||||
const rejected = useMemo(() => rejectedCompareDiffs(comparison), [comparison])
|
||||
const defaultSelected = useMemo(
|
||||
() => defaultSelectedCompareDiffs(comparison),
|
||||
() => new Set(defaultSelectedCompareDiffs(comparison)),
|
||||
[comparison],
|
||||
)
|
||||
|
||||
@@ -155,48 +224,59 @@ export default function ProgressionOptimizeCompareModal({
|
||||
const baselineQa = comparison.baseline_path_qa
|
||||
const baselinePct = pathQaQualityPercent(baselineQa)
|
||||
const rejectedCount = rejected.length
|
||||
const reviewError = comparison.review_error || null
|
||||
|
||||
const toggle = (midx) => {
|
||||
const toggle = (key, kind) => {
|
||||
setSelected((prev) => {
|
||||
const next = new Set(prev)
|
||||
if (next.has(midx)) next.delete(midx)
|
||||
else next.add(midx)
|
||||
const parsed = String(key)
|
||||
const midx = Number(parsed.split(':')[0])
|
||||
const libKey = slotReviewSelectionKey(midx, 'library')
|
||||
const aiKey = slotReviewSelectionKey(midx, 'ai')
|
||||
if (next.has(parsed)) {
|
||||
next.delete(parsed)
|
||||
return next
|
||||
}
|
||||
if (kind === 'library') next.delete(aiKey)
|
||||
if (kind === 'ai') next.delete(libKey)
|
||||
next.add(parsed)
|
||||
return next
|
||||
})
|
||||
}
|
||||
|
||||
const toggleAll = (on) => {
|
||||
setSelected(on ? new Set(dialogDiffs.map((d) => Number(d.roadmap_major_step_index))) : new Set())
|
||||
}
|
||||
|
||||
const title =
|
||||
mode === 'match' ? 'Übungs-Match — Verbesserungen' : 'Optimierung vergleichen'
|
||||
mode === 'match' ? 'Übungs-Match — Slot-Bewertung' : 'Optimierung vergleichen'
|
||||
|
||||
return (
|
||||
<div
|
||||
className="modal-overlay"
|
||||
role="dialog"
|
||||
aria-modal="true"
|
||||
aria-labelledby="optimize-compare-title"
|
||||
style={{ zIndex: 2200 }}
|
||||
onClick={(e) => {
|
||||
if (e.target === e.currentTarget && !applying) onClose()
|
||||
}}
|
||||
>
|
||||
<FormModalOverlay open={open} raised onBackdropClick={applying ? undefined : onClose}>
|
||||
<div
|
||||
className="card modal-content"
|
||||
style={{ maxWidth: '760px', width: '100%', maxHeight: '90vh', overflow: 'auto' }}
|
||||
className="card modal-panel--form modal-panel--narrow"
|
||||
style={{ maxHeight: '92vh', overflow: 'auto' }}
|
||||
onClick={(e) => e.stopPropagation()}
|
||||
>
|
||||
<h3 id="optimize-compare-title" style={{ marginTop: 0 }}>
|
||||
{title}
|
||||
</h3>
|
||||
<p style={{ fontSize: '12px', color: 'var(--text3)', marginTop: 0, lineHeight: 1.45 }}>
|
||||
Bewertung und Vorschläge in einem Durchlauf: je Slot wird geprüft, ob eine passendere
|
||||
Übung (Bibliothek oder KI) den Pfad verbessert. Nur messbare Verbesserungen erscheinen
|
||||
hier — mit Pro- und Contra-Punkten auf Slot-Ebene.
|
||||
Je Slot: aktuelle Bewertung, beste Bibliotheks-Alternative und optional KI. Haken nur
|
||||
vorausgewählt, wenn die Alternative einen höheren Stufen-Fit hat.
|
||||
</p>
|
||||
|
||||
{reviewError ? (
|
||||
<p
|
||||
style={{
|
||||
fontSize: '12px',
|
||||
color: 'var(--danger)',
|
||||
padding: '8px 10px',
|
||||
borderRadius: '8px',
|
||||
border: '1px solid var(--danger)',
|
||||
background: 'var(--surface2)',
|
||||
}}
|
||||
>
|
||||
{reviewError}
|
||||
</p>
|
||||
) : null}
|
||||
|
||||
<div
|
||||
style={{
|
||||
padding: '10px 12px',
|
||||
@@ -216,97 +296,37 @@ export default function ProgressionOptimizeCompareModal({
|
||||
|
||||
{rejectedCount > 0 ? (
|
||||
<p style={{ fontSize: '11px', color: 'var(--text2)', margin: '0 0 14px', lineHeight: 1.45 }}>
|
||||
{rejectedCount} Alternative(n) verworfen — kein QS-Gewinn gegenüber deinem Pfad
|
||||
{baselinePct != null ? ` (${baselinePct} %)` : ''}.
|
||||
{rejectedCount} Alternative(n) ohne Pfad-Gewinn
|
||||
{baselinePct != null ? ` (Basis ${baselinePct} %)` : ''}.
|
||||
</p>
|
||||
) : null}
|
||||
|
||||
{dialogDiffs.length === 0 ? (
|
||||
<>
|
||||
<p style={{ fontSize: '12px', color: 'var(--text2)' }}>
|
||||
Keine Bibliotheks-Verbesserung mit messbarem Gewinn — Schachstellen siehe unten.
|
||||
KI-Angebote im Bewertungs-Panel oder „Brücke / KI-Angebot“ nutzen.
|
||||
</p>
|
||||
{comparison?.problem_slots && Object.keys(comparison.problem_slots).length > 0 ? (
|
||||
<ul
|
||||
style={{
|
||||
listStyle: 'none',
|
||||
padding: 0,
|
||||
margin: '12px 0 0',
|
||||
display: 'flex',
|
||||
flexDirection: 'column',
|
||||
gap: '8px',
|
||||
}}
|
||||
>
|
||||
{Object.entries(comparison.problem_slots).map(([midxRaw, reasons]) => {
|
||||
const midx = Number(midxRaw)
|
||||
const reasonList = Array.isArray(reasons) ? reasons : [reasons]
|
||||
return (
|
||||
<li
|
||||
key={`problem-${midxRaw}`}
|
||||
style={{
|
||||
padding: '10px 12px',
|
||||
borderRadius: '8px',
|
||||
border: '1px solid var(--danger)',
|
||||
background: 'var(--surface2)',
|
||||
fontSize: '12px',
|
||||
}}
|
||||
>
|
||||
<strong style={{ color: 'var(--danger)' }}>
|
||||
Schachstelle Slot {midx + 1}
|
||||
</strong>
|
||||
<ul style={{ margin: '6px 0 0', paddingLeft: '16px', color: 'var(--text2)' }}>
|
||||
{reasonList.filter(Boolean).map((text, i) => (
|
||||
<li key={`${midxRaw}-r-${i}`}>{text}</li>
|
||||
))}
|
||||
</ul>
|
||||
</li>
|
||||
)
|
||||
})}
|
||||
</ul>
|
||||
) : null}
|
||||
</>
|
||||
{slotReviews.length === 0 ? (
|
||||
<p style={{ fontSize: '12px', color: 'var(--text2)' }}>
|
||||
Keine Slot-Daten — Backend-Stand prüfen oder erneut „Graph bewerten“ und „Übungen
|
||||
matchen“.
|
||||
</p>
|
||||
) : (
|
||||
<>
|
||||
<div style={{ display: 'flex', gap: '8px', marginBottom: '8px', flexWrap: 'wrap' }}>
|
||||
<button
|
||||
type="button"
|
||||
className="btn btn-secondary"
|
||||
style={{ fontSize: '11px' }}
|
||||
onClick={() => toggleAll(true)}
|
||||
>
|
||||
Alle wählen
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
className="btn btn-secondary"
|
||||
style={{ fontSize: '11px' }}
|
||||
onClick={() => toggleAll(false)}
|
||||
>
|
||||
Keine
|
||||
</button>
|
||||
</div>
|
||||
<ul
|
||||
style={{
|
||||
listStyle: 'none',
|
||||
padding: 0,
|
||||
margin: 0,
|
||||
display: 'flex',
|
||||
flexDirection: 'column',
|
||||
gap: '8px',
|
||||
}}
|
||||
>
|
||||
{dialogDiffs.map((diff) => (
|
||||
<DiffRow
|
||||
key={`improve-${diff.roadmap_major_step_index}-${diff.suggestion_type || 'lib'}`}
|
||||
diff={diff}
|
||||
checked={selected.has(Number(diff.roadmap_major_step_index))}
|
||||
onToggle={toggle}
|
||||
applying={applying}
|
||||
/>
|
||||
))}
|
||||
</ul>
|
||||
</>
|
||||
<ul
|
||||
style={{
|
||||
listStyle: 'none',
|
||||
padding: 0,
|
||||
margin: 0,
|
||||
display: 'flex',
|
||||
flexDirection: 'column',
|
||||
gap: '10px',
|
||||
}}
|
||||
>
|
||||
{slotReviews.map((review) => (
|
||||
<SlotReviewRow
|
||||
key={`slot-review-${review.roadmap_major_step_index}`}
|
||||
review={review}
|
||||
selected={selected}
|
||||
onToggle={toggle}
|
||||
applying={applying}
|
||||
/>
|
||||
))}
|
||||
</ul>
|
||||
)}
|
||||
|
||||
<div
|
||||
@@ -324,13 +344,13 @@ export default function ProgressionOptimizeCompareModal({
|
||||
<button
|
||||
type="button"
|
||||
className="btn btn-primary"
|
||||
disabled={applying || selected.size === 0 || dialogDiffs.length === 0}
|
||||
disabled={applying || selected.size === 0}
|
||||
onClick={() => onApplySelected([...selected])}
|
||||
>
|
||||
{applying ? 'Übernehmen …' : `Auswahl übernehmen (${selected.size})`}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</FormModalOverlay>
|
||||
)
|
||||
}
|
||||
Reference in new issue
Block a user