From 802281c7c595a3b45aa46052d9a2844969c4f355 Mon Sep 17 00:00:00 2001 From: Bryan Van Deusen Date: Tue, 26 May 2026 00:50:44 -0400 Subject: [PATCH] fix(android): don't pre-fill localhost default in ServerUrl field MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit User pointed out they were being forced to clear "http://localhost:8080" before typing their actual server URL. That default came from AuthStore.DEFAULT_BASE_URL — an internal HTTP-client fallback for when nothing's been configured, never something a user typed. Now: pre-fill only when the stored URL is something the user actually saved (anything other than the default). Otherwise leave the field empty so the placeholder ("https://minstrel.example.com") shows through and they can just start typing. Edit case still works: if a user already saved e.g. "http://192.168.1.10:8080" and re-opens ServerUrl after sign-out, the field is pre-filled with that real value for them to edit. Co-Authored-By: Claude Opus 4.7 (1M context) --- .../fabledsword/minstrel/auth/ui/ServerUrlScreen.kt | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/android/app/src/main/java/com/fabledsword/minstrel/auth/ui/ServerUrlScreen.kt b/android/app/src/main/java/com/fabledsword/minstrel/auth/ui/ServerUrlScreen.kt index 5a95d863..04d90763 100644 --- a/android/app/src/main/java/com/fabledsword/minstrel/auth/ui/ServerUrlScreen.kt +++ b/android/app/src/main/java/com/fabledsword/minstrel/auth/ui/ServerUrlScreen.kt @@ -51,7 +51,17 @@ class ServerUrlViewModel @Inject constructor( ) : ViewModel() { private val internal = MutableStateFlow( - ServerUrlFormState(url = authStore.baseUrl.value), + // Pre-fill ONLY if the user has previously saved a real URL — + // the DEFAULT_BASE_URL placeholder (`http://localhost:8080`) is + // an internal HTTP-client fallback, not something a user + // typed. Leaving the field empty lets the OutlinedTextField's + // placeholder ("https://minstrel.example.com") show through + // so the user can just type without first having to clear. + ServerUrlFormState( + url = authStore.baseUrl.value + .takeIf { it != AuthStore.DEFAULT_BASE_URL } + .orEmpty(), + ), ) val state: StateFlow = internal.asStateFlow()