fix(trace-viewer): show warning when opening an empty trace (#9449)

This commit is contained in:
Max Schmitt 2021-10-12 20:11:57 +02:00 committed by GitHub
parent 82ff85b106
commit 34e933f474
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 23 additions and 1 deletions

View File

@ -122,3 +122,15 @@
.action-entry .codicon-warning {
color: darkorange;
}
.no-actions-entry {
height: 400px;
display: grid;
place-items: center;
text-align: center;
}
.no-actions-entry-text {
font-weight: bold;
font-size: 1.3rem;
}

View File

@ -45,7 +45,7 @@ export const ActionList: React.FC<ActionListProps> = ({
}, [selectedAction, actionListRef]);
return <div className='action-list vbox'>
<div className='.action-list-title tab-strip'>
<div className='action-list-title tab-strip'>
<div className='tab-element'>
<div className='tab-label'>Actions</div>
</div>
@ -72,6 +72,16 @@ export const ActionList: React.FC<ActionListProps> = ({
}}
ref={actionListRef}
>
{actions.length === 0 && <div className='no-actions-entry'>
<div>
<div className='no-actions-entry-text'>
No actions recorded
</div>
<div>
Make sure that the right context was used when recording the trace.
</div>
</div>
</div>}
{actions.map(action => {
const { metadata } = action;
const selectedSuffix = action === selectedAction ? ' selected' : '';