Skip to content

fix(web): editor state for Kubernetes credentials, unsaved changes and access refreshes (#400) - #511

Open
mblaauw wants to merge 1 commit into
mainfrom
fix/400-web-editor-state
Open

mblaauw wants to merge 1 commit into
mainfrom
fix/400-web-editor-state

Conversation

@mblaauw

@mblaauw mblaauw commented Nov 25, 2026

Copy link
Copy Markdown
Collaborator

Closes #400.

Summary

  • Connection form: the Kubernetes service-account token and kubeconfig share one
    credential field. Switching the auth mode (select or Advanced config) now clears what
    was entered and the loaded file name, and an edit that changes the mode of a
    connection with a stored credential requires a new one; the "(stored)" hints only
    show in the stored mode. Half-typed Advanced JSON is not treated as a mode change.
  • Unsaved-changes guard: the connection form and the worker-profile editor passed only
    the access flag, so name, scopes, config, credential and runtime edits were lost
    without a prompt. Both pass their draft now; the worker editor guards creation too and
    compares attached environment mappings with the loaded ones, so seeding them is not an
    edit. A new connection's default name is set in the initial state, not an effect.
  • Access save: resource-access-fields invalidated [resource] ("agent_teams",
    "worker_profiles", "env_mappings"), which no query uses. queryKeys moves to the pure
    lib/query-keys.ts (re-exported from lib/queries.ts) with sharingInvalidationKeys(),
    which refreshes each resource's real list/detail keys and access-team resource lists.
  • Worker editor: harness-managed providers for different harnesses can share a provider
    name (the profile stores only that name). resolveProvider takes the worker's harness
    and prefers the provider for it, harnessMismatch uses it, and the select shows one
    option per stored value.

Testing

Not checked in a browser; the guard inputs (item 2) are not unit-tested. The pasted kubeconfig is still shown unmasked.

🤖 Generated with Claude Code

…d access refreshes (#400)

- Connection form: the Kubernetes service-account token and kubeconfig share one
  credential field. Switching the auth mode (select or Advanced config) now clears what
  was entered and the loaded file name, and an edit that changes the mode of a
  connection with a stored credential requires a new one; the "(stored)" hints only
  show in the stored mode. Half-typed Advanced JSON is not treated as a mode change.
- Unsaved-changes guard: the connection form and the worker-profile editor passed only
  the access flag, so name, scopes, config, credential and runtime edits were lost
  without a prompt. Both pass their draft now; the worker editor guards creation too and
  compares attached environment mappings with the loaded ones, so seeding them is not an
  edit. A new connection's default name is set in the initial state, not an effect.
- Access save: resource-access-fields invalidated `[resource]` ("agent_teams",
  "worker_profiles", "env_mappings"), which no query uses. queryKeys moves to the pure
  lib/query-keys.ts (re-exported from lib/queries.ts) with sharingInvalidationKeys(),
  which refreshes each resource's real list/detail keys and access-team resource lists.
- Worker editor: harness-managed providers for different harnesses can share a provider
  name (the profile stores only that name). resolveProvider takes the worker's harness
  and prefers the provider for it, harnessMismatch uses it, and the select shows one
  option per stored value.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Web editor state: Kubernetes credential modes share one field, unsaved-changes guard misses most edits, access save invalidates the wrong query keys

1 participant