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
2.6 KiB
Plaintext
1 line
2.6 KiB
Plaintext
[{"key":"META-INF/MANIFEST.MF","name":"META-INF/MANIFEST.MF","size":46,"crc":1570773839},{"key":"META-INF/kotlinx-coroutines-android.kotlin_module","name":"META-INF/kotlinx-coroutines-android.kotlin_module","size":75,"crc":1137352818},{"key":"kotlinx/coroutines/android/HandlerContext.class","name":"kotlinx/coroutines/android/HandlerContext.class","size":8338,"crc":1033607857},{"key":"kotlinx/coroutines/android/HandlerDispatcherKt.class","name":"kotlinx/coroutines/android/HandlerDispatcherKt.class","size":10346,"crc":-679992087},{"key":"kotlinx/coroutines/android/HandlerDispatcherKt$awaitFrameSlowPath$lambda$3$$inlined$Runnable$1.class","name":"kotlinx/coroutines/android/HandlerDispatcherKt$awaitFrameSlowPath$lambda$3$$inlined$Runnable$1.class","size":1724,"crc":269342463},{"key":"kotlinx/coroutines/android/HandlerDispatcher.class","name":"kotlinx/coroutines/android/HandlerDispatcher.class","size":2409,"crc":176092634},{"key":"kotlinx/coroutines/android/AndroidExceptionPreHandler.class","name":"kotlinx/coroutines/android/AndroidExceptionPreHandler.class","size":3081,"crc":-1147103113},{"key":"kotlinx/coroutines/android/HandlerContext$scheduleResumeAfterDelay$$inlined$Runnable$1.class","name":"kotlinx/coroutines/android/HandlerContext$scheduleResumeAfterDelay$$inlined$Runnable$1.class","size":2292,"crc":1516820094},{"key":"kotlinx/coroutines/android/AndroidDispatcherFactory.class","name":"kotlinx/coroutines/android/AndroidDispatcherFactory.class","size":2208,"crc":318894566},{"key":"META-INF/com.android.tools/r8-from-1.6.0/coroutines.pro","name":"META-INF/com.android.tools/r8-from-1.6.0/coroutines.pro","size":899,"crc":2032253094},{"key":"META-INF/com.android.tools/r8-upto-3.0.0/coroutines.pro","name":"META-INF/com.android.tools/r8-upto-3.0.0/coroutines.pro","size":558,"crc":1737114335},{"key":"META-INF/com.android.tools/proguard/coroutines.pro","name":"META-INF/com.android.tools/proguard/coroutines.pro","size":300,"crc":-477435061},{"key":"META-INF/proguard/coroutines.pro","name":"META-INF/proguard/coroutines.pro","size":419,"crc":77044690},{"key":"META-INF/services/kotlinx.coroutines.internal.MainDispatcherFactory","name":"META-INF/services/kotlinx.coroutines.internal.MainDispatcherFactory","size":52,"crc":1268078975},{"key":"META-INF/services/kotlinx.coroutines.CoroutineExceptionHandler","name":"META-INF/services/kotlinx.coroutines.CoroutineExceptionHandler","size":54,"crc":-1889973424},{"key":"META-INF/versions/9/module-info.class","name":"META-INF/versions/9/module-info.class","size":381,"crc":-706149332},{"key":"META-INF/kotlinx_coroutines_android.version","name":"META-INF/kotlinx_coroutines_android.version","size":5,"crc":485120441}] |