Update recorderView to disable canvas screenshots

This commit is contained in:
Adam Gastineau 2024-12-13 08:12:58 -08:00
parent e198f8d310
commit a581a6b133
4 changed files with 7 additions and 8 deletions

View file

@ -463,7 +463,7 @@ function snapshotScript(...targetIds: (string | undefined)[]) {
if (partiallyUncaptured)
canvas.title = `Playwright couldn't capture full canvas contents because it's located partially outside the viewport.`;
else
canvas.title = `Canvas contents are displayed on a best-effort basis based on viewport screenshots taken during test execution.`;
canvas.title = `Canvas contents are displayed on a best-effort basis based on viewport screenshots taken during test execution.`;
} else {
canvas.title = 'Canvas content display is disabled.';
}

View file

@ -280,7 +280,8 @@ const TraceView: React.FunctionComponent<{
return snapshot.action || snapshot.after || snapshot.before;
}, [action]);
const snapshotUrls = React.useMemo(() => {
return snapshot ? extendSnapshot(snapshot) : undefined;
// TODO: Use actual setting. Requires settings UI to be wired up
return snapshot ? extendSnapshot(snapshot, false) : undefined;
}, [snapshot]);
return <SnapshotView

View file

@ -20,7 +20,7 @@ import { ToolbarButton } from '@web/components/toolbarButton';
import { DefaultSettingsView } from './defaultSettingsView';
import './settingsToolbar.css';
export const SettingsToolbar: React.FC<{}> = () => {
export const SettingsToolbarButton: React.FC<{}> = () => {
const hostingRef = React.useRef<HTMLButtonElement>(null);
const [open, setOpen] = React.useState(false);
@ -36,7 +36,7 @@ export const SettingsToolbar: React.FC<{}> = () => {
<Dialog
className='settings-toolbar-dialog'
open={open}
width={150}
width={200}
requestClose={() => setOpen(false)}
hostingElement={hostingRef}
>

View file

@ -14,15 +14,13 @@
limitations under the License.
*/
import { ToolbarButton } from '@web/components/toolbarButton';
import * as React from 'react';
import type { ContextEntry } from '../types/entries';
import { MultiTraceModel } from './modelUtil';
import './workbenchLoader.css';
import { toggleTheme } from '@web/theme';
import { Workbench } from './workbench';
import { TestServerConnection, WebSocketTestServerTransport } from '@testIsomorphic/testServerConnection';
import { SettingsToolbar } from './settingsToolbar';
import { SettingsToolbarButton } from './settingsToolbarButton';
export const WorkbenchLoader: React.FunctionComponent<{
}> = () => {
@ -162,7 +160,7 @@ export const WorkbenchLoader: React.FunctionComponent<{
<div className='product'>Playwright</div>
{model.title && <div className='title'>{model.title}</div>}
<div className='spacer'></div>
<SettingsToolbar />
<SettingsToolbarButton />
</div>
<div className='progress'>
<div className='inner-progress' style={{ width: progress.total ? (100 * progress.done / progress.total) + '%' : 0 }}></div>