feat(templates): confirm before leaving wizard with draft content

Intercept route changes and tab close when the template wizard has
unsubmitted content so users can save a draft, discard, or stay instead
of silently losing their progress.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-07 12:07:51 +08:00
parent c1e7c5e90c
commit 7443bb3260
3 changed files with 156 additions and 10 deletions
@@ -939,6 +939,13 @@ const enUS = {
queued: 'Task submitted. The article is now waiting in the generation queue.',
submitted: 'Generation task submitted. Refreshing article data.',
},
leaveConfirm: {
title: 'Save as draft?',
content: 'This template wizard has content. Save it as a draft before leaving.',
stay: 'Keep editing',
discard: 'Leave without saving',
save: 'Save draft',
},
},
},
article: {