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 ✓
This commit is contained in:
James Rich
2026-05-07 20:10:02 -05:00
parent 292a35cc49
commit 194c649b8b
39 changed files with 52 additions and 44 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2025-2026 Meshtastic LLC
* Copyright (c) 2026 Meshtastic LLC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2025-2026 Meshtastic LLC
* Copyright (c) 2026 Meshtastic LLC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2025-2026 Meshtastic LLC
* Copyright (c) 2026 Meshtastic LLC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2025-2026 Meshtastic LLC
* Copyright (c) 2026 Meshtastic LLC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2025-2026 Meshtastic LLC
* Copyright (c) 2026 Meshtastic LLC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by

View File

@@ -135,6 +135,7 @@ object DeepLinkRouter {
}
}
@Suppress("MagicNumber", "ReturnCount")
private fun routeSettings(segments: List<String>): List<NavKey> {
var destNum: Int? = null
var subRouteStr: String? = null

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2025-2026 Meshtastic LLC
* Copyright (c) 2026 Meshtastic LLC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2025-2026 Meshtastic LLC
* Copyright (c) 2026 Meshtastic LLC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by

View File

@@ -34,7 +34,7 @@ import org.meshtastic.core.ui.component.PlaceholderScreen
*
* On Desktop/JVM targets where native maps are not yet available, it falls back to a [PlaceholderScreen].
*/
@Suppress("Wrapping")
@Suppress("Wrapping", "CompositionLocalAllowlist")
val LocalDiscoveryMapProvider =
compositionLocalOf<
@Composable (

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2025-2026 Meshtastic LLC
* Copyright (c) 2026 Meshtastic LLC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2025-2026 Meshtastic LLC
* Copyright (c) 2026 Meshtastic LLC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2025-2026 Meshtastic LLC
* Copyright (c) 2026 Meshtastic LLC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2025-2026 Meshtastic LLC
* Copyright (c) 2026 Meshtastic LLC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2025-2026 Meshtastic LLC
* Copyright (c) 2026 Meshtastic LLC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2025-2026 Meshtastic LLC
* Copyright (c) 2026 Meshtastic LLC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2025-2026 Meshtastic LLC
* Copyright (c) 2026 Meshtastic LLC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2025-2026 Meshtastic LLC
* Copyright (c) 2026 Meshtastic LLC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2025-2026 Meshtastic LLC
* Copyright (c) 2026 Meshtastic LLC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2025-2026 Meshtastic LLC
* Copyright (c) 2026 Meshtastic LLC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2025-2026 Meshtastic LLC
* Copyright (c) 2026 Meshtastic LLC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2025-2026 Meshtastic LLC
* Copyright (c) 2026 Meshtastic LLC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2025-2026 Meshtastic LLC
* Copyright (c) 2026 Meshtastic LLC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2025-2026 Meshtastic LLC
* Copyright (c) 2026 Meshtastic LLC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2025-2026 Meshtastic LLC
* Copyright (c) 2026 Meshtastic LLC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2025-2026 Meshtastic LLC
* Copyright (c) 2026 Meshtastic LLC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2025-2026 Meshtastic LLC
* Copyright (c) 2026 Meshtastic LLC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -60,12 +60,14 @@ fun DiscoveryHistoryDetailScreen(
viewModel: DiscoveryHistoryDetailViewModel,
onNavigateUp: () -> Unit,
onNavigateToMap: (Long) -> Unit,
modifier: Modifier = Modifier,
) {
val session by viewModel.session.collectAsStateWithLifecycle()
val presetResults by viewModel.presetResults.collectAsStateWithLifecycle()
val nodesByPreset by viewModel.nodesByPreset.collectAsStateWithLifecycle()
Scaffold(
modifier = modifier,
topBar = {
TopAppBar(
title = { Text(stringResource(Res.string.discovery_session_detail)) },

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2025-2026 Meshtastic LLC
* Copyright (c) 2026 Meshtastic LLC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -75,10 +75,12 @@ fun DiscoveryHistoryScreen(
viewModel: DiscoveryHistoryViewModel,
onNavigateUp: () -> Unit,
onNavigateToDetail: (sessionId: Long) -> Unit,
modifier: Modifier = Modifier,
) {
val sessions by viewModel.sessions.collectAsStateWithLifecycle()
Scaffold(
modifier = modifier,
topBar = {
TopAppBar(
title = { Text(stringResource(Res.string.discovery_history)) },

View File

@@ -48,12 +48,13 @@ import org.meshtastic.feature.discovery.DiscoveryMapViewModel
*/
@OptIn(ExperimentalMaterial3Api::class)
@Composable
fun DiscoveryMapScreen(viewModel: DiscoveryMapViewModel, onNavigateUp: () -> Unit) {
fun DiscoveryMapScreen(viewModel: DiscoveryMapViewModel, onNavigateUp: () -> Unit, modifier: Modifier = Modifier) {
val session by viewModel.session.collectAsStateWithLifecycle()
val allNodes by viewModel.allNodes.collectAsStateWithLifecycle()
val discoveryMap = LocalDiscoveryMapProvider.current
Scaffold(
modifier = modifier,
topBar = {
TopAppBar(
title = { Text(stringResource(Res.string.discovery_map)) },

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2025-2026 Meshtastic LLC
* Copyright (c) 2026 Meshtastic LLC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -88,6 +88,7 @@ fun DiscoveryScanScreen(
onNavigateUp: () -> Unit,
onNavigateToSummary: (sessionId: Long) -> Unit,
onNavigateToHistory: () -> Unit,
modifier: Modifier = Modifier,
) {
val scanState by viewModel.scanState.collectAsStateWithLifecycle()
val selectedPresets by viewModel.selectedPresets.collectAsStateWithLifecycle()
@@ -103,7 +104,7 @@ fun DiscoveryScanScreen(
KeepScreenOn(isScanning && keepScreenAwake)
// Navigate to summary when scan completes
LaunchedEffect(scanState) {
LaunchedEffect(scanState, onNavigateToSummary) {
if (scanState is DiscoveryScanState.Complete) {
currentSession?.id?.let { sessionId ->
viewModel.reset()
@@ -113,6 +114,7 @@ fun DiscoveryScanScreen(
}
Scaffold(
modifier = modifier,
topBar = {
CenterAlignedTopAppBar(
title = { Text(stringResource(Res.string.discovery_local_mesh)) },
@@ -180,7 +182,7 @@ fun DiscoveryScanScreen(
item(key = "dwell_picker") {
DwellTimePicker(
selectedMinutes = dwellMinutes,
onMinutesSelected = viewModel::setDwellDuration,
onMinuteSelect = viewModel::setDwellDuration,
enabled = true,
)
}
@@ -248,7 +250,7 @@ private fun ConnectionWarningCard(modifier: Modifier = Modifier) {
@Composable
private fun DwellTimePicker(
selectedMinutes: Int,
onMinutesSelected: (Int) -> Unit,
onMinuteSelect: (Int) -> Unit,
enabled: Boolean,
modifier: Modifier = Modifier,
) {
@@ -276,7 +278,7 @@ private fun DwellTimePicker(
DropdownMenuItem(
text = { Text("$minutes min") },
onClick = {
onMinutesSelected(minutes)
onMinuteSelect(minutes)
expanded = false
},
)

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2025-2026 Meshtastic LLC
* Copyright (c) 2026 Meshtastic LLC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -120,7 +120,7 @@ fun DiscoverySummaryScreen(
@OptIn(ExperimentalMaterial3Api::class)
@Composable
@Suppress("LongParameterList")
@Suppress("LongParameterList", "LongMethod")
private fun DiscoverySummaryContent(
session: DiscoverySessionEntity?,
presetResults: List<DiscoveryPresetResultEntity>,

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2025-2026 Meshtastic LLC
* Copyright (c) 2026 Meshtastic LLC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2025-2026 Meshtastic LLC
* Copyright (c) 2026 Meshtastic LLC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2025-2026 Meshtastic LLC
* Copyright (c) 2026 Meshtastic LLC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -44,10 +44,10 @@ import org.meshtastic.feature.discovery.ui.formatDuration
fun PresetResultCard(
result: DiscoveryPresetResultEntity,
@Suppress("UnusedParameter") nodes: List<DiscoveredNodeEntity>,
modifier: Modifier = Modifier,
aiSummary: String? = null,
rank: Int? = null,
isTied: Boolean = false,
modifier: Modifier = Modifier,
) {
Card(modifier = modifier.fillMaxWidth()) {
Column(modifier = Modifier.padding(16.dp)) {

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2025-2026 Meshtastic LLC
* Copyright (c) 2026 Meshtastic LLC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2025-2026 Meshtastic LLC
* Copyright (c) 2026 Meshtastic LLC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2025-2026 Meshtastic LLC
* Copyright (c) 2026 Meshtastic LLC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2025-2026 Meshtastic LLC
* Copyright (c) 2026 Meshtastic LLC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2025-2026 Meshtastic LLC
* Copyright (c) 2026 Meshtastic LLC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by

View File

@@ -111,7 +111,7 @@
- [X] **D045** [P] Finalize 2.4 GHz hardware gating using `DeviceHardwareRepository` + current radio metadata.
- [X] **D046** [P] Add logging / diagnostics and make sure the feature is debuggable through existing app logging tools.
- [X] **D047** [P] Add strings, icons, and docs updates (`core/resources`, deep-link docs, quickstart references).
- [ ] **D048** Run targeted and full verification commands.
- [X] **D048** Run targeted and full verification commands.
**Depends on**: all previous phases
**Exit criteria**: feature is shippable, documented, accessible, and validated.