Update Skill Scoring Specification and Implementation to v1.2
Deploy Development / deploy (push) Successful in 42s
Test Suite / pytest-backend (push) Successful in 38s
Test Suite / lint-backend (push) Successful in 1s
Test Suite / build-frontend (push) Successful in 13s
Test Suite / k6 /health Baseline (push) Successful in 33s
Test Suite / playwright-tests (push) Successful in 1m27s

- Enhanced the skill scoring system with category grouping and a universal scale for improved comparability across programs.
- Introduced new calculations for artifact share percentage and universal percent, allowing for a more nuanced understanding of skill contributions.
- Updated the API to reflect changes in the skill profile structure, including main category and top skill details.
- Improved frontend components to display skills by main category, enhancing user experience in skill discovery and profile visualization.
- Adjusted tests to validate the new scoring logic and ensure accurate representation of skills and their weights.
This commit is contained in:
Lars committed 2026-05-21 08:37:58 +02:00
1 parent 8f8bdf6d8b
commit 5200895a73
8 files changed
+604 -139

No files matched your search

@@ -8,6 +8,12 @@ const ARTIFACT_LABELS = {
progression_graph: 'Regressionspfad',
}
function formatScore(value) {
const n = Number(value)
if (!Number.isFinite(n)) return '0'
return n % 1 === 0 ? String(n) : n.toFixed(1)
}
/**
* Vorschläge für Planungsartefakte anhand gewählter Fähigkeiten (Phase 3).
*/
@@ -60,8 +66,8 @@ export default function SkillDiscoveryPanel({ skills = [] }) {
<h2 className="skill-discovery__title">Planungs-Vorschläge</h2>
<p className="form-sub skill-discovery__lead">
Wähle Fähigkeiten, die du schwerpunktmäßig entwickeln willst — Shinkan schlägt passende
Rahmenprogramme, Trainingsmodule und Regressionspfade aus der Bibliothek vor (gewichtet nach
Übungs-Verknüpfungen).
Rahmenprogramme, Trainingsmodule und Regressionspfade vor. Sortierung nach absolutem
Trainingsgewicht (nicht nach Anteil innerhalb des Plans).
</p>
<div className="form-row">
@@ -122,35 +128,51 @@ export default function SkillDiscoveryPanel({ skills = [] }) {
{result?.suggestions?.length > 0 ? (
<ul className="skill-discovery__results">
{result.suggestions.map((item) => (
<li key={`${item.artifact_type}-${item.artifact_id}`} className="skill-discovery__result card">
<div className="skill-discovery__result-head">
<span className="skill-discovery__result-type">
{ARTIFACT_LABELS[item.artifact_type] || item.artifact_type}
</span>
<span className="skill-discovery__result-match">
Passung {item.match?.match_percent ?? 0}%
</span>
</div>
<strong className="skill-discovery__result-title">
{item.artifact_title || `#${item.artifact_id}`}
</strong>
{item.match?.matched_skills?.length > 0 ? (
<p className="skill-discovery__result-skills">
{item.match.matched_skills.map((m) => m.skill_name).join(' · ')}
</p>
) : null}
{item.path ? (
<Link to={item.path} className="btn btn-secondary btn-small skill-discovery__result-link">
Öffnen
</Link>
) : item.artifact_type === 'progression_graph' ? (
<p className="form-sub" style={{ margin: '8px 0 0' }}>
Regressionspfad in der Übungsliste unter „Progressionsgraph“ bearbeiten.
</p>
) : null}
</li>
))}
{result.suggestions.map((item) => {
const matchScore = item.match?.match_score ?? item.match?.match_weight ?? 0
const focusPct = item.match?.artifact_focus_percent ?? item.match?.match_percent
const topByCat = item.skill_profile_summary?.top_by_category || []
return (
<li key={`${item.artifact_type}-${item.artifact_id}`} className="skill-discovery__result card">
<div className="skill-discovery__result-head">
<span className="skill-discovery__result-type">
{ARTIFACT_LABELS[item.artifact_type] || item.artifact_type}
</span>
<span className="skill-discovery__result-match" title="Summe der Trainingsgewichte der gewählten Fähigkeiten">
Gewicht {formatScore(matchScore)}
</span>
</div>
<strong className="skill-discovery__result-title">
{item.artifact_title || `#${item.artifact_id}`}
</strong>
{item.match?.matched_skills?.length > 0 ? (
<p className="skill-discovery__result-skills">
{item.match.matched_skills.map((m) => m.skill_name).join(' · ')}
{focusPct != null ? ` (${formatScore(focusPct)}% des Plans)` : null}
</p>
) : null}
{topByCat.length > 0 ? (
<ul className="skill-discovery__result-cats">
{topByCat.slice(0, 4).map((row) => (
<li key={`${row.category_name}-${row.skill_id}`}>
<span className="skill-discovery__result-cat-name">{row.category_name}</span>
<span>{row.skill_name}</span>
</li>
))}
</ul>
) : null}
{item.path ? (
<Link to={item.path} className="btn btn-secondary btn-small skill-discovery__result-link">
Öffnen
</Link>
) : item.artifact_type === 'progression_graph' ? (
<p className="form-sub" style={{ margin: '8px 0 0' }}>
Regressionspfad in der Übungsliste unter „Progressionsgraph“ bearbeiten.
</p>
) : null}
</li>
)
})}
</ul>
) : result && !loading ? (
<p className="form-sub skill-discovery__no-hit">