Skip to content

Commit 74a01a8

Browse files
committed
Add reset results functionality to test UI
- Introduced a "Reset results" button to clear test container backgrounds and remove error messages. - Implemented hover styles for the reset button to enhance user interaction. - Ensured the reset functionality hides the progress panel and resets progress tracking.
1 parent 190f835 commit 74a01a8

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

src/puter-js/test/run.html

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,11 @@
255255
opacity: 0.8;
256256
margin-top: 2px;
257257
}
258+
259+
#reset-results:hover {
260+
color: #333;
261+
text-decoration: none;
262+
}
258263
</style>
259264
<script>
260265
document.addEventListener("DOMContentLoaded", () => {
@@ -653,6 +658,18 @@
653658
runTests();
654659
});
655660

661+
// Reset results functionality
662+
$('#reset-results').click(() => {
663+
// Clear all test container background colors
664+
$('.test-container').css('background-color', '');
665+
// Remove all error message pre elements
666+
$('.test-container pre').remove();
667+
// Hide progress panel if it's showing
668+
hideProgressPanel();
669+
// Reset progress tracking
670+
resetProgress();
671+
});
672+
656673
// Master checkbox functionality
657674
$('#master-checkbox').change(function() {
658675
const isChecked = $(this).prop('checked');
@@ -704,6 +721,7 @@
704721
</label>
705722
<span id="test-counter"></span>
706723
<div style="flex: 1; text-align: right;">
724+
<span id="reset-results" style="margin-right: 20px; cursor: pointer; color: #666; text-decoration: underline; font-size: 14px;">Reset results</span>
707725
<button id="run-tests" style="margin-right: 30px;">Run Tests</button>
708726
</div>
709727
</nav>

0 commit comments

Comments
 (0)