mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-09-21 11:15:18 -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>