Commit Graph

6821 Commits

Author SHA1 Message Date
James Rich 1edc6de63f fix: resolve CI failures — missing drawables, spotless, and test native lib
- Add ic_thermostat.xml and ic_person.xml to fdroid res/drawable for
  osmdroid marker icons (moved to compose resources on main)
- Fix spotless formatting in DeepLinkRouterTest
- Add sqlite-bundled-jvm runtimeOnly to core:database androidHostTest
  so BundledSQLiteDriver can load on the host JVM

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-05-31 10:19:13 -05:00
James Rich bcd8f7fef5 fix: resolve compilation errors from rebase onto main
- Move discovery map files from orphaned app/ to androidApp/ flavors
- Remove duplicate @Suppress annotation in MainActivity
- Fix DeepLinkRouterTest: SettingsGraph -> Settings (renamed on main)
- Fix MeshDataHandlerTest: add missing collectorRegistry parameter
- Remove BundledSQLiteDriver from production DatabaseBuilder (API 26+
  framework SQLite supports FTS5 natively)
- Delete orphaned app/ directory (module renamed to androidApp/)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-05-31 09:44:35 -05:00
James Rich e52244e2d1 fix: align proto submodule with main (a0a2239)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-05-31 09:16:27 -05:00
James Rich 33bd3434d7 fix(database): use BundledSQLiteDriver for consistent test behavior
- Use BundledSQLiteDriver in DatabaseBuilder for deterministic SQLite
  behavior across test environments
- Simplify DiscoveryMigrationTest to use context-free inMemoryDatabaseBuilder
  with BundledSQLiteDriver (removes ApplicationProvider dependency)
- Update migration doc comment to reflect version 39→40 path

Found during release/2.8.0 integration testing.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-05-31 09:10:09 -05:00
James Rich 4c60e5dc9b fix(navigation): correct SettingsGraph → Settings route reference post-rebase
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-05-31 09:10:09 -05:00
James Rich 600abad46f feat(discovery): wire 2.4 GHz gating and export file-save, update spec
Critical spec gaps resolved:
- Wire Check24GhzCapability into DiscoveryViewModel; expose is24GhzBlocked
  and isLora24Region states; scan button disabled when on LORA_24 region
  with unsupported hardware
- Implement rememberExportSaver expect/actual composable:
  Android uses SAF ACTION_CREATE_DOCUMENT, Desktop uses JFileChooser,
  iOS stub logs warning. Summary screen now saves export result to disk.
- Add discovery_start_scan_reason_24ghz_unsupported string resource

Spec updates:
- Mark US5 (2.4 GHz gating) and Export as complete
- Document 8 features implemented beyond original spec
- Add remaining map UI gaps to Known Divergences table
- Update design repo status

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-05-31 09:10:09 -05:00
James Rich dcd0a881cd feat(discovery): add Apple parity fixes - infrastructure tracking, session recovery, default key guard
- Track infrastructure nodes (ROUTER, ROUTER_LATE, CLIENT_BASE roles)
  in DiscoveredNodeEntity and DiscoveryPresetResultEntity
- Add markInterruptedSessions() DAO query for cold-start recovery
- Add usesDefaultKey StateFlow to DiscoveryViewModel that checks
  primary channel PSK and disables scan when using default/cleartext key
- Wire default key guard into ScanButton with accessibility description
- Add discovery_start_scan_reason_default_key string resource
- Update all test DAO fakes with KMP-compatible implementations

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-05-31 09:10:09 -05:00
James Rich 4db6184e69 fix(discovery): address design standards audit findings
- Use locale-aware DateFormatter.formatDateTimeShort() instead of
  hardcoded YYYY-MM-DD HH:mm format in history screen
- Filter deprecated presets (VERY_LONG_SLOW, LONG_SLOW) from picker
- Add minimum packet threshold (5) for traffic mix classification
  to avoid noise from trivial counts
- Add LITE_FAST, LITE_SLOW, NARROW_FAST, NARROW_SLOW entries to
  LoRaPresetReference for 2.4 GHz preset AI prompt enrichment
- Add lowTrafficCountsNoMixNote test case

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-05-31 09:10:09 -05:00
James Rich 6e94a87c85 test(discovery): add comprehensive DiscoverySummaryGenerator tests
Add 31 tests covering:
- generateSessionSummary: empty presets, single/multi preset, ranking,
  congestion detection, traffic mix, completion status, recommendations
- generatePresetSummary: node counts, channel util, congestion marking,
  traffic dominance, known preset data rate inclusion
- buildSessionPrompt: instructions, session metadata, preset data,
  channel utilization, congestion guidance
