feat(trace-viewer) apply updates as per code review
https://github.com/microsoft/playwright/pull/31394
This commit is contained in:
parent
22b008c433
commit
e0e4ca6d15
|
|
@ -32,7 +32,7 @@
|
|||
z-index: 10;
|
||||
}
|
||||
|
||||
.copy-icon.codicon {
|
||||
.source-tab-file-name .copy-icon.codicon {
|
||||
display: block;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -81,14 +81,6 @@ export const SourceTab: React.FunctionComponent<{
|
|||
|
||||
const showStackFrames = (stack?.length ?? 0) > 1;
|
||||
|
||||
const getFileName = (fullPath?: string, lineNum?: number) => {
|
||||
if (!fullPath)
|
||||
return '';
|
||||
const pathSep = fullPath?.includes('/') ? '/' : '\\';
|
||||
const fileName = fullPath?.split(pathSep).pop() ?? '';
|
||||
return lineNum ? `${fileName}:${lineNum}` : fileName;
|
||||
};
|
||||
|
||||
return <SplitView sidebarSize={200} orientation={stackFrameLocation === 'bottom' ? 'vertical' : 'horizontal'} sidebarHidden={!showStackFrames}>
|
||||
<div className='vbox' data-testid='source-code'>
|
||||
{fileName && (
|
||||
|
|
@ -116,3 +108,11 @@ export async function calculateSha1(text: string): Promise<string> {
|
|||
}
|
||||
return hexCodes.join('');
|
||||
}
|
||||
|
||||
function getFileName(fullPath?: string, lineNum?: number): string {
|
||||
if (!fullPath)
|
||||
return '';
|
||||
const pathSep = fullPath?.includes('/') ? '/' : '\\';
|
||||
const fileName = fullPath?.split(pathSep).pop() ?? '';
|
||||
return lineNum ? `${fileName}:${lineNum}` : fileName;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue