Fix KVEditor duplicate key rename validation
Prevent users from renaming a KVEditor entry to an existing key and show inline validation errors.
This commit is contained in:
@@ -73,9 +73,9 @@ Issues are grouped by category and ordered roughly by severity. Each entry descr
|
||||
|
||||
---
|
||||
|
||||
### TASK-004 — `KVEditor` key rename silently overwrites duplicate keys
|
||||
### TASK-004 — `KVEditor` key rename silently overwrites duplicate keys (done)
|
||||
|
||||
**Where found:** `frontend/src/components/config/KVEditor.tsx`, `handleKeyChange` function (lines 14–20).
|
||||
**Where fixed:** `frontend/src/components/config/KVEditor.tsx`, `frontend/src/components/config/configStyles.ts`, `frontend/src/components/config/__tests__/KVEditor.test.tsx`
|
||||
|
||||
**Goal:** Before applying a key rename, check whether `newKey` already exists in `entries`. If it does, show a validation error inline (a `MessageBar` beneath the affected input row or a red border via `validationState="error"` on the Fluent UI `Input`). Block the `onChange` call until the conflict is resolved.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user