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.5 KiB
Plaintext
1 line
1.5 KiB
Plaintext
[{"key":"androidx/lifecycle/LiveDataKt$observe$wrappedObserver$1.class","name":"androidx/lifecycle/LiveDataKt$observe$wrappedObserver$1.class","size":1310,"crc":340673706},{"key":"androidx/lifecycle/LiveDataKt.class","name":"androidx/lifecycle/LiveDataKt.class","size":2009,"crc":585856359},{"key":"androidx/lifecycle/Observer.class","name":"androidx/lifecycle/Observer.class","size":581,"crc":-1062994136},{"key":"androidx/lifecycle/LiveData$1.class","name":"androidx/lifecycle/LiveData$1.class","size":997,"crc":-378205089},{"key":"androidx/lifecycle/LiveData$AlwaysActiveObserver.class","name":"androidx/lifecycle/LiveData$AlwaysActiveObserver.class","size":1058,"crc":490911418},{"key":"androidx/lifecycle/LiveData$LifecycleBoundObserver.class","name":"androidx/lifecycle/LiveData$LifecycleBoundObserver.class","size":2893,"crc":-387464342},{"key":"androidx/lifecycle/LiveData$ObserverWrapper.class","name":"androidx/lifecycle/LiveData$ObserverWrapper.class","size":1622,"crc":788645168},{"key":"androidx/lifecycle/LiveData.class","name":"androidx/lifecycle/LiveData.class","size":8939,"crc":-232260782},{"key":"androidx/lifecycle/MutableLiveData.class","name":"androidx/lifecycle/MutableLiveData.class","size":946,"crc":-710747396},{"key":"META-INF/androidx.lifecycle_lifecycle-livedata-core.version","name":"META-INF/androidx.lifecycle_lifecycle-livedata-core.version","size":6,"crc":1653493832},{"key":"META-INF/lifecycle-livedata-core_release.kotlin_module","name":"META-INF/lifecycle-livedata-core_release.kotlin_module","size":58,"crc":-2017646999}] |