0b72827682
Two regressions surfaced on the first real device run.
1. Contrast on ServerUrl + Login screens: both wrapped content in a
bare Box(fillMaxSize), no Surface. The obsidian background never
painted (rendered against the system root view's default),
LocalContentColor cascade fell through to Material's default
contentColor — the screens rendered as near-invisible dark text
on dark grey. Wrap both in Surface(color = background, contentColor
= onBackground) so the bg paints AND the M3 contentColor pipeline
flows correctly through OutlinedTextField labels / cursor /
placeholders + the Button content tint.
2. The bigger bug: NetworkModule.provideRetrofit read
authStore.baseUrl.value ONCE at Retrofit creation. AuthStore loads
from Room async, so at injection time the value was still the
localhost:8080 placeholder. Result: even after the user typed
their real server URL on the ServerUrl screen, every API call
kept hitting localhost:8080 ("Failed to connect to
localhost/127.0.0.1:8080" on the login attempt). The pre-fix
NetworkModule comment even acknowledged it — *"Server-URL
changes require an app relaunch"*.
Fix: per-request rewrite. New BaseUrlInterceptor reads the live
AuthStore.baseUrl.value on every request and rewrites
scheme/host/port of the outgoing URL. Retrofit now keeps a
placeholder baseUrl ("http://placeholder.invalid/") solely to
satisfy its parser; the actual target host is dynamic. Order in
OkHttp chain: BaseUrl first → Auth → logging, so the cookie
interceptor sees the final URL.
New:
- api/BaseUrlInterceptor.kt — per-request scheme/host/port rewrite
from AuthStore.baseUrl. Falls through to the original request
when the stored URL is unparseable.
Modified:
- api/NetworkModule.kt — adds BaseUrlInterceptor to the OkHttp
chain. Drops the AuthStore dependency from provideRetrofit;
swaps baseUrl for the placeholder.
- auth/ui/ServerUrlScreen.kt — Box → Surface wrap.
- auth/ui/LoginScreen.kt — Box → Surface wrap.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 line
1.9 KiB
Plaintext
1 line
1.9 KiB
Plaintext
[{"key":"androidx/lifecycle/EmptyActivityLifecycleCallbacks.class","name":"androidx/lifecycle/EmptyActivityLifecycleCallbacks.class","size":2179,"crc":829392209},{"key":"androidx/lifecycle/LifecycleDispatcher$DispatcherActivityCallback.class","name":"androidx/lifecycle/LifecycleDispatcher$DispatcherActivityCallback.class","size":1661,"crc":-1914228090},{"key":"androidx/lifecycle/LifecycleDispatcher.class","name":"androidx/lifecycle/LifecycleDispatcher.class","size":1974,"crc":1983745080},{"key":"androidx/lifecycle/ProcessLifecycleInitializer.class","name":"androidx/lifecycle/ProcessLifecycleInitializer.class","size":3102,"crc":-343730275},{"key":"androidx/lifecycle/ProcessLifecycleOwner$Api29Impl.class","name":"androidx/lifecycle/ProcessLifecycleOwner$Api29Impl.class","size":1695,"crc":-392867632},{"key":"androidx/lifecycle/ProcessLifecycleOwner$Companion.class","name":"androidx/lifecycle/ProcessLifecycleOwner$Companion.class","size":2037,"crc":-2054341960},{"key":"androidx/lifecycle/ProcessLifecycleOwner$attach$1$onActivityPreCreated$1.class","name":"androidx/lifecycle/ProcessLifecycleOwner$attach$1$onActivityPreCreated$1.class","size":1650,"crc":-183773517},{"key":"androidx/lifecycle/ProcessLifecycleOwner$attach$1.class","name":"androidx/lifecycle/ProcessLifecycleOwner$attach$1.class","size":3218,"crc":30315548},{"key":"androidx/lifecycle/ProcessLifecycleOwner$initializationListener$1.class","name":"androidx/lifecycle/ProcessLifecycleOwner$initializationListener$1.class","size":1444,"crc":-251201875},{"key":"androidx/lifecycle/ProcessLifecycleOwner.class","name":"androidx/lifecycle/ProcessLifecycleOwner.class","size":6522,"crc":-2109516706},{"key":"META-INF/androidx.lifecycle_lifecycle-process.version","name":"META-INF/androidx.lifecycle_lifecycle-process.version","size":6,"crc":1653493832},{"key":"META-INF/lifecycle-process_release.kotlin_module","name":"META-INF/lifecycle-process_release.kotlin_module","size":24,"crc":-813369971}] |