|
45 | 45 | handleAction("STOP"); |
46 | 46 | } |
47 | 47 |
|
| 48 | + function handleToggleInteractive() { |
| 49 | + handleAction("TOGGLE_INTERACTIVE"); |
| 50 | + } |
| 51 | +
|
48 | 52 | // Derived values |
49 | 53 | const status = $derived(testcase.status); |
50 | 54 | const visible = $derived(testcase.shown); |
|
117 | 121 | </p> |
118 | 122 | </div> |
119 | 123 | {/if} |
120 | | - {#if testcase.mode === "interactive"} |
121 | | - <div class="toolbar-badge-container toolbar-badge" data-status="CE"> |
122 | | - <div class="toolbar-icon toolbar-icon-exclude-highlight"> |
123 | | - <div class="codicon codicon-bolded codicon-chat-sparkle"></div> |
124 | | - </div> |
125 | | - </div> |
126 | | - {/if} |
| 124 | + <div |
| 125 | + class="toolbar-badge-container toolbar-badge" |
| 126 | + data-status={testcase.mode === "interactive" ? "CE" : "NA"} |
| 127 | + > |
| 128 | + <button |
| 129 | + class="toolbar-icon toolbar-icon-exclude-highlight" |
| 130 | + data-tooltip={testcase.mode === "interactive" |
| 131 | + ? "Make Non-Interactive" |
| 132 | + : "Make Interactive"} |
| 133 | + aria-label={testcase.mode === "interactive" ? "Make Non-Interactive" : "Make Interactive"} |
| 134 | + onclick={handleToggleInteractive} |
| 135 | + > |
| 136 | + <div class="codicon codicon-bolded codicon-chat-sparkle"></div> |
| 137 | + </button> |
| 138 | + </div> |
127 | 139 | </div> |
128 | 140 | <div class="testcase-buttons"> |
129 | 141 | <button class="toolbar-icon" data-tooltip="Run Testcase" aria-label="Run" onclick={handleRun}> |
|
175 | 187 | </div> |
176 | 188 | <p class="toolbar-badge-text">COMPILING</p> |
177 | 189 | </div> |
178 | | - {#if testcase.mode === "interactive"} |
179 | | - <div class="toolbar-badge-container toolbar-badge" data-status="CE"> |
180 | | - <div class="toolbar-icon toolbar-icon-exclude-highlight"> |
181 | | - <div class="codicon codicon-bolded codicon-chat-sparkle"></div> |
182 | | - </div> |
183 | | - </div> |
184 | | - {/if} |
| 190 | + <div |
| 191 | + class="toolbar-badge-container toolbar-badge" |
| 192 | + data-status={testcase.mode === "interactive" ? "CE" : "NA"} |
| 193 | + > |
| 194 | + <button |
| 195 | + class="toolbar-icon toolbar-icon-exclude-highlight" |
| 196 | + data-tooltip={testcase.mode === "interactive" |
| 197 | + ? "Make Non-Interactive" |
| 198 | + : "Make Interactive"} |
| 199 | + aria-label={testcase.mode === "interactive" ? "Make Non-Interactive" : "Make Interactive"} |
| 200 | + onclick={handleToggleInteractive} |
| 201 | + > |
| 202 | + <div class="codicon codicon-bolded codicon-chat-sparkle"></div> |
| 203 | + </button> |
| 204 | + </div> |
185 | 205 | </div> |
186 | 206 | </div> |
187 | 207 | {:else if status === "RUNNING"} |
|
204 | 224 | ></div> |
205 | 225 | </button> |
206 | 226 | </div> |
207 | | - {#if testcase.mode === "interactive"} |
208 | | - <div class="toolbar-badge-container toolbar-badge" data-status="CE"> |
209 | | - <div class="toolbar-icon toolbar-icon-exclude-highlight"> |
210 | | - <div class="codicon codicon-bolded codicon-chat-sparkle"></div> |
211 | | - </div> |
212 | | - </div> |
213 | | - {/if} |
| 227 | + <div |
| 228 | + class="toolbar-badge-container toolbar-badge" |
| 229 | + data-status={testcase.mode === "interactive" ? "CE" : "NA"} |
| 230 | + > |
| 231 | + <button |
| 232 | + class="toolbar-icon toolbar-icon-exclude-highlight" |
| 233 | + data-tooltip={testcase.mode === "interactive" |
| 234 | + ? "Make Non-Interactive" |
| 235 | + : "Make Interactive"} |
| 236 | + aria-label={testcase.mode === "interactive" ? "Make Non-Interactive" : "Make Interactive"} |
| 237 | + onclick={handleToggleInteractive} |
| 238 | + > |
| 239 | + <div class="codicon codicon-bolded codicon-chat-sparkle"></div> |
| 240 | + </button> |
| 241 | + </div> |
214 | 242 | <div class="toolbar-icon toolbar-icon-exclude-highlight"> |
215 | 243 | <div class="codicon codicon-loading codicon-modifier-spin"></div> |
216 | 244 | </div> |
|
0 commit comments