Add tooltips to icons
And add icon next to the trace name in more places for better association of icon to trace Fixes: 284100487 Test: npm run test:all Change-Id: I2cfb1ba7214ec0b316b489ef84a138861d878345
This commit is contained in:
@@ -32,6 +32,7 @@ import {FileUtils} from 'common/file_utils';
|
|||||||
import {PersistentStore} from 'common/persistent_store';
|
import {PersistentStore} from 'common/persistent_store';
|
||||||
import {CrossToolProtocol} from 'cross_tool/cross_tool_protocol';
|
import {CrossToolProtocol} from 'cross_tool/cross_tool_protocol';
|
||||||
import {TraceDataListener} from 'interfaces/trace_data_listener';
|
import {TraceDataListener} from 'interfaces/trace_data_listener';
|
||||||
|
import {LoadedTrace} from 'trace/loaded_trace';
|
||||||
import {Timestamp} from 'trace/timestamp';
|
import {Timestamp} from 'trace/timestamp';
|
||||||
import {TraceType} from 'trace/trace_type';
|
import {TraceType} from 'trace/trace_type';
|
||||||
import {proxyClient, ProxyState} from 'trace_collection/proxy_client';
|
import {proxyClient, ProxyState} from 'trace_collection/proxy_client';
|
||||||
@@ -59,6 +60,13 @@ import {UploadTracesComponent} from './upload_traces_component';
|
|||||||
</a>
|
</a>
|
||||||
|
|
||||||
<div class="spacer">
|
<div class="spacer">
|
||||||
|
<mat-icon
|
||||||
|
*ngIf="activeTrace"
|
||||||
|
class="icon"
|
||||||
|
[matTooltip]="TRACE_INFO[activeTrace.type].name"
|
||||||
|
[style]="{color: TRACE_INFO[activeTrace.type].color, marginRight: '0.5rem'}">
|
||||||
|
{{ TRACE_INFO[activeTrace.type].icon }}
|
||||||
|
</mat-icon>
|
||||||
<span *ngIf="dataLoaded" class="active-trace-file-info mat-body-2">
|
<span *ngIf="dataLoaded" class="active-trace-file-info mat-body-2">
|
||||||
{{ activeTraceFileInfo }}
|
{{ activeTraceFileInfo }}
|
||||||
</span>
|
</span>
|
||||||
@@ -157,6 +165,9 @@ import {UploadTracesComponent} from './upload_traces_component';
|
|||||||
.spacer {
|
.spacer {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
}
|
}
|
||||||
.viewers {
|
.viewers {
|
||||||
height: 0;
|
height: 0;
|
||||||
@@ -202,11 +213,13 @@ export class AppComponent implements TraceDataListener {
|
|||||||
isDarkModeOn!: boolean;
|
isDarkModeOn!: boolean;
|
||||||
dataLoaded = false;
|
dataLoaded = false;
|
||||||
activeView?: View;
|
activeView?: View;
|
||||||
|
activeTrace?: LoadedTrace;
|
||||||
activeTraceFileInfo = '';
|
activeTraceFileInfo = '';
|
||||||
collapsedTimelineHeight = 0;
|
collapsedTimelineHeight = 0;
|
||||||
@ViewChild(UploadTracesComponent) uploadTracesComponent?: UploadTracesComponent;
|
@ViewChild(UploadTracesComponent) uploadTracesComponent?: UploadTracesComponent;
|
||||||
@ViewChild(CollectTracesComponent) collectTracesComponent?: UploadTracesComponent;
|
@ViewChild(CollectTracesComponent) collectTracesComponent?: UploadTracesComponent;
|
||||||
@ViewChild(TimelineComponent) timelineComponent?: TimelineComponent;
|
@ViewChild(TimelineComponent) timelineComponent?: TimelineComponent;
|
||||||
|
TRACE_INFO = TRACE_INFO;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
@Inject(Injector) injector: Injector,
|
@Inject(Injector) injector: Injector,
|
||||||
@@ -327,6 +340,7 @@ export class AppComponent implements TraceDataListener {
|
|||||||
|
|
||||||
onActiveViewChanged(view: View) {
|
onActiveViewChanged(view: View) {
|
||||||
this.activeView = view;
|
this.activeView = view;
|
||||||
|
this.activeTrace = this.getActiveTrace(view);
|
||||||
this.activeTraceFileInfo = this.makeActiveTraceFileInfo(view);
|
this.activeTraceFileInfo = this.makeActiveTraceFileInfo(view);
|
||||||
this.timelineData.setActiveViewTraceTypes(view.dependencies);
|
this.timelineData.setActiveViewTraceTypes(view.dependencies);
|
||||||
}
|
}
|
||||||
@@ -336,15 +350,19 @@ export class AppComponent implements TraceDataListener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private makeActiveTraceFileInfo(view: View): string {
|
private makeActiveTraceFileInfo(view: View): string {
|
||||||
const traceFile = this.tracePipeline
|
const trace = this.getActiveTrace(view);
|
||||||
.getLoadedTraces()
|
|
||||||
.find((file) => file.type === view.dependencies[0]);
|
|
||||||
|
|
||||||
if (!traceFile) {
|
if (!trace) {
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
return `${traceFile.type} (${traceFile.descriptors.join(', ')})`;
|
return `${TRACE_INFO[trace.type].name} (${trace.descriptors.join(', ')})`;
|
||||||
|
}
|
||||||
|
|
||||||
|
private getActiveTrace(view: View): LoadedTrace | undefined {
|
||||||
|
return this.tracePipeline
|
||||||
|
.getLoadedTraces()
|
||||||
|
.find((trace) => trace.type === view.dependencies[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
private async makeTraceFilesForDownload(): Promise<File[]> {
|
private async makeTraceFilesForDownload(): Promise<File[]> {
|
||||||
|
|||||||
@@ -40,7 +40,10 @@ import {SingleTimelineComponent} from './single_timeline_component';
|
|||||||
*ngFor="let trace of getTraces(); trackBy: trackTraceBySelectedTimestamp"
|
*ngFor="let trace of getTraces(); trackBy: trackTraceBySelectedTimestamp"
|
||||||
class="timeline">
|
class="timeline">
|
||||||
<div class="icon-wrapper">
|
<div class="icon-wrapper">
|
||||||
<mat-icon class="icon" [style]="{color: TRACE_INFO[trace.type].color}">
|
<mat-icon
|
||||||
|
class="icon"
|
||||||
|
[matTooltip]="TRACE_INFO[trace.type].name"
|
||||||
|
[style]="{color: TRACE_INFO[trace.type].color}">
|
||||||
{{ TRACE_INFO[trace.type].icon }}
|
{{ TRACE_INFO[trace.type].icon }}
|
||||||
</mat-icon>
|
</mat-icon>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -15,6 +15,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import {Component, ElementRef, EventEmitter, Inject, Input, Output} from '@angular/core';
|
import {Component, ElementRef, EventEmitter, Inject, Input, Output} from '@angular/core';
|
||||||
|
import {TRACE_INFO} from 'app/trace_info';
|
||||||
import {PersistentStore} from 'common/persistent_store';
|
import {PersistentStore} from 'common/persistent_store';
|
||||||
import {View, Viewer, ViewType} from 'viewers/viewer';
|
import {View, Viewer, ViewType} from 'viewers/viewer';
|
||||||
|
|
||||||
@@ -44,6 +45,12 @@ interface Tab extends View {
|
|||||||
[active]="isCurrentActiveTab(tab)"
|
[active]="isCurrentActiveTab(tab)"
|
||||||
(click)="onTabClick(tab)"
|
(click)="onTabClick(tab)"
|
||||||
class="tab">
|
class="tab">
|
||||||
|
<mat-icon
|
||||||
|
class="icon"
|
||||||
|
[matTooltip]="TRACE_INFO[tab.traceType].name"
|
||||||
|
[style]="{color: TRACE_INFO[tab.traceType].color, marginRight: '0.5rem'}">
|
||||||
|
{{ TRACE_INFO[tab.traceType].icon }}
|
||||||
|
</mat-icon>
|
||||||
{{ tab.title }}
|
{{ tab.title }}
|
||||||
</a>
|
</a>
|
||||||
</nav>
|
</nav>
|
||||||
@@ -99,6 +106,8 @@ export class TraceViewComponent {
|
|||||||
@Output() downloadTracesButtonClick = new EventEmitter<void>();
|
@Output() downloadTracesButtonClick = new EventEmitter<void>();
|
||||||
@Output() activeViewChanged = new EventEmitter<View>();
|
@Output() activeViewChanged = new EventEmitter<View>();
|
||||||
|
|
||||||
|
TRACE_INFO = TRACE_INFO;
|
||||||
|
|
||||||
private elementRef: ElementRef;
|
private elementRef: ElementRef;
|
||||||
|
|
||||||
tabs: Tab[] = [];
|
tabs: Tab[] = [];
|
||||||
@@ -129,6 +138,7 @@ export class TraceViewComponent {
|
|||||||
title: view.title,
|
title: view.title,
|
||||||
addedToDom: false,
|
addedToDom: false,
|
||||||
dependencies: view.dependencies,
|
dependencies: view.dependencies,
|
||||||
|
traceType: view.traceType
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -27,7 +27,8 @@ class View {
|
|||||||
public type: ViewType,
|
public type: ViewType,
|
||||||
public dependencies: TraceType[],
|
public dependencies: TraceType[],
|
||||||
public htmlElement: HTMLElement,
|
public htmlElement: HTMLElement,
|
||||||
public title: string
|
public title: string,
|
||||||
|
public traceType: TraceType
|
||||||
) {}
|
) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -23,7 +23,13 @@ import {PresenterInputMethodClients} from './presenter_input_method_clients';
|
|||||||
class ViewerInputMethodClients extends ViewerInputMethod {
|
class ViewerInputMethodClients extends ViewerInputMethod {
|
||||||
override getViews(): View[] {
|
override getViews(): View[] {
|
||||||
return [
|
return [
|
||||||
new View(ViewType.TAB, this.getDependencies(), this.htmlElement, 'Input Method Clients'),
|
new View(
|
||||||
|
ViewType.TAB,
|
||||||
|
this.getDependencies(),
|
||||||
|
this.htmlElement,
|
||||||
|
'Input Method Clients',
|
||||||
|
TraceType.INPUT_METHOD_CLIENTS
|
||||||
|
),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -27,7 +27,8 @@ class ViewerInputMethodManagerService extends ViewerInputMethod {
|
|||||||
ViewType.TAB,
|
ViewType.TAB,
|
||||||
this.getDependencies(),
|
this.getDependencies(),
|
||||||
this.htmlElement,
|
this.htmlElement,
|
||||||
'Input Method Manager Service'
|
'Input Method Manager Service',
|
||||||
|
TraceType.INPUT_METHOD_MANAGER_SERVICE
|
||||||
),
|
),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,7 +23,13 @@ import {PresenterInputMethodService} from './presenter_input_method_service';
|
|||||||
class ViewerInputMethodService extends ViewerInputMethod {
|
class ViewerInputMethodService extends ViewerInputMethod {
|
||||||
override getViews(): View[] {
|
override getViews(): View[] {
|
||||||
return [
|
return [
|
||||||
new View(ViewType.TAB, this.getDependencies(), this.htmlElement, 'Input Method Service'),
|
new View(
|
||||||
|
ViewType.TAB,
|
||||||
|
this.getDependencies(),
|
||||||
|
this.htmlElement,
|
||||||
|
'Input Method Service',
|
||||||
|
TraceType.INPUT_METHOD_SERVICE
|
||||||
|
),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -49,7 +49,15 @@ class ViewerProtoLog implements Viewer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
getViews(): View[] {
|
getViews(): View[] {
|
||||||
return [new View(ViewType.TAB, this.getDependencies(), this.htmlElement, 'ProtoLog')];
|
return [
|
||||||
|
new View(
|
||||||
|
ViewType.TAB,
|
||||||
|
this.getDependencies(),
|
||||||
|
this.htmlElement,
|
||||||
|
'ProtoLog',
|
||||||
|
TraceType.PROTO_LOG
|
||||||
|
),
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
getDependencies(): TraceType[] {
|
getDependencies(): TraceType[] {
|
||||||
|
|||||||
@@ -42,7 +42,13 @@ class ViewerScreenRecording implements Viewer {
|
|||||||
|
|
||||||
getViews(): View[] {
|
getViews(): View[] {
|
||||||
return [
|
return [
|
||||||
new View(ViewType.OVERLAY, this.getDependencies(), this.htmlElement, 'ScreenRecording'),
|
new View(
|
||||||
|
ViewType.OVERLAY,
|
||||||
|
this.getDependencies(),
|
||||||
|
this.htmlElement,
|
||||||
|
'ScreenRecording',
|
||||||
|
TraceType.SCREEN_RECORDING
|
||||||
|
),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -34,7 +34,15 @@ class ViewerStub implements Viewer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
getViews(): View[] {
|
getViews(): View[] {
|
||||||
return [new View(ViewType.TAB, this.getDependencies(), this.htmlElement, this.title)];
|
return [
|
||||||
|
new View(
|
||||||
|
ViewType.TAB,
|
||||||
|
this.getDependencies(),
|
||||||
|
this.htmlElement,
|
||||||
|
this.title,
|
||||||
|
this.getDependencies()[0]
|
||||||
|
),
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
getDependencies(): any {
|
getDependencies(): any {
|
||||||
|
|||||||
@@ -62,7 +62,15 @@ class ViewerSurfaceFlinger implements Viewer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
getViews(): View[] {
|
getViews(): View[] {
|
||||||
return [new View(ViewType.TAB, this.getDependencies(), this.htmlElement, 'Surface Flinger')];
|
return [
|
||||||
|
new View(
|
||||||
|
ViewType.TAB,
|
||||||
|
this.getDependencies(),
|
||||||
|
this.htmlElement,
|
||||||
|
'Surface Flinger',
|
||||||
|
TraceType.SURFACE_FLINGER
|
||||||
|
),
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
getDependencies(): TraceType[] {
|
getDependencies(): TraceType[] {
|
||||||
|
|||||||
@@ -64,7 +64,15 @@ class ViewerTransactions implements Viewer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
getViews(): View[] {
|
getViews(): View[] {
|
||||||
return [new View(ViewType.TAB, this.getDependencies(), this.htmlElement, 'Transactions')];
|
return [
|
||||||
|
new View(
|
||||||
|
ViewType.TAB,
|
||||||
|
this.getDependencies(),
|
||||||
|
this.htmlElement,
|
||||||
|
'Transactions',
|
||||||
|
TraceType.TRANSACTIONS
|
||||||
|
),
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
getDependencies(): TraceType[] {
|
getDependencies(): TraceType[] {
|
||||||
|
|||||||
@@ -39,7 +39,15 @@ export class ViewerTransitions implements Viewer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
getViews(): View[] {
|
getViews(): View[] {
|
||||||
return [new View(ViewType.TAB, this.getDependencies(), this.htmlElement, 'Transitions')];
|
return [
|
||||||
|
new View(
|
||||||
|
ViewType.TAB,
|
||||||
|
this.getDependencies(),
|
||||||
|
this.htmlElement,
|
||||||
|
'Transitions',
|
||||||
|
TraceType.TRANSITION
|
||||||
|
),
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
getDependencies(): TraceType[] {
|
getDependencies(): TraceType[] {
|
||||||
|
|||||||
@@ -56,7 +56,15 @@ class ViewerWindowManager implements Viewer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
getViews(): View[] {
|
getViews(): View[] {
|
||||||
return [new View(ViewType.TAB, this.getDependencies(), this.htmlElement, 'Window Manager')];
|
return [
|
||||||
|
new View(
|
||||||
|
ViewType.TAB,
|
||||||
|
this.getDependencies(),
|
||||||
|
this.htmlElement,
|
||||||
|
'Window Manager',
|
||||||
|
TraceType.WINDOW_MANAGER
|
||||||
|
),
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
getDependencies(): TraceType[] {
|
getDependencies(): TraceType[] {
|
||||||
|
|||||||
Reference in New Issue
Block a user