Skip to content

Console: edit settings and restart the daemon from the Settings page #1156

In review

Description

@leonardoxr

Part of #1151.

Scope

An operator changes settings and restarts the daemon from the Settings page's Daemon card, on a worker or a gateway: Edit in a dialog, Use default, a confirm before a change that can cut the console off, and Restart daemon while a saved change waits.

If this goes wrong, an operator saves a lock-out key with no warning, sees a secret, or saves a value that undoes another change.

Technical spec

Commit 096519b.

Rows

  • Behaviours: B15, B16, B17, B18, B19
  • Interfaces: I20, I21, I22, I24
  • Existing code: X25, X26, X27, X28, X29, X30, X31, X32

Facts

none

Modules touched

Searches: /v1/config, configSections, setCommand, ItemAction, ConfirmHost, EnrolHost, useActions, TIMES, staleKeys, settings in ui and e2e/console; Copy in the console docs.

  • ui/src/model/settings-rows.ts (new), ui/src/model/config-view.ts, ui/src/model/actions.ts, ui/src/model/stale-keys.ts.
  • ui/src/state/settings.ts, ui/src/state/actions.ts, ui/src/state/queries.ts, ui/src/state/services.tsx, ui/src/data/api.ts.
  • ui/src/ds/setting-dialog.tsx, ui/src/ds/setting-dialog.css (new), ui/src/ds/index.ts, ui/src/app/setting-host.tsx (new), ui/src/app/app.tsx.
  • ui/src/screens/settings/index.tsx, ui/src/screens/settings/settings.css, ui/src/test/fixtures.ts, ui/src/test/console.tsx, e2e/console/stubs.ts, e2e/console/fixtures.ts, e2e/console/render-fixtures.ts.
  • docs/internal/DESIGN.md, website/src/content/docs/docs/reference/console.mdx.
flowchart LR
  SC["screens/settings *"] --> ST["state/settings *"]
  ST --> M["model/settings-rows *"]
  SC --> DS["ds/setting-dialog *"]
  ST --> A["state/actions *"]
  A --> MA["model/actions *"]
  A --> API["data/api *"]
Loading

Rules in play

  • ADR 0099 §7: edits in the Daemon card, the confirm, Restart daemon, no Edit on program and fleet keys.
  • ADR 0037 §3: saving and restarting are entries of ui/src/model/actions.ts, run by the one runner.
  • ADR 0044: the page reads ['settings'] only while shown; config.changed marks it.
  • ui/AGENTS.md layers: a screen draws a view model; the contract is imported for types only.
  • docs/internal/DESIGN.md: inputs, dialog, table; its Settings section changes in this PR.
  • Documentation rule 9: the console page.

Retired words

  • read-only, of the Daemon card: it edits settings; only the program keys and a worker's fleet keys have no Edit.

Tests

Seam: the whole app through ui/src/test/console.tsx (model: ui/src/screens/settings/settings.dom.test.tsx), the model (model: ui/src/model/actions.test.ts) and the event map (model: ui/src/model/stale-keys.test.ts).

  • B15: An operator opens Settings and sees the Daemon card's rows grouped by section: a value with its default; a pending row adds Saved: <value>; Set and Not set; Live, On restart, Restart pending; a program key with Copy and no Edit; a worker's gateway.url, gateway.token, gateway.headers and gateway.localLeases with no Edit, and gateway.label with it; a removed key with no default (Saved: Not set); a pending secret with no Saved: line; fileProblem above the rows with no Restart daemon; 403 and 404 as today; a gateway's rows
  • B16: An operator edits a row in a dialog and saves it: boolean, number, string, enum, json; a pending row opens with its saved value; a number or json that does not parse is refused in the dialog and nothing is sent; Use default on an inFile row sends null, and is absent on another; a refusal shows the daemon's message and the dialog keeps the typed value; a lost connection shows The daemon did not answer.; a secret's field starts empty and an empty one cannot be saved; Cancel sends nothing; after a 200 the dialog closes and the answer's rows are shown; a failed save's Retry toast sends nothing while a setting dialog is open, as for Enrol (decided in delivery, pending the maintainer)
  • B17: A lock-out key asks first and then the page says what the restart does: http.port; http.host; http.enabled false; http.enabled true (no confirm); http.proxyAuth; Use default on http.host, http.port, http.proxyAuth (the same confirm) and on http.enabled (a confirm only when its default is false); Keep sends nothing and keeps the dialog; the line above the rows while an http.* row is pending: an address, or HTTP off
  • B18: An operator restarts the daemon from Settings: Restart daemon only with a pending row; confirm, one POST /v1/restart, the success toast; Keep sends nothing; a 503 shows the daemon's message; after the reconnect the rows are read again
  • B19: config.changed marks the settings read stale: config.changed marks ['settings']; lease.granted does not

Done when

  • rg '/v1/config' ui/src prints nothing.
  • The console's screenshots are written again and the Settings picture shows the card.
  • The website's console page describes editing, the confirms and Restart daemon, and its Settings section no longer says read-only.
  • pnpm test:console --project=chromium e2e/console/browser-checks.spec.ts passes.

Out of scope

  • A worker's settings through its gateway's console, and joining a fleet from the console.
  • Undo of a save.

Depends on

Written by an agent.

Activity

  1. added
    task:draft
    on Nov 5, 2026
  2. changed the title [-]Console: a Settings page that edits settings and restarts the daemon[/-] [+]Console: edit settings and restart the daemon from the Settings page[/+] on Nov 30, 2026
  3. added
    task:ready
    and removed
    task:draft
    on Nov 30, 2026
  4. self-assigned this
    on Dec 2, 2026
  5. 6 remaining items

  6. removed their assignment
    on Dec 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    task:ready

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions