Skip to content

feat(home): 支持配置首页不显示「最近连接」分组 - #443

Merged
feigeCode merged 1 commit into
mainfrom
feat/hide-recent-connections-388
Oct 22, 2026
Merged

feigeCode merged 1 commit into
mainfrom
feat/hide-recent-connections-388

Conversation

@feigeCode

Copy link
Copy Markdown
Owner

概述

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 passed
  • cargo test -p one-core --lib -- --test-threads=1: 836 passed(注:workspace_hierarchy_engine_tests 在 main 基线上即存在并发 flaky,与本次改动无关,单线程稳定通过)

问题 (issue #388):
卡片模式下用户关闭「最近连接」分组后,重启应用该分组又会出现——此前没有任何设置控制其显隐,分组无法被持久关闭。

修复:
- AppSettings 新增 home_show_recent_connections: bool,#[serde(default = "default_true")] 保证旧配置向后兼容(默认显示)。
- 设置页 General 新增「连接显示」分组,提供开关并即时持久化。
- 首页分组内容区与导航主页两处最近连接渲染均按设置短路,关闭后仅显示各分组内的连接。

测试:
- settings 往返测试:默认开启、关闭后序列化往返、旧配置缺省字段回退开启。
- 渲染回归测试:两处渲染点被设置门控、设置页开关持久化。
@feigeCode
feigeCode merged commit 254a87c into main Oct 22, 2026
8 checks passed
@feigeCode
feigeCode deleted the feat/hide-recent-connections-388 branch October 22, 2026 02:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: 可以增加不显示最近连接吗?

1 participant