Skip to content

Dev: Fix useExhaustiveDependencies — Fire Watch components#5535

Open
conbrad wants to merge 3 commits into
mainfrom
5524-dev-fix-useexhaustivedependencies-fire-watch
Open

Dev: Fix useExhaustiveDependencies — Fire Watch components#5535
conbrad wants to merge 3 commits into
mainfrom
5524-dev-fix-useexhaustivedependencies-fire-watch

Conversation

@conbrad

@conbrad conbrad commented Jun 18, 2026

Copy link
Copy Markdown
Collaborator
  • Removes all biome-ignore lint/correctness/useExhaustiveDependencies suppressions from Fire Watch components and fixes dep arrays properly.

CreateFireWatch / FireWatchDashboard : Added dispatch to deps. Redux dispatch is a stable reference so this is a no-op behaviourally.

ReviewSubmitStep: Changed map init effect deps from [] to [fireWatch] so the summary map re-initialises if the user edits location and returns to the review step.

LocationStep (most involved):

  • handleFormUpdate converted to useCallback with functional setFireWatch(prev => ({...})) to avoid a stale closure on fireWatch.
  • resetMapInteractions converted to useCallback([map]).
  • Removed a duplicate Translate interaction that was being registered in both the singleclick effect and the marker-sync effect. The marker-sync effect (Effect 1) now owns Translate; the
    singleclick effect is scoped to click handling only.
  • Removed the separate text-field sync useEffect; lat/lon inputs are now updated directly inside handleMapClick and updateMarkerFromInputs, which eliminates a reactive loop.

Tests added

  • createFireWatch.test.tsx — dispatches on mount, renders all stepper labels
  • locationStep.test.tsx — renders lat/lon fields, formats coordinates on blur, clears geometry when inputs are empty

Test Links:

Landing Page
MoreCast
Percentile Calculator
C-Haines
FireCalc
FireCalc bookmark
Auto Spatial Advisory (ASA)
HFI Calculator
SFMS Insights
Fire Watch
Weather Toolkit

@conbrad conbrad linked an issue Jun 18, 2026 that may be closed by this pull request
8 tasks
@sonarqubecloud

Copy link
Copy Markdown

@codecov

codecov Bot commented Jun 18, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 66.40%. Comparing base (a4535e4) to head (d352fa6).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5535      +/-   ##
==========================================
+ Coverage   66.32%   66.40%   +0.08%     
==========================================
  Files         380      380              
  Lines       22543    22543              
  Branches     3098     3098              
==========================================
+ Hits        14951    14970      +19     
+ Misses       6439     6420      -19     
  Partials     1153     1153              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@conbrad conbrad requested a review from brettedw June 18, 2026 20:15

@brettedw brettedw left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, looks good!

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.

Dev: Fix useExhaustiveDependencies — Fire Watch

2 participants