feat(compare-authors): add name matching note to section 2

This commit is contained in:
Steven Tischer
2026-08-15 11:42:35 +02:00
parent 66487c20e7
commit cbfa60ae46
4 changed files with 59 additions and 3 deletions
@@ -168,7 +168,16 @@
@for (row of rows; track row.label) {
<tr>
<th scope="row" class="metric-col">
<span class="metric-label">{{ row.label }}</span>
<span class="metric-label">
{{ row.label }}
@if (row.nameMatched) {
<mat-icon
class="icon-small name-match-star"
aria-hidden="true">
star
</mat-icon>
}
</span>
<span class="metric-hint">{{ row.hint }}</span>
@if (row.kind === 'group') {
<span class="position-legend">
@@ -222,4 +231,12 @@
</tbody>
</table>
</div>
@if (hasNameMatchedRow(rows)) {
<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>
}
</ng-template>
@@ -122,7 +122,10 @@ app-chip mat-icon {
}
.metric-label {
display: block;
display: flex;
align-items: center;
justify-content: center;
gap: 4px;
font-weight: 600;
color: var(--sg-text);
}
@@ -135,6 +138,31 @@ app-chip mat-icon {
color: var(--sg-text-soft);
}
.icon-small {
font-size: 14px;
width: 14px;
height: 14px;
vertical-align: text-bottom;
}
.name-match-star {
color: var(--sg-warning, #b8860b);
}
.name-match-note {
display: flex;
align-items: center;
gap: 6px;
margin: 10px 0 0;
font-size: 12px;
color: var(--sg-text-muted);
mat-icon {
flex: 0 0 auto;
color: var(--sg-warning, #b8860b);
}
}
.value-cell {
text-align: center;
font-variant-numeric: tabular-nums;
@@ -98,6 +98,7 @@ interface MetricRow {
cells: MetricCell[];
segments: GroupSegment[];
groupCells: GroupCell[];
nameMatched: boolean;
}
interface RowDef {
@@ -105,6 +106,7 @@ interface RowDef {
hint: string;
select: (a: AuthorSummary) => number | null;
decimals?: boolean;
nameMatched?: boolean;
}
interface SegmentDef {
@@ -385,15 +387,18 @@ export class CompareAuthorsComponent implements OnInit {
label: 'Unternehmensgründungen',
hint: 'Handelsregister-Verbindungen über den Namen',
select: (a) => a.companies,
nameMatched: true,
},
{
label: 'News-Artikel',
hint: 'Nachrichtenartikel, die die Person namentlich nennen',
select: (a) => a.news,
nameMatched: true,
},
{
label: 'Patente',
hint: 'Der Person zugeordnete Patente',
nameMatched: true,
select: (a) => a.patents,
},
]),
@@ -707,6 +712,7 @@ export class CompareAuthorsComponent implements OnInit {
})),
segments: [],
groupCells: [],
nameMatched: def.nameMatched ?? false,
};
});
}
@@ -731,9 +737,14 @@ export class CompareAuthorsComponent implements OnInit {
groupCells: this.summary().map((a) => ({
values: segs.map((s) => s.select(a)),
})),
nameMatched: false,
};
}
hasNameMatchedRow(rows: MetricRow[]): boolean {
return rows.some((row) => row.nameMatched);
}
ngOnInit(): void {
// everything is read from the URL so a shared link lands on the same view
const rawAuthors = this.route.snapshot.queryParamMap.get('authors') ?? '';
@@ -117,7 +117,7 @@ $touch-target: 44px;
============================================================ */
.name-match-note {
display: flex;
align-items: flex-start;
align-items: center;
gap: 0.3rem;
margin: 0.3rem 0 0;
padding: 0.2rem 0.3rem;