Editor: live settings sync + session-death banner

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Jokin
2026-07-13 22:39:31 +02:00
co-authored by Claude Fable 5
parent 6a19097b25
commit 93a9b07722
2 changed files with 31 additions and 16 deletions
@@ -89,6 +89,16 @@
</div> </div>
} }
@if (sessionDead()) {
<div
class="flex shrink-0 items-center gap-2 border-b border-border bg-destructive/10 px-3 py-1.5 text-[11px] text-destructive"
>
<ng-icon name="mynaXCircle" size="0.85rem" class="shrink-0" />
Disconnected from {{ ctx.sessionTitle }} — saving will fail, but your text is preserved
in this window.
</div>
}
@if (loading()) { @if (loading()) {
<div class="flex flex-1 items-center justify-center"> <div class="flex flex-1 items-center justify-center">
<ng-icon name="mynaSpinner" size="1.25rem" class="animate-spin text-primary" /> <ng-icon name="mynaSpinner" size="1.25rem" class="animate-spin text-primary" />
+18 -13
View File
@@ -32,23 +32,28 @@ export class SettingsService {
this.applyAccent(); this.applyAccent();
if (!this.rpc.available) return; if (!this.rpc.available) return;
void this.rpc.request.getSettings({}).then((res) => { void this.rpc.request.getSettings({}).then((res) => {
if (!res.ok) return; if (res.ok) this.applyAll(res.settings);
this.theme.set(res.settings.theme); });
this.darkTone.set(res.settings.darkTone); // editor windows: follow settings the main window saves, live
this.accent.set(res.settings.accent); this.rpc.onSettingsChanged((settings) => this.applyAll(settings));
this.iconColors.set(res.settings.iconColors); }
this.speedUnit.set(res.settings.speedUnit);
this.textSize.set(res.settings.textSize); private applyAll(settings: AppSettings): void {
this.transferMode.set(res.settings.transferMode); this.theme.set(settings.theme);
this.transferConcurrency.set(res.settings.transferConcurrency); this.darkTone.set(settings.darkTone);
this.autoClearCompleted.set(res.settings.autoClearCompleted); this.accent.set(settings.accent);
this.editor.set(res.settings.editor); this.iconColors.set(settings.iconColors);
this.editorApp.set(res.settings.editorApp); this.speedUnit.set(settings.speedUnit);
this.textSize.set(settings.textSize);
this.transferMode.set(settings.transferMode);
this.transferConcurrency.set(settings.transferConcurrency);
this.autoClearCompleted.set(settings.autoClearCompleted);
this.editor.set(settings.editor);
this.editorApp.set(settings.editorApp);
this.applyTheme(); this.applyTheme();
this.applyDarkTone(); this.applyDarkTone();
this.applyAccent(); this.applyAccent();
this.applyTextSize(); this.applyTextSize();
});
} }
setTheme(theme: AppSettings['theme']): void { setTheme(theme: AppSettings['theme']): void {