From 0b4bdf9d31cd030038b68d63a7a0cecb0536737e Mon Sep 17 00:00:00 2001 From: Mike Han Date: Tue, 2 Jul 2024 08:46:52 -0600 Subject: [PATCH] feat: Add icon denoting action type --- webview-ui/test-generation/src/TestStep.scss | 2 +- webview-ui/test-generation/src/TestStep.tsx | 25 +++++++++++++++---- .../src/icons/icn-gesture-swipe-fill.svg | 11 ++++++++ 3 files changed, 32 insertions(+), 6 deletions(-) create mode 100644 webview-ui/test-generation/src/icons/icn-gesture-swipe-fill.svg diff --git a/webview-ui/test-generation/src/TestStep.scss b/webview-ui/test-generation/src/TestStep.scss index 7226f048..46ca05e0 100644 --- a/webview-ui/test-generation/src/TestStep.scss +++ b/webview-ui/test-generation/src/TestStep.scss @@ -15,7 +15,7 @@ section.test-step { .icon { width: 16px; height: 16px; - &.button { + &.header { filter: invert(92%) sepia(1%) saturate(103%) hue-rotate(314deg) brightness(88%) contrast(98%); } diff --git a/webview-ui/test-generation/src/TestStep.tsx b/webview-ui/test-generation/src/TestStep.tsx index 013d7a1c..527a9303 100644 --- a/webview-ui/test-generation/src/TestStep.tsx +++ b/webview-ui/test-generation/src/TestStep.tsx @@ -8,7 +8,8 @@ import Prism from 'prismjs'; import { vscode } from './utilities/vscode'; import './TestStep.scss'; -// import tapIconUrl from './icons/icn-gesture-tap-fill.svg'; +import tapIconUrl from './icons/icn-gesture-tap-fill.svg'; +import swipeIconUrl from './icons/icn-gesture-swipe-fill.svg'; import fullScreenIcon from './icons/icn-fullscreen-fill.svg'; import botIcon from './icons/icn-bot-fill.svg'; import thumbsUpIcon from './icons/icn-thumbs-up.svg'; @@ -48,6 +49,18 @@ export function TestStep(props: { const imgSrc = `${window.historyPath}/${testRecordId}/${screenshot.name}`; + let actionIcon; + switch (action) { + case 'scroll': + actionIcon = swipeIconUrl; + break; + case 'click': + actionIcon = tapIconUrl; + break; + default: + actionIcon = null; + } + useEffect(() => { Prism.highlightAll(); }, [language, showAlternatives]); @@ -55,9 +68,11 @@ export function TestStep(props: { return (
- {/*
- -
*/} + {actionIcon && ( +
+ +
+ )}
Step {index + 1}
Open image in full screen. diff --git a/webview-ui/test-generation/src/icons/icn-gesture-swipe-fill.svg b/webview-ui/test-generation/src/icons/icn-gesture-swipe-fill.svg new file mode 100644 index 00000000..da2773a0 --- /dev/null +++ b/webview-ui/test-generation/src/icons/icn-gesture-swipe-fill.svg @@ -0,0 +1,11 @@ + + + + + + + + + + +