Repository navigation
Conversation
第一版把「选择文件…」和可编辑路径放在同一行,且候选目录是 app_kit 自己 按 dirs::config_dir() 拼的一套,与全量产品实际的目录解析规则并不一致: 独立产品的目录名已被 configure_app_dir_names 换成 .navop-data-dev 之类, 探测一旦漏目录就只能靠用户手填,看起来就是「识别不到路径」。 - 目录规则收敛到 one_core::app_dirs:新增 full_product_config_dirs / full_product_database_candidates 与 DATABASE_FILE_NAME 常量(storage::get_db_path 同步复用),按全量产品 自己的规则覆盖安装态 ~/.config/navop、Windows %APPDATA%\navop、迁移前 的 one-hub、开发构建 ~/.navop-dev/config 与旧版数据目录根;app_kit 的 full_product_candidates 直接复用,不再自带一套候选。 - 便携目录 <exe>/data/config 故意不猜:独立产品自己的便携数据目录同样是 这个形状,猜错会把独立产品的库当成全量产品的库。 - 探测在多个非空候选里取最近修改的库(比较主库与 -wal 旁文件 mtime), 有多套数据目录时按「最后在用的那个」选。 - 弹窗默认只展示自动识别结果与主按钮,路径输入框收起;便携版/多套数据 目录时点「换一个文件…」再展开选择,并在提示里说明常规位置与便携版位置。 - 补充 core 与 app_kit 单测(候选名称/唯一性、不猜便携目录、最近修改优先), 更新 docs/design/navop-product-split.md。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
背景
#494 让独立产品(
navop-shell/navop-data)的「从全量产品导入连接」可以手动选源库,但默认交互和目录规则还不对:app_kit自己按dirs::config_dir()/data_dir()拼的一套,和全量产品实际的目录解析(one_core::app_dirs)不一致。独立产品的目录名在启动时已被configure_app_dir_names换成.navop-data-dev之类,探测一旦漏掉某个目录,用户只能手填。改动
one_core::app_dirs新增full_product_config_dirs/full_product_database_candidates与DATABASE_FILE_NAME常量,按全量产品自己的规则给出候选——安装态~/.config/navop(Windows%APPDATA%\navop)、迁移完成前的历史目录one-hub、开发构建~/.navop-dev/config、旧版本用过的数据目录根。storage::get_db_path同步复用该常量。app_kit::import::full_product_candidates直接复用,不再自带一套。<exe>/data/config故意不进候选——独立产品自己的便携数据目录同样是这个形状,猜错会把独立产品的库当成全量产品的库;便携版走「换一个文件…」。-wal旁文件的 mtime,选最近修改的那个,而不是列表里第一个能读通的。data/config/one-hub.db)。docs/design/navop-product-split.md§22.2。验证
cargo test -p app_kitcargo test -p one-core --lib app_dirscargo clippy -p app_kit --lib --tests/-p one-core --libcargo check -p navop_app --lib~/.config/navop/one-hub.db(128 连接),跳过~/Library/Application Support/navop/one-hub.db的空库不含 CHANGELOG 与版本 bump。