mirror of
https://github.com/microsoft/playwright.git
synced 2024-12-12 11:50:22 +03:00
chore(trace): render drawer as a sidebar in the tv mode (#23451)
Fixes: https://github.com/microsoft/playwright/issues/23227
This commit is contained in:
parent
0a6fe3fac5
commit
b99c214b29
@ -75,7 +75,7 @@ export const SourceTab: React.FunctionComponent<{
|
||||
return { source, highlight, targetLine, fileName };
|
||||
}, [action, selectedFrame, rootDir, fallbackLocation], { source: { errors: [], content: 'Loading\u2026' }, highlight: [] });
|
||||
|
||||
return <SplitView sidebarSize={200} orientation='horizontal' sidebarHidden={hideStackFrames}>
|
||||
return <SplitView sidebarSize={200} orientation='vertical' sidebarHidden={hideStackFrames}>
|
||||
<div className='vbox' data-testid='source-code'>
|
||||
{fileName && <div className='source-tab-file-name'>{fileName}</div>}
|
||||
<CodeMirrorWrapper text={source.content || ''} language='javascript' highlight={highlight} revealLine={targetLine} readOnly={true} lineNumbers={true} />
|
||||
|
@ -557,7 +557,8 @@ const TraceView: React.FC<{
|
||||
initialSelection={initialSelection}
|
||||
onSelectionChanged={onSelectionChanged}
|
||||
fallbackLocation={item.testFile}
|
||||
isLive={model?.isLive} />;
|
||||
isLive={model?.isLive}
|
||||
drawer='bottom' />;
|
||||
};
|
||||
|
||||
declare global {
|
||||
|
@ -41,7 +41,8 @@ export const Workbench: React.FunctionComponent<{
|
||||
initialSelection?: ActionTraceEventInContext,
|
||||
onSelectionChanged?: (action: ActionTraceEventInContext) => void,
|
||||
isLive?: boolean,
|
||||
}> = ({ model, hideTimelineBars, hideStackFrames, showSourcesFirst, rootDir, fallbackLocation, initialSelection, onSelectionChanged, isLive }) => {
|
||||
drawer?: 'bottom' | 'right',
|
||||
}> = ({ model, hideTimelineBars, hideStackFrames, showSourcesFirst, rootDir, fallbackLocation, initialSelection, onSelectionChanged, isLive, drawer }) => {
|
||||
const [selectedAction, setSelectedAction] = React.useState<ActionTraceEventInContext | undefined>(undefined);
|
||||
const [highlightedAction, setHighlightedAction] = React.useState<ActionTraceEventInContext | undefined>();
|
||||
const [selectedNavigatorTab, setSelectedNavigatorTab] = React.useState<string>('actions');
|
||||
@ -126,7 +127,7 @@ export const Workbench: React.FunctionComponent<{
|
||||
onSelected={onActionSelected}
|
||||
hideTimelineBars={hideTimelineBars}
|
||||
/>
|
||||
<SplitView sidebarSize={250} orientation='vertical'>
|
||||
<SplitView sidebarSize={250} orientation={drawer === 'bottom' ? 'vertical' : 'horizontal'}>
|
||||
<SplitView sidebarSize={250} orientation='horizontal' sidebarIsFirst={true}>
|
||||
<SnapshotTab action={activeAction} sdkLanguage={sdkLanguage} testIdAttributeName={model?.testIdAttributeName || 'data-testid'} />
|
||||
<TabbedPane tabs={
|
||||
|
Loading…
Reference in New Issue
Block a user