Skip to content

Refactor UI Components, Hooks, and Utils (Phase 6)#17

Merged
d3mocide merged 2 commits intomainfrom
refactor-cleanup-phase6-8056762337434931018
Feb 27, 2026
Merged

Refactor UI Components, Hooks, and Utils (Phase 6)#17
d3mocide merged 2 commits intomainfrom
refactor-cleanup-phase6-8056762337434931018

Conversation

@d3mocide
Copy link
Owner

This PR completes the Phase 6 cleanup tasks identified in REFACTORING_REPORT.md.

Changes:

  1. Node Manager: Split the large NodeManager.jsx component into smaller, focused components (NodeListTable, AddNodeForm) and moved CSV import/export logic to a utility file.
  2. Link Layer: Extracted the visual rendering of links and Fresnel zones into LinkPolyline.jsx and moved style calculation logic to linkStyleHelpers.js.
  3. Batch Processing: Consolidated CSV parsing logic into src/utils/csvParser.js and created a reusable BatchNodesList component.
  4. Guidance Overlays: Extracted static help text to src/data/helpContent.js to declutter the component.
  5. Hooks: Created a generic useWorkerState hook to manage Web Worker communication, simplifying useViewshedTool.js.
  6. RF Math: Split the large rfMath.js file into modular files (fspl.js, fresnel.js, bullington.js, etc.) while maintaining backward compatibility via re-exports.

Testing:

  • Ran npm test src/utils/__tests__/rfMath.test.js to verify math functions still work correctly after modularization.
  • Fixed linting warnings in touched files.

PR created automatically by Jules for task 8056762337434931018 started by @d3mocide

- 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>
@google-labs-jules
Copy link
Contributor

👋 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 @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

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>
@d3mocide d3mocide merged commit 6578707 into main Feb 27, 2026
4 checks passed
@d3mocide d3mocide deleted the refactor-cleanup-phase6-8056762337434931018 branch February 27, 2026 04:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant