feat(webui): inline config editing on the Configuration page

The dashboard's Configuration page can now change runtime-tunable
settings without hand-editing TOML (issue #348). Scalar rows get an
Edit affordance; Save PATCHes the dotted key to /api/config, which
validates the materialised config before persisting to the runtime
overlay and republishing.

Per the design constraints:
- Structured values (repositories, models, providers -- arrays and
  maps) render read-only with no edit affordance; they are not
  faked as editable.
- Denylisted keys (db_path, work_dir) render explicitly disabled with
  the server's reason from the ConfigView.locked map, instead of a row
  that silently lacks an Edit button.
- Bool fields edit via a select, ints parse client-side so a typo
  fails before a round trip, durations and strings pass through to
  the server which validates them. The server's error text is shown
  inline on a rejected save (validation failure, denylist, disabled
  overlay).
- Enter saves, Escape cancels, Cancel restores the row.

api.configUpdate PATCHes /api/config with {updates: {dotted.key: v}}.

Verified: task check clean; 23 node tests pass; dist rebuilt and
committed in the same change.
This commit is contained in:
sam committed 2026-08-10 00:57:05 +10:00
1 parent da2d93a830
commit fa8a0d6d02
5 files changed
+246 -51

No files matched your search

+10
View File
@@ -86,6 +86,16 @@ export const api = {
return res.json();
},
config: () => req("/api/config"),
configUpdate: async (updates) => {
const res = await fetch("/api/config", {
method: "PATCH",
headers: { Accept: "application/json", "Content-Type": "application/json", "X-Archie-CSRF": "1" },
body: JSON.stringify({ updates }),
signal: AbortSignal.timeout(15000),
});
if (!res.ok) throw new ApiError(await errorMessage(res), res.status);
return res.json();
},
logs: (params) => req("/api/logs" + qs(params)),
memory: () => req("/api/memory"),
chatSessions: () => req("/api/chat/sessions"),