Update GUI state in resetToDefaults

suppressReload was eating the file-watch callback that would have
called loadConfig and refreshed the draft from disk, so the GUI stayed
on the pre-reset layout even though bar.json was already correct.
Apply the reset payload directly to draft (and bump draftRevision) so
section editors re-render in the same frame.
This commit is contained in:
Ryan Hughes
2026-05-14 02:21:48 -04:00
parent 34c645af72
commit 619a0d5737
@@ -151,6 +151,10 @@ ShellRoot {
fontFamily: String(source.fontFamily || "JetBrainsMono Nerd Font"),
layout: normalizeLayout(source.layout || {})
}
// Update the GUI synchronously — the suppressed file-watch callback won't
// fire loadConfig, so the draft would otherwise stay stale.
draft = payload
draftRevision++
suppressReload = true
userFile.setText(JSON.stringify(payload, null, 2) + "\n")
}