Skip to content

Commit

Permalink
feat: Add icon denoting action type
Browse files Browse the repository at this point in the history
  • Loading branch information
mhan83 committed Jul 2, 2024
1 parent aab8bb2 commit 0b4bdf9
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 6 deletions.
2 changes: 1 addition & 1 deletion webview-ui/test-generation/src/TestStep.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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%);
}
Expand Down
25 changes: 20 additions & 5 deletions webview-ui/test-generation/src/TestStep.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -48,16 +49,30 @@ 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]);

return (
<section className="test-step">
<header>
{/* <div className="action-icon">
<img className="icon" src={tapIconUrl} />
</div> */}
{actionIcon && (
<div className="action-icon">
<img className="icon header" src={actionIcon} />
</div>
)}
<div className="title">Step {index + 1}</div>
<div className="fullscreen">
<VSCodeButton
Expand All @@ -74,7 +89,7 @@ export function TestStep(props: {
}}
>
<img
className="icon button"
className="icon header"
src={fullScreenIcon}
alt="Open image in full screen."
/>
Expand Down
11 changes: 11 additions & 0 deletions webview-ui/test-generation/src/icons/icn-gesture-swipe-fill.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 0b4bdf9

Please sign in to comment.