Refactor UI Components, Hooks, and Utils (Phase 6)#17
Conversation
- Refactored `NodeManager.jsx` into `NodeListTable`, `AddNodeForm`, and extracted CSV logic. - Refactored `LinkLayer.jsx` into `LinkPolyline` and extracted style helpers. - Refactored `BatchProcessing.jsx` and `BatchNodesPanel.jsx` to use shared CSV parser and list component. - Refactored `GuidanceOverlays.jsx` by moving static content to `helpContent.js`. - Refactored `useViewshedTool` to use new `useWorkerState` hook. - Modularized `rfMath.js` into focused utility files in `src/utils/math/`. - Fixed linting warnings in modified files. - Verified with unit tests for rfMath. Co-authored-by: d3mocide <136547209+d3mocide@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
- Modularized `rfMath.js` into focused utility files (`src/utils/math/`) and re-exported for compatibility. - Extracted shared tile fetching logic into `src/utils/tileFetcher.js`, reducing duplication in `useViewshedTool` and `useRFCoverageTool`. - Created `useWorkerState` hook to standardize Web Worker communication. - Refactored `NodeManager`, `LinkLayer`, `BatchProcessing`, and `GuidanceOverlays` into smaller components and extracted helpers. - Moved static help text to `src/data/helpContent.js`. - Updated `REFACTORING_REPORT.md` to reflect full completion of all refactoring phases. - Verified math functions with existing tests. Co-authored-by: d3mocide <136547209+d3mocide@users.noreply.github.com>
This PR completes the Phase 6 cleanup tasks identified in
REFACTORING_REPORT.md.Changes:
NodeManager.jsxcomponent into smaller, focused components (NodeListTable,AddNodeForm) and moved CSV import/export logic to a utility file.LinkPolyline.jsxand moved style calculation logic tolinkStyleHelpers.js.src/utils/csvParser.jsand created a reusableBatchNodesListcomponent.src/data/helpContent.jsto declutter the component.useWorkerStatehook to manage Web Worker communication, simplifyinguseViewshedTool.js.rfMath.jsfile into modular files (fspl.js,fresnel.js,bullington.js, etc.) while maintaining backward compatibility via re-exports.Testing:
npm test src/utils/__tests__/rfMath.test.jsto verify math functions still work correctly after modularization.PR created automatically by Jules for task 8056762337434931018 started by @d3mocide