feat(settings): Settings screen MVP — theme, ADB override, hosting & polling defaults#34
Merged
Conversation
…, hosting & polling defaults Replaces the Dashboard fallback that was wired to Screen.Settings. Settings persist to ~/.linkops/settings.json with the same Mutex + Dispatchers.IO pattern as favorites. Sections: - Appearance: Light / Dark / System, applied instantly via LinkOpsTheme(darkTheme = ...) - ADB: optional override path; AdbBinaryManager prefers it over the system PATH and falls back gracefully if the file isn't executable - Local Hosting defaults: default host/port seeded into LocalHostingViewModel on open - Device detection: polling interval read on every DeviceRepositoryImpl tick so a change takes effect on the next iteration without an app restart Form behavior: - Theme writes through immediately (visual feedback is the confirmation) - Text fields stay local until Save; port and polling inputs are validated against their declared ranges before the Save button enables - Discard reverts the draft to the persisted value Part of #33. README/Compose deprecated cleanup left for follow-up commits.
README: - Features section now reflects every screen actually shipped (Verification Deep Dive, Local Hosting, Intent Sniffer, Topology Map, Scheme Collision, Batch Test, Logcat Streaming, QR, Favorites, Settings, keyboard shortcuts) - Roadmap split into Done / Next / Later. Next items link to follow-up issues (#29 tunnel, #30 iOS, #31 CLI, #32 APK) - Tech stack and project structure updated; Compose hot-reload command added Compose deprecated migration (11 sites): - Modifier.menuAnchor() -> .menuAnchor(ExposedDropdownMenuAnchorType.PrimaryNotEditable) All call sites were read-only OutlinedTextField inside ExposedDropdownMenuBox - TabRow(...) -> PrimaryTabRow(...) (Diagnostics, Manifest, Sniffer) - Icons.Default.Send -> Icons.AutoMirrored.Filled.Send Remaining warnings deferred (different scope): - AdbBinaryManager URL(String) constructor — Java's URL deprecation, network layer change; touching it risks breaking ADB auto-download - QrCodeDialog LocalClipboardManager — Compose's new LocalClipboard API is suspend-based; converting requires reworking the copy flow with a coroutine scope. Will track separately if it actually breaks in a future Compose release. Completes #33.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes part of #33.
Summary
Implements the Settings screen MVP, replacing the previous Dashboard fallback wired to
Screen.Settings. README cleanup and Composedeprecatedmigration from #33 are split out to follow-up commits/PRs to keep this PR focused.What's in this PR
Settings infrastructure
domain/model/AppSettings.kt— settings shape with safe defaults and range constantsdomain/repository/SettingsRepository.kt— observe + atomic update API; exposes a synchronouscurrentsnapshot for callers likeAdbBinaryManagerthat can't suspenddata/repository/SettingsRepositoryImpl.kt— JSON-on-disk at~/.linkops/settings.json. MirrorsFavoriteRepositoryImpl's safety model (Mutex + Dispatchers.IO + a DTO separate from the domain model + value clamping on read so a corrupt file can't propagate bad numbers)domain/usecase/settings/{Observe,Update}SettingsUseCase.kt— thin pass-throughs to keep DI/conventions consistent with the rest of the projectSettings screen
ui/screen/settings/SettingsViewModel.kt— form-local state withdraftvspersistedseparation so text fields don't write per-keystroke; explicit dirty/valid/canSave flagsui/screen/settings/SettingsScreen.kt— fourOutlinedCardsections built from Material3:SingleChoiceSegmentedButtonRow, persists instantly)Wiring
di/AppContainer.kt— repository + use cases registeredApp.kt—Screen.Settingsnow routes toSettingsScreen;LinkOpsTheme(darkTheme = ...)consumes the persisted theme preference so changes apply instantlyinfrastructure/adb/AdbBinaryManager.kt— checkssettings.adbPathOverridefirst; falls back gracefully if the file isn't executabledata/repository/DeviceRepositoryImpl.kt— polling delay re-read on every tick, so a settings change takes effect on the next iteration without restartui/screen/localhosting/LocalHostingViewModel.kt— seeds host/port from settings on open; edits stay local (don't push back to settings)Test plan
./gradlew :composeApp:compileKotlinJvm→ BUILD SUCCESSFUL./gradlew :composeApp:jvmTest→ all greenNot in this PR (follow-up for #33)
menuAnchor,TabRow,Icons.Filled.Send,LocalClipboardManager)