Skip to content

Add DXCC target selector for DX Target panel#667

Merged
accius merged 4 commits intoaccius:Stagingfrom
echo-gravitas:echo-gravitas/issue-206
Mar 4, 2026
Merged

Add DXCC target selector for DX Target panel#667
accius merged 4 commits intoaccius:Stagingfrom
echo-gravitas:echo-gravitas/issue-206

Conversation

@echo-gravitas
Copy link
Copy Markdown
Contributor

Summary

This PR adds a DXCC entity selector to the DX Target panel, requested in feature request #206.

Users can now open a DXCC input next to the Maidenhead locator, search/select a DXCC entity, and move the DX target location to the corresponding entity coordinates. The selector also includes a clear button for the current input.

What changed

  • added a DXCC selector for the DX Target panel
  • placed the DXCC toggle button directly next to the DX Maidenhead locator
  • used existing cty.dat entity data already loaded by the app
  • wired selection into the existing DX target location flow, so map/bearing/distance/propagation update automatically
  • added a clear (x) button to reset the DXCC input field
  • added the new i18n keys to all language files, with English defaults/fallback text

select-dxcc

Notes

This implementation intentionally reuses the current DX target update mechanism instead of introducing a separate location path.

One technical note: DE Location and DX Target are currently implemented inline in multiple layouts rather than as shared components. These panels are starting to become heavier, and the dockable layout already shows some additional render overhead. It may make sense in a follow-up to extract them into dedicated components for better reuse, maintainability, and render isolation.

@accius
Copy link
Copy Markdown
Owner

accius commented Mar 4, 2026

Nice feature — the component is well structured and the CTY data wiring is clean. A few things to address before merge:

Unused translation keysdxccShowButton and dxccHideButton are defined in all 15 language files but never referenced anywhere in the code. The toggle button just renders the hardcoded string DXCC. Either wire up the translation keys or remove them.

Untranslated strings in non-English files — Only de.json has actual German translations for the new keys. The other 13 languages (es, fr, it, ja, ko, ms, nl, pt, sl, zh, ca, ka, ru) all have English text copy-pasted in. These should either be properly translated or removed from those files so i18next falls back to en.json naturally. Having English in a non-English file makes it look translated when it isn't, and makes missing translations harder to find later.

textAlign: 'right' removed from DXGridInput — This changes the grid square alignment for all users regardless of whether the DXCC selector is visible. Was this intentional? It's a separate visual change from the DXCC feature and might surprise people.

Non-blocking nits:

  • Selecting from the datalist dropdown sets the input value but doesn't commit until blur or Enter. User picks "Japan (JA)" from the list and nothing visibly happens until they click away. Could auto-commit on exact match in onChange as a polish pass, but not a blocker.

Everything else looks good — useId() for the datalist, the CTY event listener with cleanup, optionMap memoization, and the locked/disabled states are all solid.

@echo-gravitas echo-gravitas marked this pull request as draft March 4, 2026 17:55
@echo-gravitas
Copy link
Copy Markdown
Contributor Author

@accius - thank you for the feedback.

Since I’m not able to provide proper translations for all languages myself, I removed the untranslated translation keys from the non-English files. We could potentially use AI here, but I’d rather fall back to English than ship incorrect AI-generated translations.

I removed textAlign: 'right' in DXGridInput intentionally, because it created an awkward empty gap in the panel. With everything left-aligned, the layout looks cleaner and more consistent. See the screenshot from the current version on openhamclock.com:

Bildschirmfoto 2026-03-04 um 18 59 46

Lastly, I really liked your suggestion to update the DX Target immediately on onChange when selecting from the input. I’ve implemented that as well. It makes the feature feel complete and improves the UX nicely.

@echo-gravitas echo-gravitas marked this pull request as ready for review March 4, 2026 18:10
@accius accius merged commit d66ec4f into accius:Staging Mar 4, 2026
@echo-gravitas echo-gravitas deleted the echo-gravitas/issue-206 branch March 6, 2026 13:50
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.

2 participants