♻️ Improve reporter workflows and enable React Compiler#219
Conversation
Batch comparison group actions to reduce mutation/refetch churn, add strict numeric settings validation, and gate projects fetch by auth state. Enable React Compiler in reporter Vite configs and add reporter E2E coverage for builds auth fetch behavior and invalid numeric saves.
This comment has been minimized.
This comment has been minimized.
Code ReviewThis is a solid performance optimization PR with good test coverage. The changes are well-structured and follow React best practices. Here's my detailed feedback: ✅ Strengths
🔍 Potential Issues1. Batch operations lack atomicity (Medium Priority)In mutationFn: ids => {
let idList = asIdList(ids);
return Promise.all(idList.map(id => tdd.acceptBaseline(id)));
}Issue: If one baseline fails, Recommendation: Consider one of these approaches:
2. Form validation stores numeric values as strings (Low Priority)In threshold: String(config?.comparison?.threshold ?? 2.0),
port: String(config?.server?.port ?? 47392),
timeout: String(config?.server?.timeout ?? 30000),While this works with the new validation approach, it's unconventional. React controlled inputs can handle numeric values directly if you use Impact: Minimal - the current approach works, but it's a bit non-idiomatic. 3. Missing error message for non-integer threshold values (Low Priority)In let threshold = parseNumberInput(formData.threshold);
if (threshold === null || threshold < 0) {
errors.threshold = 'Threshold must be a number greater than or equal to 0.';
}The UI uses 🎯 Performance Considerations
🔒 Security ConsiderationsNo significant security concerns. Input validation is client-side only (as expected for a local TDD tool), and the numeric parsing is safe. 🧪 Test CoverageThe new tests are comprehensive:
Suggestion: Consider adding a test for the group accept/reject batching behavior to ensure it actually batches requests (similar to the request tracking test). 📝 Code Quality
Minor Suggestions
SummaryThis PR delivers exactly what it promises: better performance through batching, React Compiler support, and UX improvements via validation. The implementation is solid with good test coverage. Recommendation: Approve with optional follow-up on the batch atomicity issue if you expect network failures to be common in practice. Nice work! 🚀 |
Switch batch accept/reject to allSettled semantics and preserve successful optimistic updates when some requests fail. Add unit coverage for batch mutation error metadata and selective rollback behavior.
Vizzly - Visual Test Results
|
Why
We shipped reporter perf work recently, and there were still a few high-impact cleanup opportunities:
What changed
Test plan
All passed locally.