Enhance Progression Findings Panel with Rematch and Optimization Hints
Deploy Development / deploy (push) Successful in 46s
Test Suite / pytest-backend (push) Successful in 43s
Test Suite / lint-backend (push) Successful in 0s
Test Suite / build-frontend (push) Successful in 13s
Test Suite / k6 /health Baseline (push) Successful in 33s
Test Suite / playwright-tests (push) Successful in 1m13s
Deploy Development / deploy (push) Successful in 46s
Test Suite / pytest-backend (push) Successful in 43s
Test Suite / lint-backend (push) Successful in 0s
Test Suite / build-frontend (push) Successful in 13s
Test Suite / k6 /health Baseline (push) Successful in 33s
Test Suite / playwright-tests (push) Successful in 1m13s
- Added support for displaying optimization hints and rematch logs in the Progression Findings Panel, improving user feedback on potential enhancements. - Introduced new utility functions for formatting rematch log entries and resolving hint slot indices, enhancing clarity in displayed information. - Updated the Progression Graph Editor to handle rematch actions and display relevant match summaries, ensuring comprehensive insights during progression analysis. - Enhanced the utility functions to support the new features, ensuring robust handling of optimization actions and rematch logic.
This commit is contained in:
1 parent
df93da9a03
commit
de9fdf3ac0
3 files changed
+135
-2
No files matched your search
@@ -62,6 +62,50 @@ export function offerSourceLabel(source) {
|
||||
return OFFER_SOURCE_LABELS[source] || source || 'Angebot'
|
||||
}
|
||||
|
||||
const OPTIMIZATION_ACTION_LABELS = {
|
||||
rematch_slot: 'Slot neu matchen',
|
||||
bridge_or_gap_fill: 'Brücke / KI-Angebot',
|
||||
refine_stage_spec: 'Stufen-Spec verfeinern',
|
||||
review_roadmap: 'Roadmap prüfen',
|
||||
review: 'Prüfen',
|
||||
}
|
||||
|
||||
export function optimizationHintActionLabel(action) {
|
||||
return OPTIMIZATION_ACTION_LABELS[action] || action || 'Hinweis'
|
||||
}
|
||||
|
||||
/** Slot-Index aus optimization_hint (roadmap_major_step_index oder step_index). */
|
||||
export function resolveHintSlotIndex(hint, draft = null) {
|
||||
if (!hint || typeof hint !== 'object') return null
|
||||
const raw = hint.roadmap_major_step_index ?? hint.step_index
|
||||
if (raw == null || !Number.isFinite(Number(raw))) return null
|
||||
const idx = Number(raw)
|
||||
const slotCount = draft?.slots?.length
|
||||
if (slotCount != null && (idx < 0 || idx >= slotCount)) return null
|
||||
return idx
|
||||
}
|
||||
|
||||
export function formatRematchLogEntry(entry) {
|
||||
if (!entry || typeof entry !== 'object') return ''
|
||||
const slot = Number.isFinite(Number(entry.roadmap_major_step_index))
|
||||
? `Slot ${Number(entry.roadmap_major_step_index) + 1}`
|
||||
: 'Slot'
|
||||
const round = entry.round != null ? ` (Runde ${entry.round})` : ''
|
||||
if (entry.action === 'replaced') {
|
||||
const from = entry.replaced_title || (entry.replaced_exercise_id ? `#${entry.replaced_exercise_id}` : '—')
|
||||
const to = entry.new_title || (entry.new_exercise_id ? `#${entry.new_exercise_id}` : '—')
|
||||
return `${slot}${round}: „${from}“ → „${to}“`
|
||||
}
|
||||
if (entry.action === 'rematch_unfilled') {
|
||||
return `${slot}${round}: kein passender Ersatz (${entry.reason || 'unfilled'})`
|
||||
}
|
||||
return `${slot}${round}: ${entry.reason || entry.action || 'Rematch'}`
|
||||
}
|
||||
|
||||
export function hasRematchSlotHints(pathQa) {
|
||||
return (pathQa?.optimization_hints || []).some((h) => h?.action === 'rematch_slot')
|
||||
}
|
||||
|
||||
function createEmptySlot(index) {
|
||||
const phase = ROADMAP_PHASES[Math.min(index, ROADMAP_PHASES.length - 1)]
|
||||
return {
|
||||
|
||||
Reference in new issue
Block a user