fix(android): unblock first device test — auth contrast + dynamic base URL

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>
This commit is contained in:
2026-05-26 00:27:05 -04:00
parent 0415b5ccc3
commit 0b72827682
5553 changed files with 63548 additions and 10 deletions
@@ -0,0 +1,100 @@
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:ns1="urn:oasis:names:tc:xliff:document:1.2">
<string msgid="8719607706653693137" name="androidx_compose_foundation_autofill">"Autofill"</string>
<string msgid="1150566100598813236" name="androidx_compose_ui_autofill">"Autofill"</string>
<string msgid="881409763997275156" name="call_notification_answer_action">"Answer"</string>
<string msgid="8793775615905189152" name="call_notification_answer_video_action">"Video"</string>
<string msgid="3229508546291798546" name="call_notification_decline_action">"Decline"</string>
<string msgid="2659457946726154263" name="call_notification_hang_up_action">"Hang Up"</string>
<string msgid="6107532579223922871" name="call_notification_incoming_text">"Incoming call"</string>
<string msgid="8623827134497363134" name="call_notification_ongoing_text">"Ongoing call"</string>
<string msgid="59049573811482460" name="call_notification_screening_text">"Screening an incoming call"</string>
<string msgid="406453423630273620" name="close_drawer">"Close navigation menu"</string>
<string msgid="7573152094250666567" name="close_sheet">"Close sheet"</string>
<string msgid="8038256446254964252" name="default_error_message">"Invalid input"</string>
<string msgid="6312721426453364202" name="default_popup_window_title">"Pop-Up Window"</string>
<string msgid="1890207353314751437" name="dropdown_menu">"Dropdown menu"</string>
<string msgid="6827826412747255547" name="in_progress">"In progress"</string>
<string msgid="7933458017204019916" name="indeterminate">"Partially checked"</string>
<string msgid="2988463736136100848" name="m3c_bottom_sheet_collapse_description">"Collapse bottom sheet"</string>
<string msgid="1555567894577437024" name="m3c_bottom_sheet_dismiss_description">"Dismiss bottom sheet"</string>
<string msgid="8403354765404029791" name="m3c_bottom_sheet_drag_handle_description">"Drag handle"</string>
<string msgid="6670819569745899763" name="m3c_bottom_sheet_expand_description">"Expand bottom sheet"</string>
<string msgid="3010635850035863127" name="m3c_bottom_sheet_pane_title">"Bottom Sheet"</string>
<string msgid="8166741421776570875" name="m3c_date_input_headline">"Entered date"</string>
<string msgid="229313757840775812" name="m3c_date_input_headline_description">"Entered date: %1$s"</string>
<string msgid="6116910750161463197" name="m3c_date_input_invalid_for_pattern">"Date does not match expected pattern: %1$s"</string>
<string msgid="2521768508935305279" name="m3c_date_input_invalid_not_allowed">"Date not allowed: %1$s"</string>
<string msgid="7052898923934555305" name="m3c_date_input_invalid_year_range">"Date out of expected year range %1$s - %2$s"</string>
<string msgid="2895559812010326913" name="m3c_date_input_label">"Date"</string>
<string msgid="1237013946323089826" name="m3c_date_input_no_input_description">"None"</string>
<string msgid="7306227249789210568" name="m3c_date_input_title">"Select date"</string>
<string msgid="7605002211875882969" name="m3c_date_picker_headline">"Selected date"</string>
<string msgid="3664277305226978227" name="m3c_date_picker_headline_description">"Current selection: %1$s"</string>
<string msgid="8436650776581492840" name="m3c_date_picker_navigate_to_year_description">"Navigate to year %1$s"</string>
<string msgid="5811000998184572395" name="m3c_date_picker_no_selection_description">"None"</string>
<string msgid="7813882352367152251" name="m3c_date_picker_scroll_to_earlier_years">"Scroll to show earlier years"</string>
<string msgid="5727367015496556177" name="m3c_date_picker_scroll_to_later_years">"Scroll to show later years"</string>
<string msgid="1804346892470238807" name="m3c_date_picker_switch_to_calendar_mode">"Switch to calendar input mode"</string>
<string msgid="395627960681594326" name="m3c_date_picker_switch_to_day_selection">"Swipe to select a year, or tap to switch back to selecting a day"</string>
<string msgid="2219746470065162704" name="m3c_date_picker_switch_to_input_mode">"Switch to text input mode"</string>
<string msgid="7142101321095356500" name="m3c_date_picker_switch_to_next_month">"Change to next month"</string>
<string msgid="228438865139394590" name="m3c_date_picker_switch_to_previous_month">"Change to previous month"</string>
<string msgid="791651718641787594" name="m3c_date_picker_switch_to_year_selection">"Switch to selecting a year"</string>
<string msgid="7430790972741451689" name="m3c_date_picker_title">"Select date"</string>
<string msgid="3199387177749801575" name="m3c_date_picker_today_description">"Today"</string>
<string msgid="2068382232816991922" name="m3c_date_picker_year_picker_pane_title">"Year picker visible"</string>
<string msgid="3190049423327661366" name="m3c_date_range_input_invalid_range_input">"Invalid date range input"</string>
<string msgid="3148384720560189467" name="m3c_date_range_input_title">"Enter dates"</string>
<string msgid="2138321128465719402" name="m3c_date_range_picker_day_in_range">"In range"</string>
<string msgid="4947636797751277713" name="m3c_date_range_picker_end_headline">"End date"</string>
<string msgid="602077859540990149" name="m3c_date_range_picker_scroll_to_next_month">"Scroll to show the next month"</string>
<string msgid="4592174524846109496" name="m3c_date_range_picker_scroll_to_previous_month">"Scroll to show the previous month"</string>
<string msgid="4665981448952749820" name="m3c_date_range_picker_start_headline">"Start date"</string>
<string msgid="3134165431120340385" name="m3c_date_range_picker_title">"Select dates"</string>
<string msgid="7617233117134790350" name="m3c_dialog">"Dialog"</string>
<string msgid="3177828188723359358" name="m3c_dropdown_menu_collapsed">"Collapsed"</string>
<string msgid="2360841780724299882" name="m3c_dropdown_menu_expanded">"Expanded"</string>
<string msgid="8687821690726149911" name="m3c_dropdown_menu_toggle">"Toggle dropdown menu"</string>
<string msgid="6072492480528318635" name="m3c_floating_toolbar_collapse">"Collapse toolbar"</string>
<string msgid="6880757017246780255" name="m3c_floating_toolbar_expand">"Expand toolbar"</string>
<string msgid="6152806324422087846" name="m3c_search_bar_search">"Search"</string>
<string msgid="6152755701819882931" name="m3c_snackbar_dismiss">"Dismiss"</string>
<string msgid="3868801555855510515" name="m3c_snackbar_pane_title">"Alert"</string>
<string msgid="7655536806087401899" name="m3c_suggestions_available">"Suggestions below"</string>
<string msgid="409352516511718051" name="m3c_time_input_dialog_title">"Enter Time"</string>
<string msgid="2786685010796619560" name="m3c_time_picker_am">"AM"</string>
<string msgid="7412665527536641863" name="m3c_time_picker_dialog_title">"Select Time"</string>
<string msgid="2349193472625211372" name="m3c_time_picker_hour">"Hour"</string>
<string msgid="9179527532316922345" name="m3c_time_picker_hour_24h_suffix">"%1$d hours"</string>
<string msgid="8876759303332837035" name="m3c_time_picker_hour_selection">"Select hour"</string>
<string msgid="3458167507790628988" name="m3c_time_picker_hour_suffix">"%1$d o\'clock"</string>
<string msgid="6973808109666874069" name="m3c_time_picker_hour_text_field">"for hour"</string>
<string msgid="4313071914266462005" name="m3c_time_picker_minute">"Minute"</string>
<string msgid="4699133535056739733" name="m3c_time_picker_minute_selection">"Select minutes"</string>
<string msgid="5064177921781937179" name="m3c_time_picker_minute_suffix">"%1$d minutes"</string>
<string msgid="7661234488295443182" name="m3c_time_picker_minute_text_field">"for minutes"</string>
<string msgid="5865171949528594571" name="m3c_time_picker_period_toggle_description">"Select AM or PM"</string>
<string msgid="6616362054113087709" name="m3c_time_picker_pm">"PM"</string>
<string msgid="4145073906612931838" name="m3c_time_picker_toggle_keyboard">"Switch to text input mode for the time input"</string>
<string msgid="8841786098195101324" name="m3c_time_picker_toggle_touch">"Switch to clock mode for the time input"</string>
<string msgid="1805687647081129904" name="m3c_tooltip_long_press_label">"Show tooltip"</string>
<string msgid="5460405025248574620" name="m3c_tooltip_pane_description">"Tooltip"</string>
<string msgid="6564222473543418073" name="m3c_wide_navigation_rail_close_rail">"Close rail"</string>
<string msgid="8350283435461615411" name="m3c_wide_navigation_rail_pane_title">"Navigation rail"</string>
<string msgid="542007171693138492" name="navigation_menu">"Navigation menu"</string>
<string msgid="6610465462668679431" name="not_selected">"Not selected"</string>
<string msgid="5941395253238309765" name="range_end">"Range end"</string>
<string msgid="7097486360902471446" name="range_start">"Range start"</string>
<string msgid="6043586758067023" name="selected">"Selected"</string>
<string msgid="2792228137354697160" name="snackbar_pane_title">"Alert"</string>
<string msgid="4139871816613051306" name="state_empty">"Empty"</string>
<string msgid="5834637030682409883" name="state_off">"Off"</string>
<string msgid="1490883874751719580" name="state_on">"On"</string>
<string msgid="6277540029070332960" name="status_bar_notification_info_overflow">"999+"</string>
<string msgid="2561197295334830845" name="switch_role">"Switch"</string>
<string msgid="1672349317127674378" name="tab">"Tab"</string>
<string msgid="5946805113151406391" name="template_percent">"<ns1:g id="PERCENTAGE">%1$d</ns1:g> percent."</string>
<string msgid="3765533235322692011" name="tooltip_description">"tooltip"</string>
<string msgid="3124740595719787496" name="tooltip_label">"show tooltip"</string>
</resources>