fix: show error message for duplicate env var keys by Felipeness · Pull Request #5251 · unkeyed/unkey

@Felipeness

The Zod superRefine validation already catches duplicate keys but
only marks the second occurrence. This change flags all rows with
the same key so users can see which entries conflict. Also adds a
reason tooltip to the disabled save button.

Fixes unkeyed#5219

ogzhanolguncu

@Felipeness

Clear stale duplicate-key errors when a variable's environment
is changed, since the compound key includes the environment ID.

Addresses review feedback on unkeyed#5251

Felipeness

Merge upstream changes (RemoveButton import from unkeyed#5211) with our
UseFormTrigger addition, keeping both imports.
useFieldArray.remove() does not re-trigger array-level superRefine
validation, so removing one of two duplicate rows left the remaining
row showing a stale "Duplicate key" error. Calling trigger("envVars")
after remove() forces re-validation and clears the error.

ogzhanolguncu

@autofix-ci