Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 22 additions & 1 deletion test/html-validate.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,25 @@ async function validateParallel() {
const workers = [];
const taskQueue = [...targets];

// Debouncing state
let lastSuccessReportTime = 0;
let pendingSuccessCount = 0;
let lastSuccessFilePath = null;
const DEBOUNCE_INTERVAL = 2000; // 2 seconds

let isDone = false;
function completeParallelProcessing() {
if (isDone) return;
isDone = true;

workers.forEach((worker) => worker.terminate());

// Report any remaining successful files
if (pendingSuccessCount > 0 && lastSuccessFilePath) {
const relativeFilePath = path.relative(process.cwd(), lastSuccessFilePath);
console.log(`✅ (${completedTasks} of ${targets.length}) ${relativeFilePath}`);
}

const failedResults = results.filter((r) => !r.isValid);
const passedCount = results.length - failedResults.length;

Expand Down Expand Up @@ -108,7 +120,16 @@ async function validateParallel() {
console.log(`- ${line}`);
});
} else {
console.log(`✅ (${completedTasks} of ${targets.length}) ${relativeFilePath}`);
// Debounce successful file reports
const now = Date.now();
pendingSuccessCount++;
lastSuccessFilePath = result.filePath;

if (now - lastSuccessReportTime >= DEBOUNCE_INTERVAL) {
console.log(`✅ (${completedTasks} of ${targets.length}) ${relativeFilePath}`);
Copy link

Copilot AI Dec 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When debouncing is triggered, the displayed file path should be from lastSuccessFilePath (the most recent successful file), not relativeFilePath (the current message's file). This line should use path.relative(process.cwd(), lastSuccessFilePath) to match the intended behavior described in the PR.

Suggested change
console.log(`✅ (${completedTasks} of ${targets.length}) ${relativeFilePath}`);
console.log(`✅ (${completedTasks} of ${targets.length}) ${path.relative(process.cwd(), lastSuccessFilePath)}`);

Copilot uses AI. Check for mistakes.
lastSuccessReportTime = now;
pendingSuccessCount = 0;
}
}

if (taskQueue.length > 0) {
Expand Down
Loading