Detached chat: read the chat again once its machine connects, and follow the main window's look

A detached chat window read the chat list once, before any saved machine had
connected, and never again; its pane also did not rebuild when the runtime
adopted a row. Without the row the header showed a bare "Chat" with no folder
or model, the window was named by the session id, and the chat's colour (bar
tint, focus ring, prompt bar) was missing. The window now re-reads the list on
each connection change and rebuilds on the runtime, as the Chat destination
does. It also re-reads the stored design and font on the browser's storage
event and on coming to the front, so a Settings change in the main window
follows.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-12-03 17:28:47 +00:00
parent 1dc992bc27
commit 03983cfd1f
10 changed files with 356 additions and 11 deletions
+8 -2
View File
@@ -82,12 +82,18 @@ class AppFontController extends ChangeNotifier {
/// Reads the stored choice and starts loading it. With [wait], returns once
/// it is applied or after [wait], whichever is first; a slower load still
/// applies when it finishes.
///
/// Read again later (a detached window following the main window's
/// choice), a stored system font returns the theme to it; an id this
/// device cannot resolve keeps the current font.
Future<void> restore({Duration? wait}) async {
final id = await _store.load();
if (id == null || id == AppFont.system.id) return;
if (id == null) return;
final font = await _resolve(id);
if (font == AppFont.system || font == _selected) return;
if (font == _selected) return;
if (font == AppFont.system && id != AppFont.system.id) return;
_selected = font;
_loadFailed = null;
notifyListeners();
final applying = _apply(font);
if (wait == null) return applying;