Files
archie/internal/webui/api_capabilities.go
T
sam 5e9d706c22 fix(webui): drop the config schema's editability advert
No process writes configuration through the dashboard: the write
handlers, their UpdateConfig/ResetConfig/UpdateRepoField seams and
ConfigView.Editable were deleted with the runtime config overlay
(2311529d), and database-backed settings are written through the control
plane. That left producer-side residue behind:

- ConfigField.Editable and the descriptor literals setting it, which
  emitted editable=true for fields no process can change, and which
  ui/src/settings/types.ts's ConfigField deliberately omits from the
  reader side of the wire shape
- ErrConfigUpdateUnavailable/ErrConfigUpdateInvalid, with neither a
  producer nor a consumer since handleConfigUpdate was deleted
- comments pointing at handleConfigUpdate/UpdateConfig,
  ConfigView.Editable, the overlay's overridden markers and a deleted
  test name

The two Editable-only descriptor tests go with the field; the deleted
write path is what they pinned.
2026-09-30 11:38:44 +10:00

40 lines
1.6 KiB
Go

package webui
import "net/http"
// handleCapabilities reports which dashboard sections this process can
// actually serve.
//
// The dashboard is served by the extracted UI process, which holds two remote
// contracts (Gateway ChatContract and the State Store) and nothing else.
// Sections whose capability lives only in the daemon still answer -- with an
// empty list, a "disabled" marker, or a 501 -- and the page cannot tell that
// apart from a deployment where nothing has happened yet. Rather than have
// every page guess, the server says which sections it can back, and the
// browser hides the rest.
//
// A section is reported available when the handle behind it is wired, which
// is the same condition its handler already uses to decide between real data
// and its degraded answer. Sections backed by the task store are absent from
// this list: the store is mandatory.
func (s *Server) handleCapabilities(w http.ResponseWriter, _ *http.Request) {
writeJSON(w, map[string]any{
"sections": map[string]bool{
"chat": s.Chat != nil && s.Chat.Contract != nil,
"logs": s.LogFeed != nil,
"skills": s.Skills != nil,
"curators": s.Curators != nil,
"channels": s.Channels != nil,
"captures": s.Captures != nil,
"mappings": s.Mappings != nil,
"bindings": s.Bindings != nil,
// The workflows page draws its statistics from the task store
// and its definition list from the local registry, so it is
// worth showing with only the former.
"workflows": true,
// Configuration renders from whichever source is wired.
"settings": true,
},
})
}