Commit graph

109 commits

Author SHA1 Message Date
James Rich
22d46a50ef feat(map): material3 controls + latitude-aware precision circles
- Add DisappearingScaleBar overlay (bottom-start) that auto-shows on zoom
  change and hides after 3 seconds, using CameraState.metersPerDpAtTarget
- Add ExpandingAttributionButton overlay (bottom-end) for tile provider
  attribution display (legal compliance), auto-dismisses on map gesture
- Thread StyleState from MapScreen → MaplibreMapContent → MaplibreMap to
  provide source attribution data for the attribution button
- Use LocationPuckDefaults.colors() for Material 3 themed location puck
  (derives colors from MaterialTheme.colorScheme instead of hardcoded blue)
- Replace hardcoded METERS_PER_PIXEL_ZOOM15 equatorial constant in InlineMap
  with CameraState.metersPerDpAtTarget for latitude-aware precision circles
2026-04-14 22:30:42 -05:00
James Rich
2fd93bc67f fix(map): audit best practices — OnlyLogo ornaments, always-visible location puck, rounded line caps
- OrnamentOptions.AllEnabled → OnlyLogo since custom MapControlsOverlay
  already provides compass and controls (avoids duplicate native ornaments)
- Location puck now visible whenever location is available, not only when
  tracking is enabled (standard map UX — blue dot always shows position)
- Add LineCap.Round + LineJoin.Round to all route and track LineLayer
  instances for smooth corners instead of jagged defaults
2026-04-14 22:30:42 -05:00
James Rich
cf97f2d5cd refactor(map): polish — DRY coordinate helpers, tighter visibility, dead code removal, null safety
- Extract toGeoPositionOrNull() into MapConstants.kt, replacing 8 duplicated
  coordinate-conversion patterns across GeoJsonConverters, TracerouteLayers,
  TracerouteMap, NodeTrackMap, InlineMap, and MapScreen
- Extract typedFeatureCollection() helper to centralize the single unavoidable
  UNCHECKED_CAST, eliminating 9 scattered @Suppress annotations
- Fix hardcoded style URI in InlineMap — now uses MapStyle.OpenStreetMap.toBaseStyle()
- Tighten visibility: internal on MapButton, NodeTrackLayers, TracerouteLayers;
  private on BaseMapViewModel.nodes
- Fix null safety: replace waypoint!!.id with safe mapNotNull pattern
- Remove dead code: getUser(), myId (BaseMapViewModel); mapStyleId, applicationId,
  setDestNum, mapPrefs (NodeMapViewModel)
- Remove redundant empty onFrame={} in MaplibreMapContent
- Rename COORDINATE_PRECISION to FORMAT_DECIMAL_FACTOR in EditWaypointDialog
- Update stale KDoc on BaseMapViewModel and MapButton; add KDoc on FeatureMapModule,
  LayerType, MapLayerItem, MapNavigation.mapGraph
- Add 11 new tests: toGeoPositionOrNull (4), typedFeatureCollection (1),
  convertIntToEmoji fallback (1), combined filters (1), MapStyle.toBaseStyle (3),
  MapStyle defaults (1)
2026-04-14 22:30:42 -05:00
James Rich
fd4c3b0d45 refactor(map): architectural improvements — DRY, UDF, dead code, test coverage
- Extract COORDINATE_SCALE to shared MapConstants.kt, removing 6 duplicate
  private const declarations across MapScreen, GeoJsonConverters, InlineMap,
  NodeTrackMap, TracerouteLayers, and TracerouteMap
- Move node filtering from MapScreen composition into BaseMapViewModel as
  filteredNodes StateFlow (testable, avoids composition-time computation)
- Move waypoint construction from MapScreen's inline onSend callback into
  MapViewModel.createAndSendWaypoint() for testability and separation
- Remove unused compassBearing property from MapViewModel (bearing is read
  directly from cameraState.position.bearing in MapScreen)
- Add nodes parameter to TracerouteMap for short name resolution on hop
  markers (was hardcoded to emptyMap, falling back to hex node nums)
- Add GeoJsonConvertersTest with 25 tests covering nodesToFeatureCollection,
  waypointsToFeatureCollection, positionsToLineString, positionsToPointFeatures,
  precisionBitsToMeters, intToHexColor, and convertIntToEmoji
