Skip to content

Commit f413fc2

Browse files
jackfranklinDevtools-frontend LUCI CQ
authored andcommitted
RPP: hide minimap when the trace is not visible
This fixes a drastic over-reporting in VE logs for the breadcrumbs button, which was visible by default on all views. [email protected] Bug: None Change-Id: Id9f9b6f73696108946c1e7af59ee92e66361a40d Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/6696646 Commit-Queue: Jack Franklin <[email protected]> Reviewed-by: Alina Varkki <[email protected]> Auto-Submit: Jack Franklin <[email protected]> Commit-Queue: Alina Varkki <[email protected]>
1 parent bf73092 commit f413fc2

File tree

3 files changed

+17
-2
lines changed

3 files changed

+17
-2
lines changed

front_end/panels/timeline/TimelineMiniMap.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ export class TimelineMiniMap extends
5353
constructor() {
5454
super();
5555
this.registerRequiredCSS(miniMapStyles);
56-
this.element.classList.add('timeline-minimap');
56+
this.element.classList.add('timeline-minimap', 'no-trace-active');
5757
this.#breadcrumbsUI = new TimelineComponents.BreadcrumbsUI.BreadcrumbsUI();
5858
this.element.prepend(this.#breadcrumbsUI);
5959

@@ -269,7 +269,15 @@ export class TimelineMiniMap extends
269269
return this.#controls;
270270
}
271271

272-
setData(data: OverviewData): void {
272+
setData(data: OverviewData|null): void {
273+
this.element.classList.toggle('no-trace-active', data === null);
274+
275+
if (data === null) {
276+
this.#data = null;
277+
this.#controls = [];
278+
return;
279+
}
280+
273281
if (this.#data?.parsedTrace === data.parsedTrace) {
274282
return;
275283
}

front_end/panels/timeline/TimelinePanel.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -867,6 +867,7 @@ export class TimelinePanel extends Common.ObjectWrapper.eventMixin<EventTypes, t
867867
case 'LANDING_PAGE': {
868868
this.#removeStatusPane();
869869
this.#showLandingPage();
870+
this.updateMiniMap();
870871
this.dispatchEventToListeners(Events.IS_VIEWING_TRACE, false);
871872

872873
// Whilst we don't reset this, we hide it, mainly so the user cannot
@@ -1567,6 +1568,7 @@ export class TimelinePanel extends Common.ObjectWrapper.eventMixin<EventTypes, t
15671568

15681569
private updateMiniMap(): void {
15691570
if (this.#viewMode.mode !== 'VIEWING_TRACE') {
1571+
this.#minimapComponent.setData(null);
15701572
return;
15711573
}
15721574

front_end/panels/timeline/timelineMiniMap.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,13 @@
66

77
.timeline-minimap {
88
position: relative;
9+
10+
&.no-trace-active {
11+
display: none;
12+
}
913
}
1014

15+
1116
.timeline-minimap .overview-strip {
1217
margin-top: 2px;
1318
justify-content: center;

0 commit comments

Comments
 (0)