Skip to content

Commit 30e49f3

Browse files
jackfranklinDevtools-frontend LUCI CQ
authored andcommitted
RPP: update status bar to not look broken on init
Before: screen/BYoCMYPp5HVDGHX This always looked broken to me with the progress bar below "Time" and no label next to it. After: screen/87ozrUQScaYB7no Adding the buffer usage text makes it look much nicer. R=andoli@chromium.org Bug: none Change-Id: Ibbf232b6b9e0400824c708c5ee0118490d297d52 Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/6523481 Commit-Queue: Andres Olivares <andoli@chromium.org> Commit-Queue: Jack Franklin <jacktfranklin@chromium.org> Auto-Submit: Jack Franklin <jacktfranklin@chromium.org> Reviewed-by: Andres Olivares <andoli@chromium.org>
1 parent 088802e commit 30e49f3

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

front_end/panels/timeline/TimelinePanel.ts

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2585,6 +2585,7 @@ export class TimelinePanel extends UI.Panel.Panel implements Client, TimelineMod
25852585
() => this.stopRecording());
25862586
this.statusPane.showPane(this.statusPaneContainer);
25872587
this.statusPane.updateStatus(i18nString(UIStrings.initializingProfiler));
2588+
this.statusPane.updateProgressBar(i18nString(UIStrings.bufferUsage), 0);
25882589
}
25892590

25902591
private cancelLoading(): void {
@@ -2816,8 +2817,8 @@ export interface TimelineModeViewDelegate {
28162817
export class StatusPane extends UI.Widget.VBox {
28172818
private status: HTMLElement;
28182819
private time: Element|undefined;
2819-
private progressLabel!: Element;
2820-
private progressBar!: Element;
2820+
private progressLabel?: HTMLElement;
2821+
private progressBar?: HTMLElement;
28212822
private readonly description: HTMLElement|undefined;
28222823
private button: Buttons.Button.Button;
28232824
private downloadTraceButton: Buttons.Button.Button;
@@ -2851,9 +2852,9 @@ export class StatusPane extends UI.Widget.VBox {
28512852
}
28522853

28532854
if (options.showProgress) {
2854-
const progressLine = this.contentElement.createChild('div', 'status-dialog-line progress');
2855-
this.progressLabel = progressLine.createChild('div', 'label');
2856-
this.progressBar = progressLine.createChild('div', 'indicator-container').createChild('div', 'indicator');
2855+
const progressBarContainer = this.contentElement.createChild('div', 'status-dialog-line progress');
2856+
this.progressLabel = progressBarContainer.createChild('div', 'label');
2857+
this.progressBar = progressBarContainer.createChild('div', 'indicator-container').createChild('div', 'indicator');
28572858
UI.ARIAUtils.markAsProgressBar(this.progressBar);
28582859
}
28592860

@@ -2928,9 +2929,13 @@ export class StatusPane extends UI.Widget.VBox {
29282929
}
29292930

29302931
updateProgressBar(activity: string, percent: number): void {
2931-
this.progressLabel.textContent = activity;
2932-
(this.progressBar as HTMLElement).style.width = percent.toFixed(1) + '%';
2933-
UI.ARIAUtils.setValueNow(this.progressBar, percent);
2932+
if (this.progressLabel) {
2933+
this.progressLabel.textContent = activity;
2934+
}
2935+
if (this.progressBar) {
2936+
this.progressBar.style.width = percent.toFixed(1) + '%';
2937+
UI.ARIAUtils.setValueNow(this.progressBar, percent);
2938+
}
29342939
this.updateTimer();
29352940
}
29362941

0 commit comments

Comments
 (0)