Repository navigation
Commit 8186900
committed
fix(export): notify the user when a settings export is refused
exportSettings swallows every failure (the caller awaits it without a try), so the
refusal this unit introduced - refuseSymlinkTarget: true at the safeWriteJson call in
src/core/config/importExport.ts - was invisible: the save dialog closed, the console
line is not user-facing, and the file the user asked for simply did not exist.
The notification uses the channel and the key shape the neighbouring import route
already uses (settings_import_failed at the end of importSettingsWithFeedback), so no
new notifying layer is invented: common:errors.settings_export_failed, interpolated
with the writer's own reason, which names the path it refused and the destination it
would have written through.
- src/core/config/importExport.ts: notify in the catch; the log line and the
swallow-everything contract are unchanged.
- src/i18n/locales/*/common.json: settings_export_failed added to all 18 catalogues in
the same commit as the call site, with the same {{error}} placeholder as the import
key. The export noun in each language is the one that catalogue already uses elsewhere
(footer.settings.export in webview-ui settings.json, info.mode_exported in the same
src common.json).
- src/core/config/__tests__/importExport.spec.ts: asserts the notification fires on the
refusal path, that the reason travels, that the import key is not reused, and that the
export still resolves rather than rejecting.
Review thread: PRRT_kwDOSK-bwM60746v (src/utils/safeWriteJson.ts:72).
Gates printed before this commit (worktree wt-s3-1405, pinned node v22.23.4):
prettier --check <20 touched files> exit 0
eslint --prune-suppressions --max-warnings=0 on the two .ts files exit 0
tsc --noEmit -p tsconfig.json (src) exit 0, 0 error lines
vitest run --config vitest.core.config.ts core/config/__tests__/importExport.spec.ts
55 passed (55)
node scripts/find-missing-translations.js exit 0, all areas complete
node scripts/check-i18n-interpolation.js exit 0, 835 files, no missing
interpolation variables
(negative control: the same interpolation run at main tip e487cd7 printed 833
files, exit 0 - the +2 are this branch's two added source files)1 parent 94dc7c4 commit 8186900
20 files changed
Lines changed: 74 additions & 5 deletions
File tree
- src
- core/config
- __tests__
- i18n/locales
- ca
- de
- en
- es
- fr
- hi
- id
- it
- ja
- ko
- nl
- pl
- pt-BR
- ru
- tr
- vi
- zh-CN
- zh-TW
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| 27 | + | |
27 | 28 | | |
28 | 29 | | |
29 | 30 | | |
| |||
1686 | 1687 | | |
1687 | 1688 | | |
1688 | 1689 | | |
1689 | | - | |
1690 | | - | |
1691 | | - | |
1692 | | - | |
| 1690 | + | |
| 1691 | + | |
| 1692 | + | |
| 1693 | + | |
| 1694 | + | |
| 1695 | + | |
| 1696 | + | |
| 1697 | + | |
| 1698 | + | |
| 1699 | + | |
| 1700 | + | |
| 1701 | + | |
| 1702 | + | |
| 1703 | + | |
| 1704 | + | |
| 1705 | + | |
| 1706 | + | |
| 1707 | + | |
| 1708 | + | |
| 1709 | + | |
| 1710 | + | |
| 1711 | + | |
| 1712 | + | |
| 1713 | + | |
| 1714 | + | |
| 1715 | + | |
| 1716 | + | |
| 1717 | + | |
| 1718 | + | |
| 1719 | + | |
| 1720 | + | |
| 1721 | + | |
| 1722 | + | |
| 1723 | + | |
| 1724 | + | |
| 1725 | + | |
| 1726 | + | |
| 1727 | + | |
| 1728 | + | |
| 1729 | + | |
| 1730 | + | |
| 1731 | + | |
| 1732 | + | |
| 1733 | + | |
| 1734 | + | |
| 1735 | + | |
1693 | 1736 | | |
1694 | 1737 | | |
1695 | 1738 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
349 | 349 | | |
350 | 350 | | |
351 | 351 | | |
352 | | - | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
353 | 361 | | |
354 | 362 | | |
355 | 363 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| 50 | + | |
50 | 51 | | |
51 | 52 | | |
52 | 53 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 commit comments