fix: file explorer auto-refresh with visual feedback and legacy migration#335
fix: file explorer auto-refresh with visual feedback and legacy migration#335pedramamini merged 1 commit intomainfrom
Conversation
- Added visible auto-refresh spinner pulse in File Explorer refresh cycles 🔄 - Migrated legacy sessions to default 180s file-tree auto-refresh interval 🧭 - Auto-refresh now awaits refresh completion before stopping indicator ⏱️ - Right panel props now react to auto-refresh interval changes instantly 🧩 - File explorer timer tests upgraded to async timer advancement for stability 🧪 - New coverage ensures spinner starts and stops correctly after auto-refresh 💫 - Input processing tests now isolate fake timers to prevent cross-test leaks 🧯
Code ReviewSummaryThis PR adds visual feedback for file explorer auto-refresh and includes migration logic for legacy sessions. The implementation is clean and well-tested. Strengths
Issues FoundCritical: Missing test infrastructureThe test at line 737 expects screen.getByTestId('refresh-icon') but no data-testid attribute exists in the component (FileExplorerPanel.tsx:1129). Without this attribute, the test will fail. Fix needed: Add data-testid="refresh-icon" to the RefreshCw element at line 1129. Minor: Potential timer leakThe setTimeout in line 499 is not tracked, so it could fire after unmount. Consider storing the timeout ID in a ref and clearing it in the cleanup function to prevent React warnings if the component unmounts during the 500ms window. Minor: Unnecessary async wrapperThe interval callback is async but does not need to be. setInterval does not care about the return value. The await is fine (ensures refresh completes before spinner stops), but the async keyword on the arrow function has no effect. Not harmful, but unnecessary. Checklist Before Merge
VerdictApprove with required fix. The missing data-testid will cause test failures. Once that is added, this is a solid improvement with good test hygiene and user experience enhancements. |
Summary
fileTreeAutoRefreshIntervalare migrated to the 180s default on loaduseMemodeps)Changes
FileExplorerPanel.tsxawaits the refresh and shows a 500ms spin animationApp.tsxfileTreeAutoRefreshInterval: 180for legacy sessionsuseRightPanelProps.tsfileTreeAutoRefreshIntervalto memo dependency arrayFileExplorerPanel.test.tsxadvanceTimersByTimeAsync); added spinner start/stop coverageuseInputProcessing.test.tsTest plan