- Expand BaseMapViewModelTest from 5 to 21 tests covering filter toggles,
  preference persistence, mapFilterState composition, filteredNodes with
  favorites/last-heard/any filters, and getNodeOrFallback
- Expand MapViewModelTest from 9 to 12 tests covering createAndSendWaypoint
  with new/edit/locked/no-position scenarios
2026-04-14 22:30:42 -05:00
James Rich
b81bc2d57d fix(map): fix formatCoord to produce fixed decimal places instead of scientific notation 2026-04-14 22:30:42 -05:00
James Rich
6120ff0eb2 fix(map): address review round 2 — precision circles, traceroute, i18n
- Fix precision circle radius: use zoom-based exponential interpolation
  to convert meters to pixels instead of treating meters as dp values
- Fix InlineMap precision circle: compute pixel radius from meters at
  the fixed zoom-15 display level
- Fix TracerouteLayers: wrap callback in LaunchedEffect to avoid state
  updates during composition; add nodes to remember keys for fresh hop
  labels; use relatedNodeNums.size for accurate total count
- Fix compass bearing: use epsilon comparison (±0.5°) instead of
  exact float equality to prevent flickering near north
- Localize EditWaypointDialog: replace hardcoded English strings with
  stringResource() using existing waypoint_edit/waypoint_new resources
- Format coordinates to 6 decimal places in waypoint position display
2026-04-14 22:30:42 -05:00
James Rich
5cae109ec9 fix(map): address code review findings — precision, naming, icons, i18n
- Fix Int.toFloat() precision loss in track point filter by storing
  time as string in GeoJSON and using string-based equality comparison
- Rename MapStyle enum values to match actual tile styles: Satellite→Light
  (Positron), Hybrid→RoadMap (Americana), with updated string resources
- Reset bearingUpdate to IGNORE when gesture cancels location tracking
- Use LocationOn icon for ALWAYS_NORTH tracking mode instead of
  misleading LocationDisabled
- Remove dead isOfflineManagerAvailable() expect/actual declarations
- Replace hardcoded English strings in offline map UI with
  stringResource() calls backed by core:resources entries
2026-04-14 22:30:42 -05:00
James Rich
7971ec4b9a feat(map): add maplibre-compose API enhancements — scale bar, bearing tracking, gestures, hillshade, offline tiles, map styles
Leverage underused maplibre-compose 0.12.1 APIs to improve UX parity:

- OrnamentOptions: enable built-in scale bar on all map screens
- GestureOptions: per-screen gesture control (Standard, PositionLocked,
  RotationLocked, ZoomOnly) based on tracking state
- BearingUpdate 3-state cycling: Off → Track+Bearing → Track+North → Off
  with CameraMoveReason.GESTURE auto-cancel
- Offline tile downloads: expect/actual OfflineManagerFactory with
  Android/iOS actuals using rememberOfflineManager + OfflinePackListItem
- HillshadeLayer + RasterDemSource: terrain visualization with free AWS
  Terrarium tiles when Terrain style is selected
- Map loading callbacks: onMapLoadFinished/onMapLoadFailed propagated
- Map styles: all 5 styles now use distinct URIs (Liberty, Positron,
  Bright, Americana, Fiord)
- NodeTrackLayers: fix selected highlight filter expression
- LocationProviderFactory: check permissions before calling
  rememberDefaultLocationProvider to prevent PermissionException
2026-04-14 22:30:42 -05:00
James Rich
2aab65bd1b feat(map): add feature parity — filters, style selector, waypoint dialog, cluster zoom, bounds fitting, location tracking
Wire remaining map feature gaps identified in the parity audit:

- MapFilterDropdown: favorites, waypoints, precision circle toggles and
  last-heard slider matching the old Google/OSMDroid filter UIs
- MapStyleSelector: dropdown with 5 predefined MapStyle entries
- EditWaypointDialog: create, edit, delete waypoints via long-press or
  marker tap, with icon picker and lock toggle
- Cluster zoom-to-expand: tap a cluster circle to zoom +2 levels
  centered on the cluster position
- Bounds fitting: NodeTrackMap and TracerouteMap compute a BoundingBox
  from all positions and animate the camera to fit on first load
