feat(#442): categorized env keys screen with add/remove, search, and gateway restart (#464)

* feat(#442): categorized env keys screen with add/remove, search, and gateway restart

- Group env vars by category (LLM Providers, Tool API Keys, Messaging
  Platforms, Agent Settings, Other) with collapsible AnimatedVisibility
  sections matching MCP screen pattern
- Add new env var form (PUT /api/env) with key/value inputs
- Delete env var via DELETE /api/env with EnvVarDeleteRequest body
- Reveal/hide/edit inline per-card controls
- Search bar filtering across key names and descriptions
- Gateway restart banner with one-click action when changes are dirty
- Track keysChanged flag showing restart prompt after mutations
- Wire delete endpoint in HermesApiService using @HTTP(hasBody=true)
- Add EnvVarDeleteRequest data model class

* fix(#442): update test to match new categorized KeysViewModel API

* fix(#442): satisfy ktlint multiline-expression-wrapping rule

---------

Co-authored-by: Hermes Agent <hermes@agent.local>
This commit is contained in:
M57andHermes Agent authored and GitHub committed 2026-07-03 23:04:06 +03:00
1 parent 5be4075d95
commit e74fe46a5f
6 files changed
+659 -147

No files matched your search

@@ -24,6 +24,7 @@ import com.m57.hermescontrol.data.model.DebugShareResponse
import com.m57.hermescontrol.data.model.DeleteWebhookResponse
import com.m57.hermescontrol.data.model.DoctorResponse
import com.m57.hermescontrol.data.model.EnvVarConfig
import com.m57.hermescontrol.data.model.EnvVarDeleteRequest
import com.m57.hermescontrol.data.model.EnvVarRevealRequest
import com.m57.hermescontrol.data.model.EnvVarRevealResponse
import com.m57.hermescontrol.data.model.EnvVarUpdate
@@ -87,6 +88,7 @@ import retrofit2.Response
import retrofit2.http.Body
import retrofit2.http.DELETE
import retrofit2.http.GET
import retrofit2.http.HTTP
import retrofit2.http.PATCH
import retrofit2.http.POST
import retrofit2.http.PUT
@@ -482,6 +484,11 @@ interface HermesApiService {
@Body request: EnvVarRevealRequest,
): Response<EnvVarRevealResponse>
@HTTP(method = "DELETE", path = "api/env", hasBody = true)
suspend fun deleteEnvVar(
@Body request: EnvVarDeleteRequest,
): Response<Unit>
@POST("api/ops/backup")
suspend fun triggerBackup(): Response<ActionResponse>