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

+93
View File
@@ -58,3 +58,96 @@
color: var(--fg);
text-align: right;
}
/* Inline edit affordance: value + Edit on the right, input + Save /
Cancel while editing, and the server's reason for locked rows. */
.cfg-value-cell {
display: flex;
align-items: center;
justify-content: flex-end;
gap: var(--sp-2);
min-width: 0;
}
.cfg-edit {
font: inherit;
font-size: var(--text-xs);
color: var(--fg-muted);
background: var(--surface-hover);
border: 1px solid var(--border-strong);
border-radius: var(--radius-sm);
padding: 2px var(--sp-2);
cursor: pointer;
flex: none;
}
.cfg-edit:hover {
color: var(--fg);
border-color: var(--accent);
}
.cfg-editing {
flex-wrap: wrap;
}
.cfg-input {
font: inherit;
font-size: var(--text-xs);
color: var(--fg);
background: var(--surface);
border: 1px solid var(--border-strong);
border-radius: var(--radius-sm);
padding: var(--sp-1) var(--sp-2);
min-width: 0;
flex: 1 1 10rem;
}
.cfg-input:focus {
outline: 2px solid var(--accent);
outline-offset: -1px;
}
.cfg-save,
.cfg-cancel {
font: inherit;
font-size: var(--text-xs);
border-radius: var(--radius-sm);
padding: var(--sp-1) var(--sp-2);
cursor: pointer;
flex: none;
}
.cfg-save {
background: var(--accent);
border: 1px solid var(--accent);
color: var(--accent-fg);
font-weight: 500;
}
.cfg-save:disabled {
opacity: 0.6;
cursor: default;
}
.cfg-cancel {
background: transparent;
border: 1px solid var(--border-strong);
color: var(--fg-muted);
}
.cfg-cancel:hover {
color: var(--fg);
}
.cfg-locked {
font-size: var(--text-xs);
color: var(--fg-subtle);
font-style: italic;
}
.cfg-error {
font-size: var(--text-xs);
color: var(--danger);
flex-basis: 100%;
text-align: right;
}