- Location tracking: expect/actual rememberLocationProviderOrNull()
  bridges platform GPS into maplibre-compose LocationPuck with
  LocationTrackingEffect for auto-pan and bearing follow
- Per-node marker colors via data-driven convertToColor() expressions
- Waypoint camera animation on deep-link selection
- Compass click resets bearing to north
2026-04-14 22:30:42 -05:00
James Rich
598cae564e feat(map): replace Google Maps + OSMDroid with unified MapLibre Compose Multiplatform
Replace the dual flavor-specific map implementations (Google Maps for google,
OSMDroid for fdroid) with a single MapLibre Compose Multiplatform implementation
in feature:map/commonMain, eliminating ~8,500 lines of duplicated code.

Key changes:
- Add maplibre-compose v0.12.1 dependency (KMP: Android, Desktop, iOS)
- Create unified MapViewModel with camera persistence via MapCameraPrefs
- Create MapScreen, MaplibreMapContent, NodeTrackLayers, TracerouteLayers,
  InlineMap, NodeTrackMap, TracerouteMap, NodeMapScreen in commonMain
- Create MapStyle enum with predefined OpenFreeMap tile styles
- Create GeoJsonConverters for Node/Waypoint/Position to GeoJSON
- Move TracerouteMapScreen from feature:node/androidMain to commonMain
- Wire navigation to use direct imports instead of CompositionLocal providers
- Delete 61 flavor-specific map files (google + fdroid source sets)
- Remove 8 CompositionLocal map providers from core:ui
- Remove SharedMapViewModel (replaced by new MapViewModel)
- Remove dead google-maps and osmdroid entries from version catalog
- Add MapViewModelTest with 10 test cases in commonTest

