Skip to content

ux(settings): inline edit Term/Coverage + Enabled toggle on existing override rows (V2 of #72) #110

Description

@cristim

Summary

PR #72 made the Payment column on existing override rows editable via an inline <select>. The other three editable fields on account_service_overridesterm, coverage, enabled — remain read-only. To change any of them today, users must hit Reset (which deletes the row entirely, losing all field values) and recreate the override from scratch via #106's modal.

Two concrete user-visible gaps:

  1. No way to change Term or Coverage on an existing row without losing the other settings.
  2. No way to pause an override without deleting it. The account_service_overrides.enabled column exists (internal/database/postgres/migrations/000011_cloud_accounts.up.sql:78), the backend's applyOverrideScalars honours it, but no UI exposes the toggle.

What's already wired

Fix direction

Three small extensions to loadOverridesPanel's row rendering, each independently shippable:

  • Term cell: replace the static ${o.term}yr text with a <select> (1yr / 3yr / Inherit) constrained by getValidTermOptions('aws', o.service, o.payment ?? ''). Change handler PUTs { term: n } only.
  • Coverage cell: replace the static ${o.coverage}% text with a numeric input (0–100, step 1) with debounced save. Change handler PUTs { coverage: n } only. Validate before sending (out-of-range → revert + toast).
  • Enabled toggle: a per-row checkbox. PUT { enabled: bool } on change. When false, dim the row visually so it's clear the override exists but isn't influencing recommendations.

Each follows #72's "sparse PUT preserves other fields" + "current value rendered, server roundtrip on change" + "revert + toast on error" pattern verbatim.

Acceptance criteria

Out of scope

  • Editing provider/service on an existing row — the row's identity is (account_id, provider, service), so changing those is delete-then-create. Reset + feat(settings): create-override modal for AWS account overrides (closes #104) #106's modal already covers it.
  • The include_engines/exclude_engines/include_regions/exclude_regions/include_types/exclude_types array fields. Filing as their own issue (or leaving API-only) once user demand surfaces.
  • Azure/GCP — depends on the provider-aware modal work tracked separately.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions