From 010d566e3fb5c3ad097c6f73caa7b8a4fb1f3cfe Mon Sep 17 00:00:00 2001 From: Simon Knott Date: Wed, 21 Aug 2024 15:46:38 +0200 Subject: [PATCH] disable all controls --- packages/trace-viewer/src/ui/inspectorTab.tsx | 6 ++++-- packages/trace-viewer/src/ui/snapshotTab.tsx | 5 ++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/packages/trace-viewer/src/ui/inspectorTab.tsx b/packages/trace-viewer/src/ui/inspectorTab.tsx index 7b3a90b709..ba37cf1bd1 100644 --- a/packages/trace-viewer/src/ui/inspectorTab.tsx +++ b/packages/trace-viewer/src/ui/inspectorTab.tsx @@ -17,7 +17,7 @@ import { CodeMirrorWrapper } from '@web/components/codeMirrorWrapper'; import type { Language } from '@web/components/codeMirrorWrapper'; import { ToolbarButton } from '@web/components/toolbarButton'; -import { copy } from '@web/uiUtils'; +import { copy, useSetting } from '@web/uiUtils'; import * as React from 'react'; import './sourceTab.css'; @@ -27,10 +27,12 @@ export const InspectorTab: React.FunctionComponent<{ highlightedLocator: string, setHighlightedLocator: (locator: string) => void, }> = ({ sdkLanguage, setIsInspecting, highlightedLocator, setHighlightedLocator }) => { + const [showScreenshot] = useSetting('screenshot-instead-of-snapshot', false); + return
Locator
- { + { // Updating text needs to go first - react can squeeze a render between the state updates. setHighlightedLocator(text); setIsInspecting(false); diff --git a/packages/trace-viewer/src/ui/snapshotTab.tsx b/packages/trace-viewer/src/ui/snapshotTab.tsx index 6e16823302..dc48ed0de3 100644 --- a/packages/trace-viewer/src/ui/snapshotTab.tsx +++ b/packages/trace-viewer/src/ui/snapshotTab.tsx @@ -201,7 +201,7 @@ export const SnapshotTab: React.FunctionComponent<{ iframe={iframeRef1.current} iteration={loadingRef.current.iteration} /> - setIsInspecting(!isInspecting)} disabled={showScreenshotInsteadOfSnapshot /* TODO: proper tooltip */} /> + setIsInspecting(!isInspecting)} disabled={showScreenshotInsteadOfSnapshot} /> {['action', 'before', 'after'].map(tab => { return ; })}
- {/* TODO: disable + proper tooltip. also for locator tab */} - { + { if (!openPage) openPage = window.open; const win = openPage(popoutUrl || '', '_blank');