Baseline verified: spotlessCheck, detekt, assembleGoogleDebug, allTests all pass.
2026-04-14 22:30:27 -05:00
James Rich
e46a8296cb
feat(core/ui): add safeLaunch, UiState, KMP permissions, and CMP lifecycle modernization (#5118) 2026-04-14 00:45:34 +00:00
James Rich
938a951737
refactor: leverage CMP 1.11 + Lifecycle 2.11 — v2 test API, Json privacy, dropUnlessResumed nav guards (#5112) 2026-04-13 20:02:31 +00:00
James Rich
a11dee42a7
test: migrate Compose UI tests from androidTest to commonTest (#5091) 2026-04-12 20:20:00 +00:00
James Rich
7ca7179197
build: migrate Compose dependencies to Compose Multiplatform (#5084) 2026-04-12 14:45:11 +00:00
James Rich
3794c79dae
refactor: adopt M3 Expressive components from material3 1.11.0-alpha06 (#5063) 2026-04-11 02:10:03 +00:00
James Rich
520fa717a9
refactor(metrics/map): DRY up charts, decompose MapView monoliths, add test coverage (#5049) 2026-04-10 20:54:09 +00:00
James Rich
02f6fd67b8
fix: clean up flaky, duplicated, and misplaced tests; remove redundant deps (#5048) 2026-04-10 19:46:45 +00:00
James Rich
1390a3cd4f
ci: cache Robolectric SDK jars to prevent flaky SocketException failures (#5045) 2026-04-10 10:05:07 -05:00
James Rich
14b381c1eb
fix: harden reliability, clean up KMP compliance, and improve code quality (#5023) 2026-04-09 18:21:46 +00:00
James Rich
1649e46dd5
chore(deps): remove 7 unused dependencies across modules (#5017) 2026-04-09 12:35:28 -05:00
James Rich
60cc2f4237
fix: resolve bugs across connection, PKI, admin, packet flow, and stability subsystems (#5011) 2026-04-09 13:20:06 +00:00
James Rich
51251ab16a
feat(ci): shard test suite and enable JUnit 5 parallel execution (#4977) 2026-04-03 13:08:49 +00:00
James Rich
464a12b9f7
chore: standardize resources and update documentation for Navigation 3 (#4961) 2026-03-31 21:25:37 +00:00
James Rich
6a5115b897
Refactor navigation to use NodeDetail route and fix radio settings (#4960) 2026-03-31 14:03:02 +00:00
James Rich
a005231d94
Refactor map layer management and navigation infrastructure (#4921)
Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
2026-03-26 00:29:24 +00:00
James Rich
6516287c62
refactor: BLE transport and UI for Kotlin Multiplatform unification (#4911)
Some checks are pending
Dependency Submission / dependency-submission (push) Waiting to run
Main CI (Verify & Build) / validate-and-build (push) Waiting to run
Main Push Changelog / Generate main push changelog (push) Waiting to run
Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
2026-03-25 02:15:51 +00:00
James Rich
96060a0a4d
refactor: coroutine dispatchers and modernize testing infrastructure (#4901)
Some checks are pending
Dependency Submission / dependency-submission (push) Waiting to run
Main CI (Verify & Build) / validate-and-build (push) Waiting to run
Main Push Changelog / Generate main push changelog (push) Waiting to run
Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
2026-03-24 01:31:48 +00:00
James Rich
57242d905c
refactor: Consolidate UI preference handling (#4895) 2026-03-23 19:36:02 +00:00
James Rich
b3b38acc0b
feat: Migrate networking to Ktor and enhance multiplatform support (#4890)
Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
2026-03-23 16:48:10 +00:00
James Rich
c38bfc64de
Refactor command handling, enhance tests, and improve discovery logic (#4878)
Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
2026-03-22 05:42:27 +00:00
James Rich
d136b162a4
feat: Implement iOS support and unify Compose Multiplatform infrastructure (#4876) 2026-03-21 23:19:13 +00:00
James Rich
bc08093f6c
fix(map, settings): allow null IDs and implement request timeout (#4851) 2026-03-19 12:36:14 -05:00
James Rich
06b9f8c77a
feat: Enhance test coverage (#4847)
Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
2026-03-19 03:09:19 +00:00
James Rich
1b0dc75dfe
feat: Complete app module thinning and feature module extraction (#4844) 2026-03-19 00:21:18 +00:00
James Rich
dcbbc0823b
feat: Integrate Mokkery and Turbine into KMP testing framework (#4845) 2026-03-18 18:33:37 -05:00
James Rich
cb95cace25
chore: Scheduled updates (Firmware, Hardware, Translations, Graphs) (#4832) 2026-03-17 16:51:09 -05:00
James Rich
7d63f8b824
feat: build logic (#4829)
Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
2026-03-17 20:35:39 +00:00
James Rich
a10fe61d0f
fix: resolve crashes and debug filter issues in Metrics and MapView (#4824)
Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
2026-03-17 14:04:41 +00:00
James Rich
5edb8abd05
feat: enhance map navigation and waypoint handling (#4814)
Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
2026-03-16 13:48:00 +00:00
James Rich
427c0f3bbb
fix: fix animation stalls and update dependencies for stability (#4784)
Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
2026-03-13 23:01:17 +00:00
James Rich
eb3349fa11
chore: Scheduled updates (Firmware, Hardware, Translations, Graphs) (#4773) 2026-03-12 22:15:20 -05:00
James Rich
ac6bb5479b
feat: introduce Desktop target and expand Kotlin Multiplatform (KMP) architecture (#4761)
Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
2026-03-12 21:14:49 +00:00
James Rich
875cf1cff2
refactor: migrate from Hilt to Koin and expand KMP common modules (#4746)
Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
2026-03-10 01:19:46 +00:00
James Rich
a5390a80e7
chore: Scheduled updates (Firmware, Hardware, Translations, Graphs) (#4739) 2026-03-06 20:59:08 -06:00
James Rich
0ce322a0f5
feat: Migrate project to Kotlin Multiplatform (KMP) architecture (#4738)
Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
2026-03-07 02:43:45 +00:00
James Rich
182ad933f4
chore: Scheduled updates (Firmware, Hardware, Translations, Graphs) (#4737) 2026-03-06 16:39:05 -06:00
James Rich
cffbd08806
refactor: migrate core modules to Kotlin Multiplatform and consolidat… (#4735)
Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
2026-03-06 22:06:50 +00:00
James Rich
b9b68d2779
refactor: migrate preferences to DataStore and decouple core:domain for KMP (#4731) 2026-03-05 20:37:35 -06:00
James Rich
6a858acb4a
refactor: migrate :core:database to Room Kotlin Multiplatform (#4702) 2026-03-03 20:44:34 -06:00
James Rich
c234ace312
fix: ui tweaks (#4696)
Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
2026-03-03 15:37:40 +00:00