changed topic-hierarchy to use Angular Material tooltip. Fixed Tooltip to also show, when only navigating with tab (no only mouse over)

This commit is contained in:
Kazgatari
2026-06-21 19:43:45 +02:00
parent 479c144c8b
commit 3249a8569b
3 changed files with 61 additions and 18 deletions
@@ -48,8 +48,13 @@
@for (topic of filteredFlatTopics; track topic.id) {
<div class="flat-row">
<mat-checkbox
#tooltip="matTooltip"
[checked]="selectedTopics.has(topic.name)"
(change)="toggleTopic(topic.name)">
(change)="toggleTopic(topic.name)"
[matTooltip]="topic.name"
matTooltipPosition="above"
(focusin)="tooltip.show()"
(focusout)="tooltip.hide()">
<span class="topic-name">{{ topic.name }}</span>
</mat-checkbox>
<span class="topic-path" [title]="topic.path">{{
@@ -136,13 +141,16 @@
<!-- LEVEL 4: Topic Checkbox -->
<div class="tree-leaf topic-node">
<mat-checkbox
#tooltip="matTooltip"
[checked]="selectedTopics.has(topic.name)"
(change)="toggleTopic(topic.name)">
<span
class="topic-label"
[title]="topic.name"
>{{ topic.name }}</span
>
(change)="toggleTopic(topic.name)"
[matTooltip]="topic.name"
matTooltipPosition="above"
(focusin)="tooltip.show()"
(focusout)="tooltip.hide()">
<span class="topic-label">{{
topic.name
}}</span>
</mat-checkbox>
</div>
}
@@ -2,11 +2,13 @@
width: 100%;
max-height: 400px;
overflow-y: auto;
overflow-x: hidden;
border: 1px solid var(--sg-border);
border-radius: var(--sg-radius-sm);
background: var(--sg-background);
padding: 4px;
padding: 4px 8px 4px 4px;
margin-top: 4px;
box-sizing: border-box;
}
.loading-state {
@@ -55,6 +57,11 @@
font-size: 12px;
color: var(--sg-text);
font-weight: 500;
display: block;
width: 100%;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.topic-path {
@@ -92,7 +99,7 @@
width: 100%;
background: transparent;
border: none;
padding: 4px 6px;
padding: 4px;
text-align: left;
cursor: pointer;
border-radius: 4px;
@@ -122,6 +129,7 @@
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
min-width: 0;
}
}
@@ -158,37 +166,62 @@
}
.domain-children {
padding-left: 12px;
padding-left: 10px;
border-left: 1px solid var(--sg-border-soft);
margin-left: 12px;
margin-bottom: 4px;
}
.field-children {
padding-left: 14px;
padding-left: 10px;
border-left: 1px solid var(--sg-border-soft);
margin-left: 14px;
margin-left: 12px;
}
.subfield-children {
padding-left: 14px;
padding-left: 10px;
border-left: 1px dashed var(--sg-border-soft);
margin-left: 14px;
margin-left: 12px;
margin-bottom: 2px;
}
.tree-leaf {
padding: 2px 4px;
width: 100%;
box-sizing: border-box;
}
.topic-node {
width: 100%;
box-sizing: border-box;
.topic-label {
font-size: 11px;
color: var(--sg-text);
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
display: block;
max-width: 190px;
width: 100%;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
}
mat-checkbox {
display: block !important;
width: 100% !important;
::ng-deep {
.mdc-form-field {
width: 100% !important;
display: flex !important;
align-items: center;
}
.mdc-label {
flex: 1 !important;
min-width: 0 !important;
overflow: hidden;
padding-left: 8px !important;
}
}
}
@@ -11,6 +11,7 @@ import { MatCheckboxModule } from '@angular/material/checkbox';
import { MatIconModule } from '@angular/material/icon';
import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
import { MatRadioModule } from '@angular/material/radio';
import { MatTooltipModule } from '@angular/material/tooltip';
import { TopicsService } from '../../api/api/topics.service';
import { Subject, of } from 'rxjs';
import {
@@ -55,6 +56,7 @@ interface FlatTopic {
MatIconModule,
MatProgressSpinnerModule,
MatRadioModule,
MatTooltipModule,
],
templateUrl: './topic-hierarchy.component.html',
styleUrl: './topic-hierarchy.component.scss',