Repository navigation
feat(home): 支持配置首页不显示「最近连接」分组 - #443
Merged
Merged
Conversation
问题 (issue #388): 卡片模式下用户关闭「最近连接」分组后,重启应用该分组又会出现——此前没有任何设置控制其显隐,分组无法被持久关闭。 修复: - AppSettings 新增 home_show_recent_connections: bool,#[serde(default = "default_true")] 保证旧配置向后兼容(默认显示)。 - 设置页 General 新增「连接显示」分组,提供开关并即时持久化。 - 首页分组内容区与导航主页两处最近连接渲染均按设置短路,关闭后仅显示各分组内的连接。 测试: - settings 往返测试:默认开启、关闭后序列化往返、旧配置缺省字段回退开启。 - 渲染回归测试:两处渲染点被设置门控、设置页开关持久化。
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.
概述
Closes #388
卡片模式下用户希望可以配置不显示「最近连接」分组,只显示各分组设备;此前关闭该分组后重启应用又会重新出现,因为没有设置控制其显隐。
改动
crates/core/src/settings.rs:AppSettings新增home_show_recent_connections: bool,#[serde(default = "default_true")]保证旧配置文件缺省该字段时回退默认显示(向后兼容)。main/src/settings/connection_display_settings.rs(新文件): 设置页 General 新增「连接显示」分组,提供开关,修改后通过update_and_save即时持久化。main/src/home_tab/content.rs: 分组内容区与导航主页两处render_recent_group调用按设置短路,关闭后仅显示各分组内的连接。截图说明
设置 → 通用 → 连接显示 → 「显示最近连接分组」开关;关闭后首页不再渲染最近连接区,重启后保持关闭。
测试
home_show_recent_connections_defaults_on_and_round_trips: 默认开启、关闭后序列化往返、旧配置缺省字段回退开启recent_group_respects_home_show_recent_connections_setting: 渲染门控与设置页持久化的回归测试cargo test -p main --bin navop -- --test-threads=1: 701 passedcargo test -p one-core --lib -- --test-threads=1: 836 passed(注:workspace_hierarchy_engine_tests在 main 基线上即存在并发 flaky,与本次改动无关,单线程稳定通过)