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:
@@ -87,6 +87,22 @@ class WebDetachedPlatform extends DetachedPlatform {
|
||||
return controller.stream;
|
||||
}
|
||||
|
||||
/// `shared_preferences` keeps its values under this prefix in
|
||||
/// `localStorage`; another window's write raises `storage` here.
|
||||
@override
|
||||
Stream<void> get preferencesChanged {
|
||||
late final StreamController<void> controller;
|
||||
final listener = ((web.StorageEvent event) {
|
||||
final key = event.key;
|
||||
if (key == null || key.startsWith('flutter.')) controller.add(null);
|
||||
}).toJS;
|
||||
controller = StreamController<void>(
|
||||
onListen: () => web.window.addEventListener('storage', listener),
|
||||
onCancel: () => web.window.removeEventListener('storage', listener),
|
||||
);
|
||||
return controller.stream;
|
||||
}
|
||||
|
||||
static String _key(String token) => 'pipelines.detached.$token';
|
||||
|
||||
@override
|
||||
|
||||
Reference in New Issue
Block a user