Repository navigation
Conversation
独立产品「从全量产品导入连接」只靠自动探测:探测不到时弹窗会跳到「迁移包」 页,而那一页只认迁移包 JSON,既看不到源库路径,也没有选择文件的入口,用户 只能手写路径——全量版装在便携目录、改过 --data-dir、或已卸载时就彻底走不通。 - 弹窗始终落在「从全量产品迁移」页,新增可编辑的源库路径输入框 + 「选择 文件…」原生选择器;探测结果仍会预填,清空输入框即重新探测。 - 两个页签统一按文件头(`SQLite format 3\0`)判断源文件:SQLite 库走全量 产品只读迁移,其余按迁移包 JSON 解析,所以「迁移包」页也能直接选 `one-hub.db`,改名或无扩展名不受影响。 - 手写路径支持 `~`、`file://` 与 Windows `%VAR%`,从文件管理器复制来的 带引号路径同样能读通。 - 探测在多个候选之间优先选真正带连接的库:全量产品目录里可能残留刚被独立 产品初始化出来的空库,只按「能读通」判断会导入 0 条连接。 - 新增 import_from_database / import_from_source_file / expand_source_path / is_sqlite_database 与对应单测,并补 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.
说明
dev 领先 main 1 个提交,本次只含「独立产品从全量产品导入连接」的修复,不含 CHANGELOG 与版本 bump。
提交
根因
独立产品(
navop-shell/navop-data)的「导入连接」弹窗只靠自动探测:探测不到时页面直接跳到「迁移包」页签,而这一页只认迁移包 JSON —— 既看不到源库路径,也没有选择文件的入口,错误提示还把人引到这一页手写路径。于是全量版装在便携目录、改过--data-dir、或已卸载时就彻底走不通。本机实测还有个坑:~/Library/Application Support/navop/one-hub.db是 0 字节空库,真库在~/.config/navop/one-hub.db,只要探测稍微宽松一点就会「识别到但导入 0 条」。修法
SQLite format 3\0)判断源文件:SQLite 库走全量产品只读迁移,其余按迁移包 JSON 解析,所以「迁移包」页也能直接选one-hub.db,改名或无扩展名不受影响。~、file://与 Windows%VAR%,从文件管理器复制来的带引号路径同样能读通。import_from_database/import_from_source_file/expand_source_path/is_sqlite_database与对应单测,并补docs/design/navop-product-split.md。验证
cargo test -p app_kit:154 passed(新增is_sqlite_database/pick_candidate/expand_source_path单测)cargo clippy -p app_kit --lib --tests:改动文件 0 warningcargo check -p navop_app --lib:通过