feat(weights-sliders): add name matching hint with visual indicators

This commit is contained in:
Steven Tischer
2026-08-15 11:35:36 +02:00
parent 08bc87e764
commit 66487c20e7
4 changed files with 50 additions and 0 deletions
@@ -116,6 +116,7 @@ export class KeywordsToPersonsResultsComponent implements OnInit {
icon: 'business',
description:
'Gewichtet die Anzahl der Unternehmensgründungen (Handelsregister-Verbindungen).',
nameMatched: true,
defaultValue: 0.5,
queryParamName: 'wCompanies',
},
@@ -125,6 +126,7 @@ export class KeywordsToPersonsResultsComponent implements OnInit {
icon: 'visibility',
description:
'Gewichtet die öffentliche Sichtbarkeit über Nennungen in Nachrichtenartikeln.',
nameMatched: true,
defaultValue: 0.5,
queryParamName: 'wNews',
},
@@ -133,6 +135,7 @@ export class KeywordsToPersonsResultsComponent implements OnInit {
label: 'Patente',
icon: 'workspace_premium',
description: 'Gewichtet Innovations- und Transferleistung über Patente.',
nameMatched: true,
defaultValue: 0.5,
queryParamName: 'wPatents',
},
@@ -25,6 +25,11 @@
<mat-icon class="icon-small">{{ option.icon }}</mat-icon>
}
<span>{{ option.label }}</span>
@if (option.nameMatched) {
<mat-icon class="icon-small name-match-star" aria-hidden="true">
star
</mat-icon>
}
</div>
<div class="slider-container">
@@ -51,6 +56,16 @@
}
</div>
<!-- Name-Match Note -->
@if (hasNameMatchedOption) {
<p class="name-match-note">
<mat-icon class="icon-small">star</mat-icon>
Diese Kennzahlen basieren auf einem automatischen Namensabgleich mit
externen Quellen, wodurch es in Einzelfällen zu Fehlzuordnungen kommen
kann.
</p>
}
<!-- Validation Warning -->
@if (!weightsState().valid) {
<div class="weight-warning">
@@ -108,6 +108,28 @@ $touch-target: 44px;
padding: 0 6px;
}
::ng-deep .name-match-star {
color: var(--sg-warning, #b8860b);
}
/* ============================================================
NAME MATCH NOTE
============================================================ */
.name-match-note {
display: flex;
align-items: flex-start;
gap: 0.3rem;
margin: 0.3rem 0 0;
padding: 0.2rem 0.3rem;
font-size: 0.7rem;
color: var(--sg-text-muted);
mat-icon {
flex: 0 0 auto;
color: var(--sg-warning, #b8860b);
}
}
/* ============================================================
WARNING
============================================================ */
@@ -28,6 +28,12 @@ export interface WeightSliderOption {
icon?: string;
description?: string;
/**
* Marks this metric with a star, indicating it relies on name matching
* (see weight-name-match-note in the template).
*/
nameMatched?: boolean;
/**
* Optional default raw weight.
* Must be between 0 and 1.
@@ -212,6 +218,10 @@ export class WeightsSlidersComponent implements OnInit, OnChanges {
}
}
get hasNameMatchedOption(): boolean {
return this.options.some((option) => option.nameMatched);
}
weightControl(key: string): FormControl<number> {
const control = this.form.controls[key];