Skip to content

Commit bd07e42

Browse files
committed
Various tweaks to UI
1 parent b43ad67 commit bd07e42

File tree

3 files changed

+36
-17
lines changed

3 files changed

+36
-17
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,13 @@
88

99
- Show empty stdout for testcase with a placeholder instead of hiding it
1010
- Added file name to the file template picker item's description to improve matching
11+
- Always show the icon to indicate the type of current testcase and make it clickable to toggle testcase interactivity
1112

1213
### Fixed
1314

1415
- (Regression) skipped testcases are still being ran
16+
- Don't half the opacity of clickable elements
17+
- Dropdown still modifies visibility of testcases behind the scenes on skipped testcases
1518

1619
# 4.0.0
1720

src/webview/judge/TestcaseToolbar.svelte

Lines changed: 26 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,13 @@
5555
const skipped = $derived(testcase.skipped);
5656
const toggled = $derived(testcase.toggled);
5757
const showDetails = $derived(!skipped && visible && !(status === "AC" && !toggled));
58+
const statusIcon = $derived(
59+
testcase.mode === "interactive" ? "codicon-comment-discussion-sparkle" : "codicon-output"
60+
);
5861
</script>
5962

6063
{#if status === "NA" || status === "AC" || status === "WA" || status === "RE" || status === "TL" || status === "ML" || status === "CE"}
61-
<div class="toolbar" class:toolbar--hidden={skipped}>
64+
<div class="toolbar" class:toolbar--hidden={skipped} class:toolbar--skipped={skipped}>
6265
<div class="toolbar-badges">
6366
<div
6467
class="toolbar-badge-container toolbar-dropdown-container toolbar-badge"
@@ -69,6 +72,7 @@
6972
data-tooltip={showDetails ? "Hide Details" : "Show Details"}
7073
aria-label={showDetails ? "Hide" : "Show"}
7174
onclick={handleToggleVisibility}
75+
disabled={skipped}
7276
>
7377
<div
7478
class="codicon codicon-bolded {showDetails
@@ -133,19 +137,26 @@
133137
aria-label={testcase.mode === "interactive" ? "Make Non-Interactive" : "Make Interactive"}
134138
onclick={handleToggleInteractive}
135139
>
136-
<div class="codicon codicon-bolded codicon-chat-sparkle"></div>
140+
<div class="codicon codicon-bolded {statusIcon}"></div>
137141
</button>
138142
</div>
139143
</div>
140144
<div class="testcase-buttons">
141-
<button class="toolbar-icon" data-tooltip="Run Testcase" aria-label="Run" onclick={handleRun}>
145+
<button
146+
class="toolbar-icon"
147+
data-tooltip="Run Testcase"
148+
aria-label="Run"
149+
onclick={handleRun}
150+
disabled={skipped}
151+
>
142152
<div class="codicon codicon-run-below"></div>
143153
</button>
144154
<button
145155
class="toolbar-icon"
146156
data-tooltip="Debug Testcase"
147157
aria-label="Debug"
148158
onclick={handleDebug}
159+
disabled={skipped}
149160
>
150161
<div class="codicon codicon-debug-alt"></div>
151162
</button>
@@ -199,7 +210,7 @@
199210
aria-label={testcase.mode === "interactive" ? "Make Non-Interactive" : "Make Interactive"}
200211
onclick={handleToggleInteractive}
201212
>
202-
<div class="codicon codicon-bolded codicon-chat-sparkle"></div>
213+
<div class="codicon codicon-bolded {statusIcon}"></div>
203214
</button>
204215
</div>
205216
</div>
@@ -216,6 +227,7 @@
216227
data-tooltip={showDetails ? "Hide Details" : "Show Details"}
217228
aria-label={showDetails ? "Hide" : "Show"}
218229
onclick={handleToggleVisibility}
230+
disabled={skipped}
219231
>
220232
<div
221233
class="codicon codicon-bolded {showDetails
@@ -236,7 +248,7 @@
236248
aria-label={testcase.mode === "interactive" ? "Make Non-Interactive" : "Make Interactive"}
237249
onclick={handleToggleInteractive}
238250
>
239-
<div class="codicon codicon-bolded codicon-chat-sparkle"></div>
251+
<div class="codicon codicon-bolded {statusIcon}"></div>
240252
</button>
241253
</div>
242254
<div class="toolbar-icon toolbar-icon-exclude-highlight">
@@ -265,14 +277,6 @@
265277
gap: 6px;
266278
}
267279
268-
.toolbar--hidden > .toolbar-badges {
269-
opacity: 0.5;
270-
}
271-
272-
.toolbar--hidden > .testcase-buttons > *:not(.toolbar-icon-exclude-fade) {
273-
opacity: 0.5;
274-
}
275-
276280
.toolbar-left {
277281
display: flex;
278282
align-items: center;
@@ -317,6 +321,11 @@
317321
background: var(--vscode-button-secondaryBackground);
318322
}
319323
324+
.toolbar-icon:disabled:not(.toolbar-icon-exclude-highlight) {
325+
opacity: 0.5;
326+
cursor: not-allowed;
327+
}
328+
320329
.toolbar-badge-container {
321330
display: flex;
322331
align-items: center;
@@ -329,6 +338,10 @@
329338
color: var(--vscode-badge-foreground);
330339
}
331340
341+
.toolbar--skipped .toolbar-badge-container {
342+
opacity: 0.5;
343+
}
344+
332345
.toolbar-dropdown-container {
333346
padding: 0px;
334347
}

src/webview/stress/StateToolbar.svelte

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@
4343
4444
// Derived value for whether details should be shown
4545
const showDetails = $derived(shown);
46+
const statusIcon = $derived(
47+
interactiveMode ? "codicon-comment-discussion-sparkle" : "codicon-output"
48+
);
4649
</script>
4750

4851
{#if status === "COMPILING"}
@@ -61,7 +64,7 @@
6164
aria-label={interactiveMode ? "Make Non-Interactive" : "Make Interactive"}
6265
onclick={handleToggleInteractive}
6366
>
64-
<div class="codicon codicon-bolded codicon-chat-sparkle"></div>
67+
<div class="codicon codicon-bolded {statusIcon}"></div>
6568
</button>
6669
</div>
6770
<div class="state-badge state-status" data-status={status}>
@@ -102,7 +105,7 @@
102105
aria-label={interactiveMode ? "Make Non-Interactive" : "Make Interactive"}
103106
onclick={handleToggleInteractive}
104107
>
105-
<div class="codicon codicon-bolded codicon-chat-sparkle"></div>
108+
<div class="codicon codicon-bolded {statusIcon}"></div>
106109
</button>
107110
</div>
108111
<div class="state-toolbar-icon state-toolbar-icon-exclude-highlight">
@@ -140,7 +143,7 @@
140143
aria-label={interactiveMode ? "Make Non-Interactive" : "Make Interactive"}
141144
onclick={handleToggleInteractive}
142145
>
143-
<div class="codicon codicon-bolded codicon-chat-sparkle"></div>
146+
<div class="codicon codicon-bolded {statusIcon}"></div>
144147
</button>
145148
</div>
146149
<div class="state-badge state-status" data-status={status}>
@@ -199,7 +202,7 @@
199202
aria-label={interactiveMode ? "Make Non-Interactive" : "Make Interactive"}
200203
onclick={handleToggleInteractive}
201204
>
202-
<div class="codicon codicon-bolded codicon-chat-sparkle"></div>
205+
<div class="codicon codicon-bolded {statusIcon}"></div>
203206
</button>
204207
</div>
205208
</div>

0 commit comments

Comments
 (0)