Skip to content

fix(grid-display): restore Maidenhead grid square in DE/DX panels#975

Merged
alanhargreaves merged 1 commit into
accius:Stagingfrom
ceotjoe:fix/grid-square-display
May 12, 2026
Merged

fix(grid-display): restore Maidenhead grid square in DE/DX panels#975
alanhargreaves merged 1 commit into
accius:Stagingfrom
ceotjoe:fix/grid-square-display

Conversation

@ceotjoe
Copy link
Copy Markdown
Collaborator

@ceotjoe ceotjoe commented May 12, 2026

Summary

  • Fixes blank Maidenhead grid squares in both the DE and DX location panels
  • Root cause: commit d1ab3d5 (PR Issue951 maidenhead grid to utils geo #964) replaced calculateGridSquare(lat, lon) with latLonToMaidenhead but kept the old two-positional-argument call style — latLonToMaidenhead expects a { lat, lon } object as its first argument
  • Passing a bare number caused destructuring to yield undefined for both lat and lon, producing NaN throughout the calculation and invisible characters in the rendered grid

Change

src/hooks/app/useTimeState.js lines 101-102:

Before (broken): latLonToMaidenhead(configLocation.lat, configLocation.lon)
After (correct): latLonToMaidenhead(configLocation)

Both configLocation and dxLocation are already { lat, lon } objects, so they can be passed directly.

Test plan

  • Open the app and confirm the DE panel shows a 6-character Maidenhead locator (e.g. GH52lj)
  • Confirm the DX panel also shows a locator
  • Set a DX location manually and confirm the locator updates
  • Verify a station at lat=0 / lon=0 (equator / prime meridian) renders JJ00aa — not blank

🤖 Generated with Claude Code

…re lat/lon

d1ab3d5 replaced calculateGridSquare(lat, lon) with latLonToMaidenhead but kept
the two-positional-arg call style. latLonToMaidenhead expects ({lat, lon}) as its
first argument; passing a bare number caused lat/lon to destructure as undefined,
producing NaN and invisible characters in both DE and DX grid squares.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@ceotjoe ceotjoe linked an issue May 12, 2026 that may be closed by this pull request
@ceotjoe ceotjoe requested a review from alanhargreaves May 12, 2026 07:01
@alanhargreaves
Copy link
Copy Markdown
Collaborator

Looks good to me. I don't see any other instances.

@alanhargreaves alanhargreaves merged commit 93e041b into accius:Staging May 12, 2026
3 of 4 checks passed
@MichaelWheeley
Copy link
Copy Markdown
Contributor

added #982 for meridian / anti-meridian unit tests, and fix for special case longitude = +180

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.

[BUG] grid locators not being shown in DE/DX panels

3 participants