Add debounced output for HTML validation#179
Conversation
- Success messages now grouped and shown once every 2 seconds - Displays the most recent file that passed validation - Reduces output from one line per file to periodic summaries - Error messages still shown immediately for each failing file - Makes output more readable, especially for AI assistants Closes #177
There was a problem hiding this comment.
Pull request overview
This PR adds debounced output for HTML validation success messages to improve readability, especially when validating many files. Instead of printing a success message for every valid file, success messages are now grouped and displayed periodically (every 2 seconds), showing the most recent file that passed validation. Error messages continue to be displayed immediately.
- Adds debouncing logic with state tracking for successful validations
- Implements periodic success message output (every 2 seconds)
- Ensures any pending success messages are reported when validation completes
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| lastSuccessFilePath = result.filePath; | ||
|
|
||
| if (now - lastSuccessReportTime >= DEBOUNCE_INTERVAL) { | ||
| console.log(`✅ (${completedTasks} of ${targets.length}) ${relativeFilePath}`); |
There was a problem hiding this comment.
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.
| console.log(`✅ (${completedTasks} of ${targets.length}) ${relativeFilePath}`); | |
| console.log(`✅ (${completedTasks} of ${targets.length}) ${path.relative(process.cwd(), lastSuccessFilePath)}`); |
Closes #177