- buildPresetPrompt: preset name, metrics, guidance context

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-05-31 09:10:09 -05:00
James Rich a05fc32e3d feat(discovery): wire Gemini Nano via ML Kit GenAI Prompt API
Replace the stub GeminiNanoSummaryProvider with a real implementation
that uses com.google.mlkit:genai-prompt:1.0.0-beta2 for on-device
AI-powered scan summaries on supported Android hardware.

Implementation:
- Generation.getClient() to obtain the GenerativeModel
- generateContentRequest with TextPart for structured prompts
- Temperature 0.3, topK 16, maxOutputTokens 200 for concise output
- Graceful fallback to DiscoverySummaryGenerator on any failure
- Lazy model initialization with error logging via Kermit

The existing buildSessionPrompt() and buildPresetPrompt() methods in
DiscoverySummaryGenerator provide the prompt text. On unsupported
devices or fdroid builds, the provider falls through to the
deterministic algorithmic summary seamlessly.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-05-31 09:10:09 -05:00
James Rich 74285d7325 docs(spec): update discovery spec to reflect implementation state
- Update status from 'Not Started' to 'Implementation Complete'
- Add Implementation Status section documenting per-user-story completion
- Add data model divergences (simplified schema, RF health fields, neighborType)
- Add Cross-Platform Alignment section comparing with meshtastic-apple
- Document intentional differences (2-level state machine, production nav location)
- Document known divergences and their priority (radar sweep, icon classification)
- Reference design repo audit confirmation (50/51 tasks, D048 remaining)
- Add implementation note to data-model.md about actual vs proposed schema

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-05-31 09:10:09 -05:00
James Rich f917d0a826 feat(discovery): extract hardcoded UI strings to resources
Replace all hardcoded strings in discovery UI screens and components
with stringResource() calls using centralized string resources.

Files updated:
- DiscoverySummaryScreen: session stats, AI analysis labels
- DiscoveryHistoryDetailScreen: history metadata labels
- DiscoveryScanScreen: disabled button semantics descriptions
- PresetPickerCard: selected/unselected state descriptions
- PresetResultCard: scan result stat labels
- RfHealthSection: RF health stat labels
- DwellProgressIndicator: dwell progress text

Added 33 new discovery_stat_* and discovery_* string resources.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-05-31 09:10:09 -05:00
James Rich 5493a587ed fix(discovery): unregister packet collector on success, use string resources in settings
- Fix resource leak: collectorRegistry.collector was never cleared in
  the successful scan completion path (only in stop/abort paths)
- Replace hardcoded 'Local Mesh Discovery' strings in both Settings
  screens with stringResource(Res.string.discovery_local_mesh)
