fix(sync): name the export action, and stop shipping a raw i18n key - #529
Conversation
Two defects in the AeroSync Templates dialog, both visible on screen and both found while verifying #514 in the running app. The Bash format was labelled `Bash script (.sh)(common.default)`. The key `common.default` never existed in `en.json`, and the `|| 'default'` guard at the call site could not save it: `t()` returns the key itself on a miss, and a key is truthy, so the fallback was unreachable by construction. The key is added here and translated in all 46 locales, and the dead guard is gone rather than left to imply a safety it never provided. The export button named the format instead of the action. For bash and PowerShell it fell back to `templateFormatBash` and `templateFormatPwsh`, the same strings as the format radios, so the dialog showed two identical `Bash script (.sh)` controls and the only one that did anything read as one more format to choose from. It now says `Export script` for the three script formats and `Export Template` for `.aerosync`, which are both existing keys. Verified in the running app through the WebKit inspector, against a connected SFTP remote: the Bash radio reads `Bash script (.sh)(Default)`, and the action button reads `Export script` for `.aeroftp-script`, bash and PowerShell, `Export Template` for `.aerosync`. Gates: tsc clean, vitest 592/592, vite build clean, i18n:validate 47/47 with 0 placeholders and 0 orphans. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (48)
📝 WalkthroughWalkthroughThe Sync template dialog now simplifies export button label selection and uses a translated default hint. The common ChangesSync export localization
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@coderabbitai full review |
✅ Action performedFull review finished. Your included review limit is currently reached under our Fair Usage Limits Policy. This review may still proceed through usage-based billing if eligible. Your next included review will be available in 56 minutes. |
|
@coderabbitai review |
✅ Action performedReview finished.
|
Two defects in the AeroSync Templates dialog, both on screen, both found while verifying #514 in the running app rather than by reading the code.
The raw key
The Bash format radio shipped as
Bash script (.sh)(common.default).common.defaultwas never a key inen.json, and the call site's guard could not save it:t()returns the key itself when it misses, and a non-empty string is truthy, so the||branch was unreachable by construction. The app logged[i18n] Missing translation: common.defaulton every render of the dialog while the user read the key on screen.The key is added and translated across all 46 non-English locales, and the dead guard is removed rather than left in place implying a safety it never provided.
The button that named a format instead of an action
exportButtonLabelfell back tosyncPanel.templateFormatBashandsyncPanel.templateFormatPwshfor the two script formats. Those are the exact strings used by the format radios, so the dialog presented two identicalBash script (.sh)controls, and the only one that did anything read as one more format to pick.It now reads
Export scriptfor the three script formats andExport Templatefor.aerosync. Both are keys that already existed and are already translated, so this adds no new string beyondcommon.default.Verified in the app
Driven headlessly through the WebKit inspector against a connected SFTP remote, reading the labels back from the live DOM:
.aeroftp-scriptExport script.aerosyncExport TemplateExport scriptExport scriptand the Bash radio now reads
Bash script (.sh)(Default).Gates
tsc --noEmitclean,vitest592/592,vite buildclean,i18n:validate47/47 with 0 placeholders and 0 orphan keys. No Rust touched.Summary by CodeRabbit
Bug Fixes
Localization