confirm before discarding skill changes - #277
Conversation
morgmart
left a comment
There was a problem hiding this comment.
🤖 Automated code review
REQUEST_CHANGES. The discard guard can still lose an intentional color choice because dirty detection compares rendered colors rather than the persisted color state. This meaningful UI change also lacks the required screenshot or short screen recording. Supplied GitHub checks are currently pending and still govern merge readiness.
Deterministic publication result: 1 blocking and 0 non-blocking inline finding(s) publishable; 0 duplicate(s) suppressed; 1 blocking screenshot-evidence requirement(s) in this review body.
🤖 Blocking · Screenshots needed
This PR changes a meaningful user-facing experience. Please add screenshots or a short screen recording so the visual result can be reviewed. Screenshots are review evidence; they do not replace accessibility, responsive, theme, localization, or behavior validation.
|
🤖 Addressed the blocking dirty-state feedback in |
morgmart
left a comment
There was a problem hiding this comment.
🤖 Automated code review
APPROVE. Fresh Engineering review found no publishable findings. The prior persisted-color and description-normalization issue is fixed with discriminating regression coverage. Supplied GitHub checks are structurally valid and successful; required checks still govern merge readiness.
Deterministic publication result: 0 blocking and 0 non-blocking inline finding(s) publishable; 0 duplicate(s) suppressed; 0 blocking screenshot-evidence requirement(s) in this review body.
Pending checks: 1 check(s) are not complete.
This approval reflects the completed code review only; merge readiness remains governed by the repository's required checks.
Category: fix
User Impact: Users are warned before unsaved work in the Skill Builder is discarded.
Problem: Clicking outside the Skill Builder, pressing Escape, or closing it could immediately erase in-progress work. Solution: Track meaningful form changes and use the existing destructive confirmation dialog to let users keep editing or explicitly discard their changes.
File changes
src/features/skills/ui/SkillEditor.tsx
Detects unsaved create and edit changes, routes every close request through one guard, and presents the shared AlertDialog before discarding work.
src/features/skills/ui/tests/SkillEditor.test.tsx
Covers pristine closes, Cancel, Escape, outside clicks, keeping edits, confirmed discard, and existing-skill edits.
src/shared/i18n/locales/en/skills.json
Adds English confirmation copy for keeping or discarding unsaved skill changes.
src/shared/i18n/locales/es/skills.json
Adds the corresponding Spanish confirmation copy.
Reproduction steps
Screenshots / demos
The new confirmation dialog uses Berd's existing AlertDialog design-system primitive.
Resolves BOT-1731.