- Add missing explicit imports for the CMP string accessor
- Remove redundant .gitkeep files from directories with content

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-05-31 09:10:09 -05:00
James Rich bc9de0ac84 [Spec Kit] Implementation progress: D044 accessibility polish
- Added semantics annotations for screen readers
- Added progress announcements for dwell indicator
- Added disabled-preset explanations
- Migrated string resources to strings.xml
- Added DiscoveryMigrationTest for string resource migration
- Marked D000, D011, D044 as complete in tasks.md
2026-05-31 09:09:36 -05:00
James Rich 10da02f84c fix(discovery): resolve all detekt and lint issues across discovery modules (D048)
- Fix copyright headers (2025-2026 → 2026) in ~30 files across feature/discovery, core/database, core/repository, core/data, core/prefs
- Fix detekt compose issues: add modifier params to all public composable functions, fix parameter ordering in PresetResultCard, rename onMinutesSelected → onMinuteSelect (past tense), suppress LongMethod for DiscoverySummaryContent
- Fix detekt suppressions: CompositionLocalAllowlist in LocalDiscoveryMapProvider, MagicNumber/ReturnCount in DeepLinkRouter.routeSettings
- Mark D048 complete in tasks.md
All verification passes: spotlessCheck ✓, detekt ✓, tests ✓, kmpSmokeCompile ✓
2026-05-31 09:09:36 -05:00
James Rich 832832055e feat(discovery): replace hardcoded UI strings with string resources (D047) 2026-05-31 09:09:36 -05:00
James Rich bd204ab525 test(discovery): add map preset filter and topology toggle tests (D028) 2026-05-31 09:09:36 -05:00
James Rich 95430ec688 feat(discovery): add neighbor info requests at dwell boundaries and map filter state (D020, D024, D032) 2026-05-31 09:09:36 -05:00
James Rich 7d9290aaeb test(discovery): add DAO, packet collection, history, and deep-link tests (D010, D023, D042) 2026-05-31 09:09:36 -05:00
James Rich 5afffba1b0 feat(discovery): add 2.4 GHz hardware gating and AI provider tests (D045, D037) 2026-05-31 09:09:36 -05:00
James Rich 7c78b41a7c docs(discovery): mark D012 complete 2026-05-31 09:09:36 -05:00
James Rich 9cd89ab562 feat(discovery): add DiscoveryPrefs for persistent user defaults (D012)
Add DataStore-backed preferences for discovery scan settings:
- dwellMinutes: persisted dwell time per preset (default 15)
- selectedPresets: last-used preset selection (restored on reopen)
- aiEnabled: whether AI summary expansion is enabled
- topologyOverlayEnabled: map topology overlay default
Architecture:
- Interface: DiscoveryPrefs in core:repository/AppPreferences.kt
- Implementation: DiscoveryPrefsImpl in core:prefs (reuses UiDataStore)
- Fake: FakeDiscoveryPrefs in core:testing
- Wiring: DiscoveryViewModel restores prefs on init, persists on change
Validated: spotlessApply, allTests, compileKotlinJvm
2026-05-31 09:09:36 -05:00
James Rich 25e1bdf5b9 docs(discovery): mark D030 complete in tasks.md 2026-05-31 09:09:35 -05:00
James Rich f7879c5bbb feat(discovery): wire DiscoveryRankingEngine into summary UI (D030)
- Add rankings StateFlow to DiscoverySummaryViewModel
- Compute rankings from PresetRankingInput on loadNodes and rerunAnalysis
- Pass rank/isTied to PresetResultCard for display
- Show rank badge (#1, #2, tied) in preset header
- Rank 1 (untied) highlighted in primary color
Validated: spotlessApply, allTests, compileKotlinJvm
2026-05-31 09:09:35 -05:00
James Rich c21ed4fc63 docs(discovery): update tasks.md to reflect actual implementation status
Mark 30 of 49 tasks as complete based on code review of the
feat/discovery branch. Key phases completed: setup (P1), data model
(P2 partial), scan engine (P3), packet collection (P4 partial),
map (P5 partial), summary (P6 partial), AI (P7 partial), history (P8).
Remaining: D010-D011 (DAO/migration tests), D012 (prefs), D020
(neighbor info trigger), D023-D024 (tests + map filter), D028
(map UI tests), D030/D032 (summary models + tests), D037 (AI tests),
D042 (history tests), D044-D045/D047-D048 (polish).
2026-05-31 09:09:35 -05:00
James Rich a91b462af3 feat(discovery): add DiscoveryRankingEngine with 6-level deterministic heuristic (D029)
Implement the spec's ranking and recommendation heuristic:
1. Highest unique discovered node count
2. Highest neighbor-report diversity (direct + mesh)
3. Highest non-duplicate packet count
4. Best median link quality (SNR first, then RSSI)
5. Greatest best known distance
6. Lowest failure/reconnect penalty
Presets tied after all 6 criteria share the same rank with isTied=true.
Includes RankingScoreBreakdown for transparent per-criterion scoring.
11 unit tests covering each criterion as tiebreaker, full ties,
edge cases (empty/single preset, no nodes, failed presets).
Validated: spotlessApply, allTests, kmpSmokeCompile
2026-05-31 09:09:35 -05:00
James Rich 2c1d4cdc10 feat(discovery): align state machine with spec, add deep links, fix tests
- Add Preparing, Cancelling, Failed states to DiscoveryScanState (FR-008)
- Change Complete to data class with CompletionOutcome enum
- Add local-mesh-discovery deep link routes to DeepLinkRouter (FR-031)
- Compute packetSuccessRate/packetFailureRate in scan engine (FR-012)
- Fix DiscoveryScanEngineTest compilation and restructure with shared scheduler
- All 8 tests pass, kmpSmokeCompile clean
2026-05-31 09:09:35 -05:00
James Rich 35286d84a8 refactor(discovery): reorder imports for clarity and consistency 2026-05-31 09:09:35 -05:00
James Rich 70ba022c7b refactor(discovery): improve KMP compatibility and clean up icon imports
- Replace platform-specific `String.format` with Kotlin standard library `padStart` in `DwellProgressIndicator` to support common code.
- Simplify fully qualified icon references in `DiscoveryGoogleMap` by adding explicit imports.
2026-05-31 09:09:35 -05:00
James Rich 052bb0521d feat(discovery): improve scan metrics, node enrichment, and configuration restoration
- Implement distance tracking using `latLongToMeter` and a new `getMaxDistance` DAO query
- Calculate Airtime Rate as a delta over time to align with telemetry specifications
- Capture and restore the full `LoRaConfig` instead of just the modem preset after a scan
- Persist local radio statistics (Tx/Rx counts, uptime, relay stats) in preset results
- Backfill missing node names and positions from the local NodeDB during discovery
- Refactor `DiscoveryScanEngine` to use injected `CoroutineDispatchers` and `ApplicationCoroutineScope`
- Reduce BLE connection priority request delay in `BleRadioTransport` to 1 second
- Improve test reliability by replacing fixed `Thread.sleep` calls with state-based polling and `delay`
2026-05-31 09:09:35 -05:00
James Rich 2652c5bdb5 Add Local Mesh Discovery feature
* Introduce a new `:feature:discovery` module for scanning mesh topology across multiple LoRa presets
* Add `DiscoveryScanEngine` to manage scan lifecycles, preset shifting, and packet collection
* Update database schema to version 39 with tables for discovery sessions, preset results, and discovered nodes
* Implement UI screens for scan configuration, real-time progress, and historical session management
* Add flavor-specific discovery maps (Google Maps and OSM) for visualizing node positions and topology
* Include algorithmic and AI-powered summary generation for analyzing LoRa preset performance
* Add report export functionality for Text and PDF formats
* Integrate discovery entry point into the settings screen and navigation graphs
2026-05-31 09:09:09 -05:00
github-actions[bot] bc9f163708 docs: update CHANGELOG.md (#5681) 2026-05-31 08:07:17 -05:00
renovate[bot] 93faeabbc6 chore(deps): update vico to v3.2.0-next.6 (#5683) 2026-05-31 08:06:50 -05:00
James Rich ba163c40a9 chore: Scheduled updates (Firmware, Hardware, Translations, Graphs) (#5682)
Co-authored-by: github-merge-queue <118344674+github-merge-queue@users.noreply.github.com>
2026-05-31 07:38:20 -05:00
James Rich c82a88b21b fix(ci): make JBR setup-java resilient to GitHub API rate limits (#5680)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
v2.7.14-internal.111 v2.7.14-closed.33 v2.7.14-open.15
2026-05-30 20:47:56 -05:00
github-actions[bot] 4a6b0df54e docs: update CHANGELOG.md (#5679) 2026-05-30 20:29:24 -05:00
James Rich fac4164994 chore: Scheduled updates (Firmware, Hardware, Translations, Graphs) (#5678)
Co-authored-by: github-merge-queue <118344674+github-merge-queue@users.noreply.github.com>
2026-05-30 20:19:26 -05:00
github-actions[bot] 43c0252835 docs: update CHANGELOG.md (#5674) 2026-05-30 19:43:45 -05:00
renovate[bot] dee5c3d0dc chore(deps): update core/proto/src/main/proto digest to a0a2239 (#5676)
Co-authored-by: James Rich <james.a.rich@gmail.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-05-30 14:42:45 -05:00
James Rich e48c394fd2 Rename Desktop application to 'Meshtastic Desktop' (#5677)
Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
2026-05-30 19:17:43 +00:00
James Rich 5c0fe4e845 fix(flatpak): source desktop metadata from in-repo packaging dir (#5673)
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-05-30 11:29:53 -05:00
github-actions[bot] 47b62b1300 docs: update CHANGELOG.md (#5669) 2026-05-30 10:12:44 -05:00
James Rich c7fbc6e9d3 fix: address top Crashlytics crashes in beta 2.7.14 (#5672)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-05-30 15:01:29 +00:00
Ben Meadors ad6144189f fix(takserver): drop CoT the mesh delivers more than once (#5667)
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: James Rich <james.a.rich@gmail.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-05-30 14:05:42 +00:00
James Rich ce01743118 chore: Scheduled updates (Firmware, Hardware, Translations, Graphs) (#5668)
Co-authored-by: github-merge-queue <118344674+github-merge-queue@users.noreply.github.com>
2026-05-30 13:37:11 +00:00
James Rich 6b440e57e6 repo: Delete symlink
Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
2026-05-29 20:18:35 -05:00
github-actions[bot] b847c15321 docs: update CHANGELOG.md (#5666) 2026-05-29 16:51:15 -05:00
James Rich df2c7a00bd fix(ci): use fastlane supply for Play promotion with changesNotSentForReview (#5665)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-05-29 16:45:38 -05:00
github-actions[bot] f2ac9ef10f docs: update CHANGELOG.md (#5664) v2.7.14-open.14 v2.7.14-closed.32 v2.7.14-internal.110 2026-05-29 15:44:48 -05:00
James Rich 8ec0f65b69 chore: Scheduled updates (Firmware, Hardware, Translations, Graphs) (#5660) 2026-05-29 15:43:27 -05:00