-
Notifications
You must be signed in to change notification settings - Fork 26.4k
refactor(devtools): improve profiler recorder controls #62010
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
Reorganize the template and reduce the vertical space taken by the controls.
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,65 +1,66 @@ | ||
<div class="profiler-wrapper"> | ||
<mat-card> | ||
@if (state() === 'idle') { | ||
<div class="recorder-controls"> | ||
@switch (state()) { | ||
@case ('idle') { | ||
<button | ||
mat-icon-button | ||
color="primary" | ||
ng-button | ||
btnType="icon" | ||
(click)="startRecording()" | ||
class="profiler-control start-recording-button" | ||
matTooltip="Start recording" | ||
aria-label="Start recording" | ||
> | ||
<mat-icon> circle </mat-icon> | ||
</button> | ||
} @else if (state() === 'recording') { | ||
|
||
<p class="instructions"> | ||
<span> | ||
Click the record button to start a new recording, or upload a JSON file containing | ||
profiler data. | ||
</span> | ||
<br /> | ||
<input | ||
type="file" | ||
(change)="importProfilerResults($event)" | ||
placeholder="Upload file" | ||
accept=".json" | ||
/> | ||
</p> | ||
} | ||
@case ('recording') { | ||
<button | ||
mat-icon-button | ||
ng-button | ||
btnType="icon" | ||
(click)="stopRecording()" | ||
class="profiler-control recording-button" | ||
class="recording-button" | ||
matTooltip="Stop recording" | ||
aria-label="Stop recording" | ||
> | ||
<mat-icon> circle </mat-icon> | ||
</button> | ||
} @else if (state() === 'visualizing') { | ||
|
||
<p class="instructions"> | ||
Interact to preview change detection. Clicking stop ends this Profiler recording. | ||
</p> | ||
} | ||
@case ('visualizing') { | ||
<button | ||
mat-icon-button | ||
color="primary" | ||
ng-button | ||
btnType="icon" | ||
(click)="discardRecording()" | ||
class="profiler-control discard-button" | ||
matTooltip="Clear recording" | ||
aria-label="Clear recording" | ||
> | ||
<mat-icon> not_interested </mat-icon> | ||
</button> | ||
|
||
<p class="instructions"> | ||
Click Save Profile to save your recording or click refresh to clear the current recording. | ||
</p> | ||
} | ||
<p class="instructions" [class.hidden]="state() !== 'idle'"> | ||
<span> | ||
Click the record button to start a new recording, or upload a JSON file containing profiler | ||
data. | ||
</span> | ||
<br /> | ||
<span> | ||
<input | ||
type="file" | ||
(change)="importProfilerResults($event)" | ||
placeholder="Upload file" | ||
accept=".json" | ||
/> | ||
</span> | ||
</p> | ||
<p class="instructions" [class.hidden]="state() !== 'recording'"> | ||
Interact to preview change detection. Clicking stop ends this Profiler recording. | ||
</p> | ||
<p class="instructions" [class.hidden]="state() !== 'visualizing'"> | ||
Click Save Profile to save your recording or click refresh to clear the current recording. | ||
</p> | ||
</mat-card> | ||
<div id="profiler-content-wrapper"> | ||
@if (state() !== 'idle') { | ||
<div class="visualization"> | ||
<ng-recording-timeline [stream]="stream" (exportProfile)="exportProfilerResults()" /> | ||
</div> | ||
} | ||
</div> | ||
} | ||
</div> | ||
|
||
@if (state() !== 'idle') { | ||
<div class="recording"> | ||
<ng-recording-timeline [stream]="stream" (exportProfile)="exportProfilerResults()" /> | ||
</div> | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,55 +1,47 @@ | ||
@use '../../../styles/typography'; | ||
|
||
:host, | ||
.profiler-wrapper { | ||
width: 100%; | ||
height: calc(100% - 30px); | ||
|
||
p { | ||
margin: 0; | ||
} | ||
} | ||
|
||
.mat-icon { | ||
font-size: 18px; | ||
top: 4px; | ||
position: relative; | ||
} | ||
|
||
.profiler-control { | ||
cursor: pointer; | ||
|
||
&.recording-button { | ||
color: var(--dynamic-red-01); | ||
} | ||
} | ||
|
||
.instructions { | ||
@extend %body-01; | ||
:host { | ||
display: flex; | ||
flex-direction: column; | ||
height: 100%; | ||
|
||
&.hidden { | ||
display: none; | ||
.recorder-controls { | ||
display: flex; | ||
align-items: flex-start; | ||
gap: 0.25rem; | ||
border-bottom: 1px solid var(--color-separator); | ||
|
||
button { | ||
$icon-size: 18px; | ||
margin: 0.625rem; | ||
color: var(--secondary-contrast); | ||
height: $icon-size; | ||
|
||
&.recording-button { | ||
color: var(--dynamic-red-01); | ||
} | ||
|
||
mat-icon { | ||
width: $icon-size; | ||
height: $icon-size; | ||
font-size: $icon-size; | ||
} | ||
} | ||
|
||
.instructions { | ||
@extend %body-01; | ||
padding-block: 0.7rem; | ||
margin: 0; | ||
|
||
input { | ||
margin-top: 0.5rem; | ||
cursor: pointer; | ||
} | ||
} | ||
} | ||
|
||
input, | ||
span { | ||
margin-top: 5px; | ||
cursor: pointer; | ||
.recording { | ||
flex: 1; | ||
overflow: hidden; | ||
} | ||
} | ||
|
||
#profiler-content-wrapper { | ||
margin: 0; | ||
height: calc(100% - 30px); | ||
width: 100%; | ||
} | ||
|
||
.visualization { | ||
margin: 0; | ||
height: 100%; | ||
} | ||
|
||
.mdc-card { | ||
flex-direction: row; | ||
align-items: center; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -148,3 +148,7 @@ mat-form-field { | |
); | ||
} | ||
} | ||
|
||
[hidden] { | ||
display: none !important; | ||
Comment on lines
+152
to
+153
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we need to add this global style in this PR ? I doesn't look like the PR is introducing its usage. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah. Since tabs rely now on |
||
} |
Uh oh!
There was an error while loading. Please reload this page.