mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-05-12 00:28:20 -04:00
3.5 KiB
3.5 KiB
Quickstart — Node List Layout
Purpose
This guide helps a Meshtastic-Android contributor bootstrap, navigate, test, and debug the Node List Layout feature.
Prerequisites
- JDK 21
- Android SDK installed and
ANDROID_HOMEavailable to Gradle - Git submodule initialized for
core/proto - A working
local.propertiesfile (copy fromsecrets.defaults.propertiesif needed)
Workspace Bootstrap
git submodule update --init
[ -f local.properties ] || cp secrets.defaults.properties local.properties
Feature Access Path
Once implemented, the feature is accessible at:
- Settings UI: Settings > App Settings > Node Layout
- Node List: The Nodes tab renders rows based on the selected density
No new navigation routes or deep links are required.
Key Files
| File | Purpose |
|---|---|
feature/node/src/commonMain/.../model/NodeListDensity.kt |
COMPLETE / COMPACT enum |
feature/node/src/commonMain/.../component/NodeItem.kt |
Complete row composable (existing, refactored) |
feature/node/src/commonMain/.../component/NodeItemCompact.kt |
Compact row composable (new) |
feature/node/src/commonMain/.../component/NodeListHelp.kt |
Help bottom sheet (new) |
feature/node/src/commonMain/.../list/NodeListScreen.kt |
Density-aware list delegation |
feature/node/src/commonMain/.../list/NodeListViewModel.kt |
Exposes density + toggle state |
feature/node/src/commonMain/.../list/NodeFilterPreferences.kt |
Layout preference integration |
core/prefs/src/commonMain/.../ui/UiPrefsImpl.kt |
DataStore preference keys |
feature/settings/src/commonMain/.../NodeLayoutSettings.kt |
Settings section UI (new) |
core/resources/src/commonMain/composeResources/values/strings.xml |
Toggle labels, help text |
Test Commands
Run feature module tests (KMP)
./gradlew :feature:node:allTests
./gradlew :feature:settings:allTests
Run core prefs tests
./gradlew :core:prefs:allTests
Full verification
./gradlew spotlessApply detekt assembleDebug test allTests
Compile-only check (fast)
./gradlew :feature:node:compileKotlinJvm :feature:settings:compileKotlinJvm
Development Workflow
- Start with preferences — add DataStore keys in
UiPrefsImpl.ktand verify defaults with a unit test. - Build the compact composable — create
NodeItemCompact.ktwith hardcoded toggles first, then wire to DataStore. - Wire the list — modify
NodeListScreen.ktto switch betweenNodeItemandNodeItemCompact. - Build settings UI — create
NodeLayoutSettings.ktwith the picker, toggles, and live preview. - Add the help sheet — create
NodeListHelp.ktwith signal strength documentation. - Test — run
allTestsfor bothfeature:nodeandfeature:settings.
Debugging Tips
- Toggle not persisting: Check that the DataStore key string matches
NodeListLayoutPreferencesenum value exactly. - Chip size wrong: Verify
lineCountderivation — it counts toggle state, not data presence. - Live preview empty: The preview requires at least one node in the Room database. Connect to a radio or use test fixtures.
- LazyColumn jank: Ensure stable
keyparameters are set onLazyColumnitems. Profile with Layout Inspector if needed.
Logging
This feature does not require custom logging beyond standard Compose recomposition debugging. Use Android Studio Layout Inspector to diagnose rendering issues.