mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-09-21 19:25:10 -04:00
feature:settings is the largest of this effort's four v0 feature
modules (all now wasmJs-enabled) and the only one requiring a real
architectural decision, not a mechanical port: two commonMain files
(TAKConfigItemList.kt, defining TAKConfigScreen/TakServerScreen, and
TAKConfigPreviews.kt) directly use core:takserver's TAKServerManager/
TAKMeshIntegration/TAKDataPackageGenerator/TakMeshTestRunner/
TakProtocol/TakTestResult types. core:takserver can never get a wasmJs
target -- its production implementation binds an inbound TLS
SSLServerSocket listener, which a browser sandbox can never accept --
so this module now excludes TAK the same way core:service's
MeshServiceOrchestrator already does (TakServerIntegration/
NoopTakServerIntegration, commit c3d19fb82).
A new expect val isTakSupportedOnPlatform (tak/TakAvailability.kt,
true everywhere except wasmJs) gates TAK at three sites:
ModuleRoute.TAK.isSupported, the "TAK Server" menu item in
RadioConfig.kt, and -- a real gap found during this pass, not flagged
by any grep -- the hiddenFeaturesUnlocked easter-egg branch in
ModuleConfigurationScreen.kt, which rendered raw unfiltered
ModuleRoute.entries and bypassed the gate entirely. Two further
expect/actual seams (TakModuleConfigContent, registerTakServerDestination)
handle the navigation graph itself: real on android/jvm/iOS (wiring
the unchanged TAKConfigScreen/TakServerScreen), an honest empty
composable / no-registration on wasmJs -- a defensive fallback for a
direct deep link, since the menu gate above is the primary but not
only way to reach these destinations. TAKConfigItemList.kt,
TAKConfigPreviews.kt, TakPermissionUtil.kt, and PrefExporter.kt move
to nonWebMain wholesale.
Seven other expect/actual pairs get real wasmJs implementations:
rememberSystemTimeZonePosixString (real Intl/Date JS interop, not a
hardcoded fallback), SecurityKeyBackupActions/RingtoneTrailingIcon/
DeviceLocationButton (honest no-ops matching existing iOS/JVM
precedent -- no browser equivalent for Android-specific concepts),
rememberLogExporter/captureAppLogcat (no-ops, consistent with
core:ui's already-deferred file-save capability on web),
getAboutLibrariesJson (empty string -- the library itself ships a
real wasmJs variant, but wiring its JSON asset through Compose
resources wasn't done this pass), and SettingsMainScreen (reuses
DesktopSettingsScreen.kt after confirming it was already pure Compose
Multiplatform with no jvm-only imports -- relocated from jvmMain to
commonMain rather than duplicated; web and desktop share the same
wide-surface layout, unlike Android's phone-shaped one).
meshtastic.kmp.jvm.android is removed from this module's plugins
block (its own applyHierarchyTemplate call would conflict with this
module's -- Gradle allows exactly one per project) and replaced with
an inlined jvmAndroid group nested inside nonWeb, mirroring
core:network's identical precedent. 8 of the module's commonTest
files (importing core:testing, which has no wasmJs target) move to
nonWebTest.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
:feature:settings
Overview
The :feature:settings module manages all application and radio-side configurations. This includes user preferences, channel configuration, and advanced radio settings.
Key Components
1. SettingsScreen
The main entry point for application-wide settings.
2. RadioConfigViewModel
Handles the complex logic of reading and writing configuration to the Meshtastic device over the radio link (BLE, USB, or TCP).
3. AboutScreen
Displays what Meshtastic is, a "Need Hardware?" row, version information, and project links.
4. AcknowledgementsScreen
Displays the open-source libraries the app is built on, with their licenses.
Validation Reference
- See settings-validation.md for detailed radio/module settings validation rules used by this module.
Features
- Channel Configuration: Manage encryption keys, channel names, and radio frequency settings.
- Node Database Management: Options to clear or prune the local and remote node databases.
- App Preferences: Theme selection, unit system (metric/imperial), and notification settings.
Dependency Graph
graph TB
:feature:settings[settings]:::kmp-feature
:feature:settings -.-> :core:barcode
:feature:settings -.-> :core:nfc
:feature:settings -.-> :core:common
:feature:settings -.-> :core:data
:feature:settings -.-> :core:database
:feature:settings -.-> :core:datastore
:feature:settings -.-> :core:domain
:feature:settings -.-> :core:model
:feature:settings -.-> :core:navigation
:feature:settings -.-> :core:network
:feature:settings -.-> :core:repository
:feature:settings -.-> :core:service
:feature:settings -.-> :core:resources
:feature:settings -.-> :core:ui
:feature:settings -.-> :core:di
:feature:settings -.-> :core:takserver
:feature:settings -.-> :core:testing
classDef android-application fill:#CAFFBF,stroke:#000,stroke-width:2px,color:#000;
classDef android-application-compose fill:#CAFFBF,stroke:#000,stroke-width:2px,color:#000;
classDef compose-desktop-application fill:#CAFFBF,stroke:#000,stroke-width:2px,color:#000;
classDef android-feature fill:#FFD6A5,stroke:#000,stroke-width:2px,color:#000;
classDef android-library fill:#9BF6FF,stroke:#000,stroke-width:2px,color:#000;
classDef android-library-compose fill:#9BF6FF,stroke:#000,stroke-width:2px,color:#000;
classDef android-test fill:#A0C4FF,stroke:#000,stroke-width:2px,color:#000;
classDef jvm-library fill:#BDB2FF,stroke:#000,stroke-width:2px,color:#000;
classDef kmp-feature fill:#FFD6A5,stroke:#000,stroke-width:2px,color:#000;
classDef kmp-library-compose fill:#FFC1CC,stroke:#000,stroke-width:2px,color:#000;
classDef kmp-library fill:#FFC1CC,stroke:#000,stroke-width:2px,color:#000;
classDef unknown fill:#FFADAD,stroke:#000,stroke-width:2px,color:#000;