Skip to content

confirm before discarding skill changes - #277

Merged
tulsi-builder merged 2 commits into
mainfrom
tulsi/bot-1731-confirm-discard-skill-builder
Sep 2, 2026
Merged

confirm before discarding skill changes#277
tulsi-builder merged 2 commits into
mainfrom
tulsi/bot-1731-confirm-discard-skill-builder

Conversation

@tulsi-builder

Copy link
Copy Markdown
Contributor

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

  1. Open Skills and select New skill.
  2. Enter a name, description, instructions, or choose a different color or save location.
  3. Click outside the editor, press Escape, click the close button, or select Cancel.
  4. Confirm the discard dialog appears and the editor remains open when choosing Keep editing.
  5. Repeat and choose Discard, then confirm the editor closes.
  6. Open an existing skill, edit a field, and confirm the same protection applies.

Screenshots / demos

The new confirmation dialog uses Berd's existing AlertDialog design-system primitive.

Resolves BOT-1731.

@tulsi-builder
tulsi-builder requested a review from a team September 2, 2026 16:24

@morgmart morgmart left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 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.

Comment thread src/features/skills/ui/SkillEditor.tsx
@tulsi-builder
tulsi-builder enabled auto-merge (squash) September 2, 2026 17:35
@tulsi-builder

Copy link
Copy Markdown
Contributor Author

🤖 Addressed the blocking dirty-state feedback in 79794386c and resolved the inline thread. The persisted nullable color choice now participates directly in dirty detection, while description normalization is shared with save semantics. Added both requested regression tests; all 112 Skills tests pass.\n\nI also captured the confirmation-dialog review evidence locally, but GitHub’s CLI/API does not support uploading a user attachment. I can add it to the PR body once the image is manually attached in GitHub.

@morgmart morgmart left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 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.

@tulsi-builder
tulsi-builder merged commit 5476a86 into main Sep 2, 2026
15 of 16 checks passed
@tulsi-builder
tulsi-builder deleted the tulsi/bot-1731-confirm-discard-skill-builder branch September 2, 2026 18:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants