Save interface-scale changes from every window
Ctrl/Cmd +/-/0 in editor and connection-manager windows called SettingsService.persist() -> saveSettings, but only the main window's RPC served that request: it went unanswered, the new scale applied locally, and the next broadcast from main snapped it back. All three window RPCs now serve saveSettings through one shared saveSettingsHandler (persist, then hand off). index.ts's settingsSaved() is the single place settings side effects run — transfer concurrency, locale + app menu, the preload snapshot — whichever window saved, and it rebroadcasts to every window EXCEPT the sender: an echo arriving behind a newer local change (a held Cmd+) would drag it backwards. Editors are skipped by their registry key, main and the manager by name. Known ceiling, noted at the handler: whole-object writes, so two windows saving in the same instant means the later one wins. Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -218,10 +218,13 @@ component; tokens → `ui/src/styles.css`.
|
||||
skip, overwrite dialog with all/none batch modes).
|
||||
- `settings.service.ts` — one signal per setting; **imperative apply pattern**
|
||||
(`applyTheme/DarkTone/Accent` set `data-*` attributes on `<html>`;
|
||||
`applyUiScale` sets its inline `font-size`); `applyAll` also serves the `settingsChanged` broadcast so editor
|
||||
and manager windows restyle live (they render no settings UI, so no
|
||||
persist echo). New setting = five touches here + types.ts (backend merges
|
||||
automatically).
|
||||
`applyUiScale` sets its inline `font-size`); `applyAll` also serves the
|
||||
`settingsChanged` broadcast, so every window follows a save made in any
|
||||
other. All three window RPCs serve `saveSettings` (editor and manager windows
|
||||
save too — the scale shortcuts); bun's `settingsSaved()` in index.ts runs the
|
||||
side effects once and rebroadcasts to every window **except the sender**, so
|
||||
there is no echo to fight a held Cmd+. `applyAll` never persists. New setting
|
||||
= five touches here + types.ts (backend merges automatically).
|
||||
- `focus.service.ts` — dependency-free `tick`/`bump()`; dialogs bump it, the
|
||||
main window's panels listen. Exists so dialogs don't inject PanelsService
|
||||
(whose constructor spawns a workspace — fatal in secondary windows).
|
||||
|
||||
@@ -210,6 +210,12 @@ touching the adjacent code.
|
||||
- Settings: the backend spread-merges (`{...DEFAULT_SETTINGS, ...data}`) so
|
||||
new keys auto-default, but the UI SettingsService reads field-by-field —
|
||||
a new setting silently stays at default until wired in all five spots.
|
||||
- **Every window's RPC must serve `saveSettings`.** The scale shortcuts
|
||||
shipped in editor and manager windows while only the main RPC served it:
|
||||
the request went unanswered, the change applied locally, and main's next
|
||||
broadcast snapped it back. All three factories now share
|
||||
`saveSettingsHandler`, and `settingsSaved()` in index.ts rebroadcasts to
|
||||
every window but the sender — an echo would drag a held Cmd+ backwards.
|
||||
- The editor draft mirror sends full content per tick (2 MB cap upstream);
|
||||
don't shrink the 400 ms debounce.
|
||||
- `panel.touched` gates localDir auto-navigation; `connectToken` guards
|
||||
|
||||
Reference in New Issue
Block a user