feat(vault): pick a notebook vault folder on first run
Some checks failed
CI / Windows build (push) Has been cancelled

Phase 0 of the file-based storage plan (docs/plans/
2026-06-24-file-based-storage.md). Foundation only — no editor or
DB change yet.

- VaultService (SharedPreferences): stores the vault root path,
  vaultRootValid() = path set AND directory exists.
- VaultSetupScreen: first-run folder picker (file_picker, Windows).
- main.dart gates HomeScreen behind a valid vault, re-prompting if
  the saved folder is gone.
- Settings: a Vault section to change the folder.

Editors still use SQLite; later phases move annotations into
per-file sidecars under the vault. analyze clean, tests green.
This commit is contained in:
2026-06-24 20:45:16 +08:00
parent 875dabcd89
commit 9fcac47ef2
10 changed files with 655 additions and 3 deletions

View File

@@ -78,5 +78,18 @@
"boardBacklinks": "哪些链接到这里",
"boardNoBacklinks": "暂无其他便利贴链接到这里",
"boardDanglingLink": "没有名为“{target}”的便利贴",
"close": "关闭"
"close": "关闭",
"vaultSetupTitle": "选择笔记库",
"vaultSetupHeadline": "为你的笔记本选择一个文件夹",
"vaultSetupBody": "BadNote 会把你的笔记本都存放在你选择的一个文件夹里——就像 Obsidian 的库vault。请选择一个你能掌控的文件夹例如同步盘这样你的笔记会跟着文件一起走。",
"vaultChooseFolder": "选择文件夹",
"vaultMissingTitle": "笔记库文件夹不见了",
"vaultMissingBody": "找不到你选择的文件夹(可能被移动、删除,或所在磁盘已拔出)。请重新定位或另选一个。",
"vaultPickFailed": "无法打开文件夹选择器:{error}",
"vaultNotWritable": "该文件夹不可写,请另选一个。",
"vaultSection": "笔记库",
"vaultFolderLabel": "笔记库文件夹",
"vaultNoneSelected": "尚未选择文件夹",
"vaultChangeFolder": "更改笔记库文件夹",
"vaultUpdated": "笔记库文件夹已更新"
}