Enhance Progression Path Comparison and Slot Evaluation Features
Deploy Development / deploy (push) Successful in 43s
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 1m12s
Deploy Development / deploy (push) Successful in 43s
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 1m12s
- Introduced new fields in `ProgressionPathSuggestRequest` for baseline evaluation and incremental scoring, improving the assessment of proposed paths. - Implemented `_apply_slot_diff_to_steps` and `_score_incremental_slot_diffs` functions to manage slot differences and evaluate their impact on quality scores. - Updated `ProgressionGraphEditor` to streamline the match comparison flow, integrating new evaluation parameters and improving user notifications. - Enhanced `ProgressionOptimizeCompareModal` to better display proposed path suggestions, including pro/con evaluations and quality delta metrics. - Refactored utility functions for clearer handling of slot differences and improved overall data management in the progression graph editor.
This commit is contained in:
1 parent
19bbcdaf50
commit
85fccdd093
5 files changed
+1098
-282
No files matched your search
@@ -28,11 +28,13 @@ import {
|
||||
applyEvaluateResponseToDraft,
|
||||
applyGapOfferToDraft,
|
||||
applySelectedCompareSteps,
|
||||
applySelectedSlotSuggestions,
|
||||
applyResolvedStructuredToDraft,
|
||||
buildPlanningArtifactFromDraft,
|
||||
buildProgressionComparePayload,
|
||||
collectGapOffersFromApiResponse,
|
||||
compareSlotDiffs,
|
||||
compareDiffsForDialog,
|
||||
dedupeGapOffersBySlot,
|
||||
draftHasLibrarySlotAssignments,
|
||||
draftRetrievalBoostExerciseIds,
|
||||
@@ -47,7 +49,7 @@ import {
|
||||
patchSlotInDraft,
|
||||
pathQaQualityPercent,
|
||||
planningCatalogContextToApi,
|
||||
recommendedCompareDiffs,
|
||||
rejectedCompareDiffs,
|
||||
removeSlotFromDraft,
|
||||
saveProgressionGraphDraft,
|
||||
setCatalogSelectItems,
|
||||
@@ -491,24 +493,20 @@ export default function ProgressionGraphEditor({ graphId, embedded = false, onSa
|
||||
}
|
||||
}
|
||||
|
||||
const fetchFullMatch = async (synced) =>
|
||||
api.suggestProgressionPath({
|
||||
const runMatchCompareFlow = async (synced, { source = 'match' } = {}) => {
|
||||
setMatchNotice('Pfad bewerten und je Slot passende Verbesserungen prüfen…')
|
||||
const reviewRes = await api.suggestProgressionPath({
|
||||
...buildMatchRequestBase(synced),
|
||||
preserve_slot_assignments: false,
|
||||
unified_slot_review: true,
|
||||
baseline_evaluate_steps: slotsToEvaluateSteps(synced),
|
||||
include_llm_intent: false,
|
||||
include_llm_path_qa: false,
|
||||
auto_rematch_after_qa: false,
|
||||
})
|
||||
setPathQa(reviewRes?.path_qa || null)
|
||||
|
||||
const runMatchCompareFlow = async (synced, { source = 'match' } = {}) => {
|
||||
setMatchNotice('Schritt 1/2: Aktuellen Pfad bewerten…')
|
||||
const baselineRes = await fetchPathEvaluate(synced)
|
||||
setPathQa(baselineRes?.path_qa || null)
|
||||
|
||||
setMatchNotice('Schritt 2/2: Match für alle Slots (Bibliothek + Lücken)…')
|
||||
const matchRes = await fetchFullMatch(synced)
|
||||
|
||||
const compareRes = buildProgressionComparePayload(baselineRes, matchRes)
|
||||
setGapFillOffers(mergeGapOffersForDraft(synced, baselineRes, matchRes))
|
||||
const compareRes = buildProgressionComparePayload(null, reviewRes)
|
||||
setGapFillOffers(mergeGapOffersForDraft(synced, reviewRes, reviewRes))
|
||||
presentMatchCompare(compareRes, { source })
|
||||
return compareRes
|
||||
}
|
||||
@@ -522,31 +520,20 @@ export default function ProgressionGraphEditor({ graphId, embedded = false, onSa
|
||||
setCompareOpen(true)
|
||||
|
||||
const baselineQa = res?.baseline_path_qa || null
|
||||
const proposedQa = res?.proposed_path_qa || res?.path_qa || null
|
||||
const diffCount =
|
||||
res?.slot_diff_count_recommended
|
||||
?? recommendedCompareDiffs(res).length
|
||||
?? res?.slot_diff_count
|
||||
?? compareSlotDiffs(res, { actionableOnly: true }).length
|
||||
const replaceCount = (res?.slot_diffs || []).filter(
|
||||
(d) => d?.diff_kind === 'replace',
|
||||
).length
|
||||
const diffCount = res?.slot_diff_count ?? compareDiffsForDialog(res).length
|
||||
const rejectedCount = res?.slot_diff_count_rejected ?? rejectedCompareDiffs(res).length
|
||||
const bPct = pathQaQualityPercent(baselineQa)
|
||||
const pPct = pathQaQualityPercent(proposedQa)
|
||||
let notice =
|
||||
diffCount > 0
|
||||
? `Match: ${diffCount} Lückenfüllung(en) im Dialog — nur diese sind vorausgewählt.`
|
||||
: 'Match: Keine Bibliotheks-Lückenfüllungen — Dialog zur Kontrolle geöffnet.'
|
||||
if (replaceCount > 0) {
|
||||
notice += ` ${replaceCount} optionale Ersetzung(en) bestehender Slots — standardmäßig abgewählt.`
|
||||
? `Match: ${diffCount} Verbesserung(en) — je Slot gegen deinen Pfad (${bPct != null ? `${bPct} %` : 'QS'}) geprüft.`
|
||||
: 'Match: Keine messbare Verbesserung gegenüber deinem Pfad.'
|
||||
if (rejectedCount > 0) {
|
||||
notice += ` ${rejectedCount} Vorschlag/Vorschläge verworfen (Verschlechterung oder neutral).`
|
||||
}
|
||||
const gapCount = collectGapOffersFromApiResponse(res).length
|
||||
if (gapCount > 0) {
|
||||
notice += ` ${gapCount} KI-Angebot(e) für leere Slots im Panel „Graph-Bewertung“.`
|
||||
}
|
||||
if (bPct != null && pPct != null && pPct !== bPct) {
|
||||
notice += ` Pfad-QS Vorschlag fair bewertet: ${bPct} % → ${pPct} %.`
|
||||
}
|
||||
setMatchNotice(notice)
|
||||
}
|
||||
|
||||
@@ -603,11 +590,13 @@ export default function ProgressionGraphEditor({ graphId, embedded = false, onSa
|
||||
setCompareApplying(true)
|
||||
try {
|
||||
const synced = syncProgressionRoadmapFromSlots(draft)
|
||||
const nextDraft = applySelectedCompareSteps(
|
||||
synced,
|
||||
comparePayload.proposed_steps || comparePayload.steps,
|
||||
selectedMajorIndices,
|
||||
)
|
||||
const nextDraft = comparePayload?.unified_slot_review
|
||||
? applySelectedSlotSuggestions(synced, comparePayload, selectedMajorIndices)
|
||||
: applySelectedCompareSteps(
|
||||
synced,
|
||||
comparePayload.proposed_steps || comparePayload.steps,
|
||||
selectedMajorIndices,
|
||||
)
|
||||
const syncedNext = syncProgressionRoadmapFromSlots(nextDraft)
|
||||
const evalRes = await fetchPathEvaluate(syncedNext)
|
||||
const { draft: evaluated, remainingOffers } = applyEvaluateResult(syncedNext, evalRes)
|
||||
|
||||
@@ -1,14 +1,13 @@
|
||||
/**
|
||||
* Gegenüberstellung: bestehender Pfad vs. optimierter Match-Vorschlag.
|
||||
* Gegenüberstellung: Verbesserungsvorschläge mit Slot-Bewertung (Pro/Contra).
|
||||
*/
|
||||
import React, { useMemo, useState } from 'react'
|
||||
import {
|
||||
compareDiffsForDialog,
|
||||
defaultSelectedCompareDiffs,
|
||||
gapOnlyCompareDiffs,
|
||||
optionalReplaceCompareDiffs,
|
||||
pathQaQualityPercent,
|
||||
recommendedCompareDiffs,
|
||||
qualityDeltaPercent,
|
||||
rejectedCompareDiffs,
|
||||
} from '../utils/progressionGraphDraft'
|
||||
|
||||
function qaLabel(pathQa) {
|
||||
@@ -18,25 +17,44 @@ function qaLabel(pathQa) {
|
||||
return ok ? 'OK' : 'Hinweise'
|
||||
}
|
||||
|
||||
function DiffRow({ diff, checked, onToggle, applying, tone = 'neutral' }) {
|
||||
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 ProContraList({ title, items, tone = 'neutral' }) {
|
||||
if (!items?.length) return null
|
||||
const color =
|
||||
tone === 'pro' ? 'var(--accent-dark)' : tone === 'contra' ? 'var(--danger)' : 'var(--text2)'
|
||||
return (
|
||||
<div style={{ marginTop: '6px' }}>
|
||||
<div style={{ fontSize: '10px', fontWeight: 600, color: 'var(--text3)' }}>{title}</div>
|
||||
<ul style={{ margin: '4px 0 0', paddingLeft: '16px', color, fontSize: '11px' }}>
|
||||
{items.map((text, i) => (
|
||||
<li key={`${title}-${i}`}>{text}</li>
|
||||
))}
|
||||
</ul>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
function DiffRow({ diff, checked, onToggle, applying }) {
|
||||
const midx = Number(diff.roadmap_major_step_index)
|
||||
const border =
|
||||
tone === 'warn'
|
||||
? '1px solid color-mix(in srgb, var(--danger) 35%, var(--border))'
|
||||
: '1px solid var(--border)'
|
||||
const bg = checked
|
||||
? tone === 'warn'
|
||||
? 'color-mix(in srgb, var(--danger) 6%, var(--surface2))'
|
||||
: 'var(--surface2)'
|
||||
: 'var(--surface)'
|
||||
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
|
||||
|
||||
return (
|
||||
<li
|
||||
style={{
|
||||
padding: '10px 12px',
|
||||
borderRadius: '8px',
|
||||
border,
|
||||
background: bg,
|
||||
border: '1px solid var(--border)',
|
||||
background: checked ? 'var(--surface2)' : 'var(--surface)',
|
||||
fontSize: '12px',
|
||||
}}
|
||||
>
|
||||
@@ -49,28 +67,60 @@ function DiffRow({ diff, checked, onToggle, applying, tone = 'neutral' }) {
|
||||
style={{ marginTop: '3px' }}
|
||||
/>
|
||||
<span style={{ flex: 1 }}>
|
||||
<strong>Slot {midx + 1}</strong>
|
||||
{tone === 'warn' ? (
|
||||
<span style={{ marginLeft: '6px', fontSize: '10px', color: 'var(--danger)' }}>
|
||||
Ersetzt deine Zuordnung
|
||||
</span>
|
||||
) : null}
|
||||
<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: 'grid',
|
||||
gridTemplateColumns: '1fr 1fr',
|
||||
gap: '8px',
|
||||
marginTop: '6px',
|
||||
gap: '10px',
|
||||
marginTop: '8px',
|
||||
}}
|
||||
>
|
||||
<span style={{ color: 'var(--text2)' }}>
|
||||
Bisher: {diff.baseline_title || '— leer —'}
|
||||
{diff.baseline_exercise_id != null ? ` (#${diff.baseline_exercise_id})` : ''}
|
||||
</span>
|
||||
<span style={{ color: tone === 'warn' ? 'var(--danger)' : 'var(--accent-dark)' }}>
|
||||
Neu: {diff.proposed_title || '— leer —'}
|
||||
{diff.proposed_exercise_id != null ? ` (#${diff.proposed_exercise_id})` : ''}
|
||||
</span>
|
||||
<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={{ color: 'var(--accent-dark)' }}>
|
||||
{diff.proposed_title || '—'}
|
||||
{diff.proposed_exercise_id != null ? ` (#${diff.proposed_exercise_id})` : isAi ? ' (KI)' : ''}
|
||||
</div>
|
||||
<ProContraList title="Pro" items={pc.proposed_pro} tone="pro" />
|
||||
<ProContraList title="Contra" items={pc.proposed_contra} tone="contra" />
|
||||
</div>
|
||||
</div>
|
||||
</span>
|
||||
</label>
|
||||
@@ -86,16 +136,8 @@ export default function ProgressionOptimizeCompareModal({
|
||||
onApplySelected,
|
||||
applying = false,
|
||||
}) {
|
||||
const recommended = useMemo(
|
||||
() => recommendedCompareDiffs(comparison),
|
||||
[comparison],
|
||||
)
|
||||
const optionalReplace = useMemo(
|
||||
() => optionalReplaceCompareDiffs(comparison),
|
||||
[comparison],
|
||||
)
|
||||
const gapOnly = useMemo(() => gapOnlyCompareDiffs(comparison), [comparison])
|
||||
const dialogDiffs = useMemo(() => compareDiffsForDialog(comparison), [comparison])
|
||||
const rejected = useMemo(() => rejectedCompareDiffs(comparison), [comparison])
|
||||
const defaultSelected = useMemo(
|
||||
() => defaultSelectedCompareDiffs(comparison),
|
||||
[comparison],
|
||||
@@ -111,18 +153,8 @@ export default function ProgressionOptimizeCompareModal({
|
||||
if (!open || !comparison) return null
|
||||
|
||||
const baselineQa = comparison.baseline_path_qa
|
||||
const pipelineQa = comparison.proposed_path_qa_pipeline
|
||||
const baselinePct = pathQaQualityPercent(baselineQa)
|
||||
const pipelinePct = pathQaQualityPercent(pipelineQa)
|
||||
const rematchRounds = pipelineQa?.rematch_rounds
|
||||
const rematchCount = Array.isArray(pipelineQa?.rematch_log) ? pipelineQa.rematch_log.length : 0
|
||||
const refineCount = Array.isArray(pipelineQa?.refine_log) ? pipelineQa.refine_log.length : 0
|
||||
const hintCount = Number(pipelineQa?.optimization_hint_count || 0)
|
||||
const tierCount = Array.isArray(pipelineQa?.qa_tiers) ? pipelineQa.qa_tiers.length : 0
|
||||
|
||||
const selectedReplaceCount = optionalReplace.filter((d) =>
|
||||
selected.has(Number(d.roadmap_major_step_index)),
|
||||
).length
|
||||
const rejectedCount = rejected.length
|
||||
|
||||
const toggle = (midx) => {
|
||||
setSelected((prev) => {
|
||||
@@ -133,20 +165,12 @@ export default function ProgressionOptimizeCompareModal({
|
||||
})
|
||||
}
|
||||
|
||||
const toggleGroup = (diffs, on) => {
|
||||
setSelected((prev) => {
|
||||
const next = new Set(prev)
|
||||
for (const d of diffs) {
|
||||
const midx = Number(d.roadmap_major_step_index)
|
||||
if (on) next.add(midx)
|
||||
else next.delete(midx)
|
||||
}
|
||||
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 — Vorschläge prüfen' : 'Optimierung vergleichen'
|
||||
mode === 'match' ? 'Übungs-Match — Verbesserungen' : 'Optimierung vergleichen'
|
||||
|
||||
return (
|
||||
<div
|
||||
@@ -161,201 +185,90 @@ export default function ProgressionOptimizeCompareModal({
|
||||
>
|
||||
<div
|
||||
className="card modal-content"
|
||||
style={{ maxWidth: '720px', width: '100%', maxHeight: '90vh', overflow: 'auto' }}
|
||||
style={{ maxWidth: '760px', width: '100%', maxHeight: '90vh', 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 }}>
|
||||
Übernimm nur, was deinen Pfad verbessert. Leere Slots mit Bibliotheks-Treffer sind
|
||||
vorausgewählt; Ersetzungen bestehender Übungen sind optional und oft schlechter.
|
||||
KI-Entwürfe ohne Bibliotheks-ID gehören ins Panel „KI-Angebote“, nicht hierher.
|
||||
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.
|
||||
</p>
|
||||
|
||||
<div
|
||||
style={{
|
||||
marginBottom: '12px',
|
||||
padding: '10px 12px',
|
||||
borderRadius: '8px',
|
||||
border: '1px solid color-mix(in srgb, var(--accent) 30%, var(--border))',
|
||||
background: 'color-mix(in srgb, var(--accent) 6%, var(--surface2))',
|
||||
border: '1px solid var(--border)',
|
||||
background: 'var(--surface2)',
|
||||
fontSize: '12px',
|
||||
lineHeight: 1.45,
|
||||
}}
|
||||
>
|
||||
<strong>Warum nicht einfach alles übernehmen?</strong>
|
||||
<p style={{ margin: '6px 0 0', color: 'var(--text2)' }}>
|
||||
Der Match-Lauf optimiert den <em>gesamten</em> Pfad neu (inkl. Rematch). Das kann
|
||||
bereits gute Slots verschlechtern. Die Prozentzahl rechts bezieht sich auf diesen
|
||||
Ganzpfad — nicht darauf, dass deine Auswahl besser ist. Nimm deshalb standardmäßig
|
||||
nur Lückenfüllungen an.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div
|
||||
style={{
|
||||
display: 'grid',
|
||||
gridTemplateColumns: '1fr 1fr',
|
||||
gap: '12px',
|
||||
marginBottom: '14px',
|
||||
}}
|
||||
>
|
||||
<div
|
||||
style={{
|
||||
padding: '10px 12px',
|
||||
borderRadius: '8px',
|
||||
border: '1px solid var(--border)',
|
||||
background: 'var(--surface2)',
|
||||
fontSize: '12px',
|
||||
}}
|
||||
>
|
||||
<strong>Dein Pfad (bewertet)</strong>
|
||||
<div style={{ marginTop: '6px' }}>{qaLabel(baselineQa)}</div>
|
||||
{baselineQa?.topic_coverage ? (
|
||||
<p style={{ margin: '6px 0 0', color: 'var(--text2)' }}>{baselineQa.topic_coverage}</p>
|
||||
) : null}
|
||||
</div>
|
||||
<div
|
||||
style={{
|
||||
padding: '10px 12px',
|
||||
borderRadius: '8px',
|
||||
border: '1px solid color-mix(in srgb, var(--text3) 35%, var(--border))',
|
||||
background: 'var(--surface2)',
|
||||
fontSize: '12px',
|
||||
}}
|
||||
>
|
||||
<strong>Match-Ganzpfad (nur Info)</strong>
|
||||
<div style={{ marginTop: '6px', color: 'var(--text2)' }}>
|
||||
{pipelineQa ? qaLabel(pipelineQa) : '—'}
|
||||
</div>
|
||||
<p style={{ margin: '6px 0 0', fontSize: '11px', color: 'var(--text3)' }}>
|
||||
Rematch-Prozess — kein Versprechen für deine Checkbox-Auswahl.
|
||||
{pipelinePct != null && baselinePct != null && pipelinePct < baselinePct
|
||||
? ` (${pipelinePct} % < ${baselinePct} % bei voller Übernahme).`
|
||||
: ''}
|
||||
</p>
|
||||
</div>
|
||||
<strong>Dein Pfad</strong>
|
||||
<div style={{ marginTop: '6px' }}>{qaLabel(baselineQa)}</div>
|
||||
{baselineQa?.topic_coverage ? (
|
||||
<p style={{ margin: '6px 0 0', color: 'var(--text2)' }}>{baselineQa.topic_coverage}</p>
|
||||
) : null}
|
||||
</div>
|
||||
|
||||
{tierCount > 0 || rematchCount > 0 || refineCount > 0 || hintCount > 0 ? (
|
||||
{rejectedCount > 0 ? (
|
||||
<p style={{ fontSize: '11px', color: 'var(--text2)', margin: '0 0 14px', lineHeight: 1.45 }}>
|
||||
Rematch-Protokoll
|
||||
{tierCount > 0 ? ` · ${tierCount} QS-Stufen` : ''}
|
||||
{rematchCount > 0
|
||||
? ` · ${rematchRounds != null ? `${rematchRounds} Runde(n)` : ''}: ${rematchCount} Anpassung(en)`
|
||||
: ''}
|
||||
{refineCount > 0 ? ` · ${refineCount} Stufen-Spec verfeinert` : ''}
|
||||
{hintCount > 0 ? ` · ${hintCount} Handlungshinweis(e)` : ''}
|
||||
</p>
|
||||
) : null}
|
||||
|
||||
{gapOnly.length > 0 ? (
|
||||
<p style={{ fontSize: '11px', color: 'var(--text2)', margin: '0 0 14px', lineHeight: 1.45 }}>
|
||||
Slot{gapOnly.length > 1 ? 's' : ''}{' '}
|
||||
{gapOnly.map((d) => Number(d.roadmap_major_step_index) + 1).join(', ')}: kein
|
||||
Bibliotheks-Treffer — bitte „KI-Angebote“ im Panel nutzen (eigenständig pro Slot).
|
||||
{rejectedCount} Alternative(n) verworfen — kein QS-Gewinn gegenüber deinem Pfad
|
||||
{baselinePct != null ? ` (${baselinePct} %)` : ''}.
|
||||
</p>
|
||||
) : null}
|
||||
|
||||
{dialogDiffs.length === 0 ? (
|
||||
<p style={{ fontSize: '12px', color: 'var(--text2)' }}>
|
||||
Keine übernehmbaren Bibliotheks-Änderungen. Leere Slots ggf. über KI-Angebote im Panel
|
||||
befüllen — nichts am Pfad ändern ist oft die richtige Wahl.
|
||||
Keine Verbesserung gefunden — dein Pfad ist für alle Slots bereits optimal bewertet
|
||||
oder es fehlen passende Bibliotheks-Treffer (KI-Angebote im Bewertungs-Panel).
|
||||
</p>
|
||||
) : (
|
||||
<>
|
||||
{recommended.length > 0 ? (
|
||||
<>
|
||||
<h4 style={{ margin: '0 0 8px', fontSize: '0.9rem' }}>
|
||||
Lücken füllen (empfohlen)
|
||||
</h4>
|
||||
<div style={{ display: 'flex', gap: '8px', marginBottom: '8px', flexWrap: 'wrap' }}>
|
||||
<button
|
||||
type="button"
|
||||
className="btn btn-secondary"
|
||||
style={{ fontSize: '11px' }}
|
||||
onClick={() => toggleGroup(recommended, true)}
|
||||
>
|
||||
Alle Lücken wählen
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
className="btn btn-secondary"
|
||||
style={{ fontSize: '11px' }}
|
||||
onClick={() => toggleGroup(recommended, false)}
|
||||
>
|
||||
Keine
|
||||
</button>
|
||||
</div>
|
||||
<ul
|
||||
style={{
|
||||
listStyle: 'none',
|
||||
padding: 0,
|
||||
margin: '0 0 16px',
|
||||
display: 'flex',
|
||||
flexDirection: 'column',
|
||||
gap: '8px',
|
||||
}}
|
||||
>
|
||||
{recommended.map((diff) => (
|
||||
<DiffRow
|
||||
key={`fill-${diff.roadmap_major_step_index}`}
|
||||
diff={diff}
|
||||
checked={selected.has(Number(diff.roadmap_major_step_index))}
|
||||
onToggle={toggle}
|
||||
applying={applying}
|
||||
/>
|
||||
))}
|
||||
</ul>
|
||||
</>
|
||||
) : null}
|
||||
|
||||
{optionalReplace.length > 0 ? (
|
||||
<>
|
||||
<h4 style={{ margin: '0 0 8px', fontSize: '0.9rem', color: 'var(--danger)' }}>
|
||||
Bestehende Slots ersetzen (optional — oft Verschlechterung)
|
||||
</h4>
|
||||
<p style={{ fontSize: '11px', color: 'var(--text2)', margin: '0 0 8px' }}>
|
||||
Standard: abgewählt. Nur aktivieren, wenn du die konkrete Übung bewusst tauschen
|
||||
willst.
|
||||
</p>
|
||||
<ul
|
||||
style={{
|
||||
listStyle: 'none',
|
||||
padding: 0,
|
||||
margin: 0,
|
||||
display: 'flex',
|
||||
flexDirection: 'column',
|
||||
gap: '8px',
|
||||
}}
|
||||
>
|
||||
{optionalReplace.map((diff) => (
|
||||
<DiffRow
|
||||
key={`replace-${diff.roadmap_major_step_index}`}
|
||||
diff={diff}
|
||||
checked={selected.has(Number(diff.roadmap_major_step_index))}
|
||||
onToggle={toggle}
|
||||
applying={applying}
|
||||
tone="warn"
|
||||
/>
|
||||
))}
|
||||
</ul>
|
||||
</>
|
||||
) : null}
|
||||
<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>
|
||||
</>
|
||||
)}
|
||||
|
||||
{selectedReplaceCount > 0 ? (
|
||||
<p
|
||||
className="form-error"
|
||||
style={{ marginTop: '12px', fontSize: '11px' }}
|
||||
>
|
||||
{selectedReplaceCount} Ersetzung(en) gewählt — kann Pfad-QS senken. Lückenfüllungen
|
||||
sind unkritischer.
|
||||
</p>
|
||||
) : null}
|
||||
|
||||
<div
|
||||
style={{
|
||||
display: 'flex',
|
||||
|
||||
Reference in new issue
Block a user