feat(frontend): allow continue anyway in unavailable exe path alert dialog#1375
feat(frontend): allow continue anyway in unavailable exe path alert dialog#1375
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds a "Continue Anyway" option to the unavailable executable path alert dialog, allowing users to proceed despite running SJMCL from a temporary or invalid directory. Previously, users could only exit the application when this warning appeared.
Changes:
- Added "btnContinue" translation key to English and Simplified Chinese locale files
- Modified the alert dialog to include a "Continue" button alongside the existing "Exit" button
- Restructured the dialog footer to use an HStack for button grouping
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| src/locales/zh-Hans.json | Added Simplified Chinese translation "仍要运行" for the continue button |
| src/locales/en.json | Added English translation "Run Anyway" for the continue button |
| src/components/modals/unavailable-exe-path-alert-dialog.tsx | Added continue button with ghost variant that calls onClose handler, reorganized footer layout with HStack |
| "title": "Unsafe Execution Path", | ||
| "content": "SJMCL is currently running from a temporary or invalid directory. Your settings and game data may be lost. Please move SJMCL to another location and run it again." | ||
| "content": "SJMCL is currently running from a temporary or invalid directory. Your settings and game data may be lost. Please move SJMCL to another location and run it again.", | ||
| "btnContinue": "Run Anyway" |
There was a problem hiding this comment.
The new translation key "btnContinue" is missing from the Traditional Chinese locale file (zh-Hant.json). All locale files should be updated consistently to ensure the feature works correctly for all supported languages. Add the translation for "Run Anyway" in Traditional Chinese.
| {t("General.exit")} | ||
| </Button> | ||
| <HStack ml="auto" spacing={3}> | ||
| <Button variant="ghost" onClick={onClose}> |
There was a problem hiding this comment.
The "Continue" button should be assigned the cancelRef to mark it as the least destructive action in the AlertDialog. In Chakra UI AlertDialog, the leastDestructiveRef should point to the button that performs the safer, non-destructive action (continuing) rather than the destructive action (exiting). Add ref={cancelRef} to the Button with variant="ghost" at line 52.
| <Button variant="ghost" onClick={onClose}> | |
| <Button ref={cancelRef} variant="ghost" onClick={onClose}> |
| "title": "Unsafe Execution Path", | ||
| "content": "SJMCL is currently running from a temporary or invalid directory. Your settings and game data may be lost. Please move SJMCL to another location and run it again." | ||
| "content": "SJMCL is currently running from a temporary or invalid directory. Your settings and game data may be lost. Please move SJMCL to another location and run it again.", | ||
| "btnContinue": "Run Anyway" |
There was a problem hiding this comment.
The new translation key "btnContinue" is missing from the French locale file (fr.json). All locale files should be updated consistently to ensure the feature works correctly for all supported languages. Add the translation for "Run Anyway" in French.
| "title": "Unsafe Execution Path", | ||
| "content": "SJMCL is currently running from a temporary or invalid directory. Your settings and game data may be lost. Please move SJMCL to another location and run it again." | ||
| "content": "SJMCL is currently running from a temporary or invalid directory. Your settings and game data may be lost. Please move SJMCL to another location and run it again.", | ||
| "btnContinue": "Run Anyway" |
There was a problem hiding this comment.
The new translation key "btnContinue" is missing from the Japanese locale file (ja.json). All locale files should be updated consistently to ensure the feature works correctly for all supported languages. Add the translation for "Run Anyway" in Japanese.
| "btnContinue": "Run Anyway" | |
| "btnContinue": "とにかく実行" |
Checklist
This PR is a ..
Related Issues
Description
Additional Context