fix(ui): show stack frames in ui mode
This commit is contained in:
parent
1d4bdc6898
commit
01fa035b95
|
|
@ -27,10 +27,9 @@ import type { StackFrame } from '@protocol/channels';
|
|||
export const SourceTab: React.FunctionComponent<{
|
||||
stack: StackFrame[] | undefined,
|
||||
sources: Map<string, SourceModel>,
|
||||
hideStackFrames?: boolean,
|
||||
rootDir?: string,
|
||||
fallbackLocation?: SourceLocation,
|
||||
}> = ({ stack, sources, hideStackFrames, rootDir, fallbackLocation }) => {
|
||||
}> = ({ stack, sources, rootDir, fallbackLocation }) => {
|
||||
const [lastStack, setLastStack] = React.useState<StackFrame[] | undefined>();
|
||||
const [selectedFrame, setSelectedFrame] = React.useState<number>(0);
|
||||
|
||||
|
|
@ -78,7 +77,7 @@ export const SourceTab: React.FunctionComponent<{
|
|||
return { source, highlight, targetLine, fileName };
|
||||
}, [stack, selectedFrame, rootDir, fallbackLocation], { source: { errors: [], content: 'Loading\u2026' }, highlight: [] });
|
||||
|
||||
return <SplitView sidebarSize={200} orientation='horizontal' sidebarHidden={hideStackFrames}>
|
||||
return <SplitView sidebarSize={200} orientation='horizontal'>
|
||||
<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} />
|
||||
|
|
|
|||
|
|
@ -589,7 +589,6 @@ const TraceView: React.FC<{
|
|||
return <Workbench
|
||||
key='workbench'
|
||||
model={model?.model}
|
||||
hideStackFrames={true}
|
||||
showSourcesFirst={true}
|
||||
rootDir={rootDir}
|
||||
initialSelection={initialSelection}
|
||||
|
|
|
|||
|
|
@ -43,7 +43,6 @@ import type { UITestStatus } from './testUtils';
|
|||
|
||||
export const Workbench: React.FunctionComponent<{
|
||||
model?: MultiTraceModel,
|
||||
hideStackFrames?: boolean,
|
||||
showSourcesFirst?: boolean,
|
||||
rootDir?: string,
|
||||
fallbackLocation?: modelUtil.SourceLocation,
|
||||
|
|
@ -51,7 +50,7 @@ export const Workbench: React.FunctionComponent<{
|
|||
onSelectionChanged?: (action: ActionTraceEventInContext) => void,
|
||||
isLive?: boolean,
|
||||
status?: UITestStatus,
|
||||
}> = ({ model, hideStackFrames, showSourcesFirst, rootDir, fallbackLocation, initialSelection, onSelectionChanged, isLive, status }) => {
|
||||
}> = ({ model, showSourcesFirst, rootDir, fallbackLocation, initialSelection, onSelectionChanged, isLive, status }) => {
|
||||
const [selectedAction, setSelectedActionImpl] = React.useState<ActionTraceEventInContext | undefined>(undefined);
|
||||
const [revealedStack, setRevealedStack] = React.useState<StackFrame[] | undefined>(undefined);
|
||||
const [highlightedAction, setHighlightedAction] = React.useState<ActionTraceEventInContext | undefined>();
|
||||
|
|
@ -158,7 +157,6 @@ export const Workbench: React.FunctionComponent<{
|
|||
render: () => <SourceTab
|
||||
stack={revealedStack}
|
||||
sources={sources}
|
||||
hideStackFrames={hideStackFrames}
|
||||
rootDir={rootDir}
|
||||
fallbackLocation={fallbackLocation} />
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in a new issue