Separate TUI preferences from server configuration (#42202)

## Why

TUI preferences and persistence paths belong to the local client, while thread
configuration and account requirements may come from the active app server.
Keeping both in the same resolved `Config` can replace live local preferences
when a thread is resumed, forked, reconnected, or switched.

## What changed

- Add `LocalSettings` as the TUI-owned source for UI, history, notice, and local
  persistence settings, and preserve it across session lifecycle transitions.
- Write preference changes to the selected user config file and reload local
  settings from disk when changing roots.
- Use the app server's account response for authentication-dependent onboarding
  and status UI instead of the local model-provider configuration.
- Retain platform family and OS metadata reported by remote app servers.

## Testing

- Cover local setting defaults, overrides, persistence destinations, reloads,
  and preservation across widget replacement and root switching.
- Cover remote platform metadata and server-controlled authentication UI.

GitOrigin-RevId: dbc2965fb1d6cbecb3f973f6133f3dcd4467b753
This commit is contained in:
Eric Traut authored and copyberry committed 2026-09-02 04:20:38 +00:00
1 parent 0b509e930e
commit 9d57be71ba
87 files changed
+1188 -459

No files matched your search

@@ -74,7 +74,7 @@ impl ChatWidget {
self.transcript.active_cell = Some(Box::new(history_cell::new_active_web_search_call(
call_id,
String::new(),
self.config.animations,
self.local_settings.tui.animations,
)));
self.bump_active_cell_revision();
self.request_redraw();
@@ -184,7 +184,7 @@ impl ChatWidget {
tool,
arguments: Some(arguments),
},
self.config.animations,
self.local_settings.tui.animations,
)));
self.bump_active_cell_revision();
self.request_redraw();
@@ -236,8 +236,11 @@ impl ChatWidget {
Some(cell) if cell.call_id() == id => cell.complete(duration, result),
_ => {
self.flush_active_cell();
let mut cell =
history_cell::new_active_mcp_tool_call(id, invocation, self.config.animations);
let mut cell = history_cell::new_active_mcp_tool_call(
id,
invocation,
self.local_settings.tui.animations,
);
let extra_cell = cell.complete(duration, result);
self.transcript.active_cell = Some(Box::new(cell));
extra_cell