✨ Refactor TDD dashboard to use TanStack Query and add remote builds page#85
✨ Refactor TDD dashboard to use TanStack Query and add remote builds page#85
Conversation
…page - Replace custom hooks with TanStack Query for data fetching - Add new /builds route for browsing remote builds and downloading baselines - Extract HTTP server into modular routers for better maintainability - Add unified API client for frontend - Improve error messages for baseline download failures - Remove recent builds card from projects page (now has dedicated route)
Pull Request Review: TanStack Query Refactor + Remote BuildsOverviewThis is a well-architected refactoring that modernizes the TDD dashboard with industry-standard patterns. The core changes—migrating to TanStack Query and modularizing the HTTP server—improve both maintainability and user experience. 🎯 StrengthsArchitecture & Design
New Features
Code Quality
|
|
🔍 Performance & Security ConsiderationsPerformanceQuery Deduplication ✅ TanStack Query automatically deduplicates concurrent requests to the same endpoint—excellent for the polling scenario. Bundle Size Polling Impact SecurityPath Traversal Prevention ✅ Good use of sanitizeScreenshotName and safePath in tdd-service.js (lines 668-682) API Token Exposure ✅ Tokens are properly stored in global config, not exposed in frontend code CORS Configuration ✅ CORS middleware is properly configured in src/server/middleware/cors.js Recommendation: Rate Limiting - Consider adding rate limiting to the download endpoint to prevent abuse (e.g., max 1 download per 5 seconds per user) 📝 Test CoverageWhat is Covered
What is MissingI recommend adding tests for:
📚 Documentation Needs
|
✅ Minor Suggestions
🎯 VerdictRecommendation: ✅ Approve with minor fixes This is high-quality work that significantly improves the codebase. The issues identified are manageable and do not block merging: Before merging:
Post-merge (can be follow-up PRs):
Great work on this refactor! The new architecture sets a solid foundation for future dashboard features. 🚀 Review generated for PR #85 - vizzly-testing/cli |
…e console.log - Move @tanstack/react-query to devDependencies (bundled by Vite) - Add debug logging to silent catch blocks in project-service.js - Remove console.log from useRejectBaseline hook
…page (#85) - Replace custom hooks with TanStack Query for cleaner data fetching and caching - Add new `/builds` route for browsing remote builds and downloading baselines - Extract HTTP server into modular routers for better maintainability - Add unified API client for frontend - Improve error messages for baseline download failures - Remove recent builds card from projects page (now has dedicated route) - [x] All 792 tests pass - [x] Lint passes with 0 errors/warnings - [x] Build succeeds - [x] Manual testing of TDD dashboard views - [x] Manual testing of baseline download from remote builds **Note:** Requires corresponding backend changes to deploy the `/api/build/:projectSlug/:buildId/tdd-baselines` endpoint.
Summary
/buildsroute for browsing remote builds and downloading baselinesTest plan
Note: Requires corresponding backend changes to deploy the
/api/build/:projectSlug/:buildId/tdd-baselinesendpoint.