feat(desktop): add mutation review guardrails

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
Senior Frontend Engineer
2026-03-31 08:47:14 +00:00
parent bf6f8bc0bf
commit 35040ef0c9
7 changed files with 1084 additions and 125 deletions

View File

@@ -0,0 +1,37 @@
# HAC-31 Safe Mutation Guardrails
Date: 2026-03-31
Owner: Senior Frontend Engineer
Issue: HAC-31
## Goal
Harden current-phase writable operations without expanding product scope beyond existing string save and TTL controls.
## Scope
- add a scoped review step before string save
- add a scoped review step before TTL set and TTL removal
- block no-op mutation submits before they reach the desktop bridge or demo fallback
- preserve draft value and TTL input when a live mutation fails
## Explicit Non-Goals
- Add Key flow changes
- real delete execution
- non-string editing
- command-surface changes
- visual refresh beyond mutation clarity
## Implementation
- Added `apps/desktop/src/lib/mutation-guardrails.ts` for mutation summaries and no-op detection helpers.
- Updated `apps/desktop/src/App.tsx` so save and TTL actions open a shared review dialog with scoped current-vs-next details.
- Disabled string save when no value change is pending.
- Disabled TTL set when the requested TTL already matches the active TTL state.
- Kept live failure handling on the shared operator notice layer while preserving draft state for retry.
## Verification
- `pnpm --filter @redis-gui/desktop test`
- `pnpm run desktop:build`