Skip to content

feat: tool — maidenhead converter #47

Description

@pskillen

Problem

Maidenhead locator conversion is embedded in channel CRUD (#11): display on detail, input on edit. Operators also need ad-hoc conversion — checking a locator, picking a point on a map, or looking up an address/postcode — without creating or editing a channel.

Conversion logic already exists in src/lib/maidenhead.ts and is documented in docs/features/maidenhead.md (channel-field scope). There is no standalone tool page.

Intended outcome

Add a Tools section with a Maidenhead converter page for two-way conversion between coordinates and Maidenhead locators.

Navigation

  • Add a Tools link at the bottom of the sidebar, near Settings.
  • Tools links to a tools index (or directly to the converter if it is the only child for now).
  • Maidenhead converter route provides the standalone tool.

Converter features

Core (required):

  • Locator → coordinates: accept 4/6/8/10-character Maidenhead input; show lat/lon (centre of finest specified square) using locatorToCoords
  • Coordinates → locator: accept lat/lon; show locator at selectable precision (default 6 chars) using coordsToLocator
  • Validation errors for invalid locator input (same rules as channel edit form)
  • Live update as inputs change

Enhancements (in scope for this issue):

  • Pick on map — click/drag to set coordinates; locator display updates
  • Address / postcode lookup — geocode to coordinates then show locator (provider TBD; browser-side only, no server secrets in repo)

Suggested routes

  • /tools — Tools index
  • /tools/maidenhead — Maidenhead converter

Affected

  • src/App.tsx — sidebar nav + routes
  • New route(s) under src/routes/tools/
  • Reuse src/lib/maidenhead.ts — do not fork conversion math
  • Map component reuse from CodeplugMap or a slim map picker variant
  • Update docs/features/maidenhead.md to note the standalone tool (channel integration vs ad-hoc tool)

Notes / dependencies

  • Reuses locatorToCoords / coordsToCoords from existing lib.
  • Complements feat: CRUD channels #11 (channel edit/detail maidenhead fields) — not a replacement.
  • Address/postcode lookup was explicitly deferred in docs/features/maidenhead.md "Known gaps"; this issue brings it into scope for the standalone tool.
  • Privacy: any API keys (e.g. geocoding) stay in browser localStorage, never committed.

Out of scope

  • Persisting converter results into a codeplug channel (user copies values manually or uses channel edit).
  • Batch conversion of many locators.

Workflow note

Branch from origin/main, atomic conventional commits, PR linking Closes #.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions