Skip to content

feat(ui): 连接页可按应用分组,同一程序的连接收进可折叠的分组 - #152

Merged
Ray-lea merged 8 commits into
Ray-lea:mainfrom
digital-bombyx:feat/connections-group-by-app
Nov 22, 2026
Merged

Ray-lea merged 8 commits into
Ray-lea:mainfrom
digital-bombyx:feat/connections-group-by-app

Conversation

@digital-bombyx

@digital-bombyx digital-bombyx commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

改动概述 / Summary

连接页新增“按应用 / 列表”视图切换。按应用显示时,同一可执行文件的连接收进一个可折叠的分组,连接很多的程序(代理、浏览器)只占一行。

Adds an Apps / List view switch to the Connections page. In Apps view, connections of one executable fold under a single heading, so programs with many connections (proxies, browsers) take one row.

改动原因 / Motivation

连接列表按行平铺,一个程序可能占据大半个列表。例如本地代理 xray 有上百条 127.0.0.1:10808 的连接,其他程序被挤到很远,只能靠搜索或滚动查找。进程页已有按应用分组,连接页没有对应的视图。

The flat list lets one program fill most of it: a local proxy such as xray holds 100+ connections on 127.0.0.1:10808 and pushes every other program far down. The Processes page already groups by app; Connections had no such view.

改动思路 / Approach

分组在现有的排序、筛选、搜索与“隐藏系统进程”之后进行,仍在后台线程构建,因此筛选和排序语义不变。分组复用 Row 已有的折叠字段(expandable / expanded / members / depth)以及名称单元格的箭头、缩进与计数徽标,不新增绘制代码。按规范化的可执行文件路径分组,路径缺失时按文件名分组。不同安装路径的同名程序分开显示。默认仍为“列表”视图,现有用户的界面不变。

Grouping runs after the existing sort, filters, search and system-process hiding, still on the background thread, so their semantics are unchanged. It reuses Row's fold fields and the name cell's chevron, indent and count badge — no new drawing code. Groups use the normalized executable path, falling back to the file name when the path is unavailable. Programs with the same name in different locations remain separate. The default stays List.

改动明细 / Changes

  • lists.rs:ListSpec 新增 grouped、opened;group_connections 按程序分组,分组按其第一条连接在当前排序中的位置排列,组内沿用列排序;只有一个连接的程序保持普通行。
  • layout.rs / widgets.rs:连接页页面栏加入视图切换(复用 shell.viewMode.* 文案与图标)。
  • backend.rs:Action::ConnectionView;Fold 处理 c: 分组键并保存展开状态;Enter、双击与 ←/→ 折叠分组。
  • menus.rs:分组行的右键菜单:展开/折叠、转到进程、结束进程(仅单个进程拥有时可用);分组行没有备注与置顶。
  • tables.rs / cells.rs:连接页的分组行使用箭头、缩进与计数徽标;分组行不显示状态点。
  • test_control.rs:新增 connectionView 测试控制。
  • 文档:docs/guide/README.md(连接按应用分组、页面栏),docs/architecture/frontend.md(偏好键)。

新增功能(可选)/ New features (optional)

  • 入口:连接页页面栏左侧的视图切换(按应用 / 列表,仅图标,悬停显示名称)。默认“列表”。
  • 分组行:程序图标、名称、连接数徽标;默认折叠。单击箭头、双击、Enter 或 ←/→ 展开或折叠。
  • 只有一个连接的程序显示为普通行;没有所属进程或进程已退出的连接分别归组。
  • 搜索时含匹配项的分组自动展开,且不能折叠(与进程页分类标题一致);无匹配时沿用原来的空列表提示。
  • 所选视图(connectionView)与展开的分组(openedConnectionApps)在重启后保留。

影响与依赖 / Impact and dependencies

  • 影响范围 / Affected behavior: 桌面程序与官网演示的连接页;默认视图为“列表”。
  • 兼容性与权限 / Compatibility and permissions: 新增两个界面偏好键,旧版本忽略;不涉及历史格式、IPC 或权限。
  • 依赖 PR 与合并顺序 / PR dependencies and merge order: 无 / None.

改动后界面截图 / UI screenshots

开发构建,实时数据,英文界面,深色主题,100% 缩放;进程描述为系统语言(俄文)。
Dev build, live data, English UI, dark theme, 100% scale; process descriptions follow the system language (Russian).

改动前:列表 / Before: List 改动后:按应用(折叠)/ After: Apps (collapsed)
Connections, List view Connections, Apps view

维护者复核

按维护者确认的规则,不同安装路径的同名程序分组显示,缺少路径时按文件名归组。新增路径归一化与缺失路径的回归测试。官网模拟数据的 15 条连接可折叠为 7 行;展开一组显示其中 5 条连接,切回列表恢复 15 行。官网 TypeScript 和多语言检查通过。

提交时验证 / Original validation

  • 验证提交或构建版本 / Tested commit or build: 75fc9cc(代码),开发构建 cargo build -p argus --bin argus
  • 环境与数据来源 / Environment and data source: Windows 11 (26200),实时采集,英文界面,深色主题;独立测试标识 dev.argus.taskmanager.test.conngroups
命令或操作步骤 / Command or steps 预期结果 / Expected 实际结果与证据 / Actual result and evidence
cargo test -p argus --lib 全部通过,含新增的 grouped_connections_fold_under_their_programs、a_program_with_several_processes_is_one_group_without_a_pid 367 passed, 0 failed
cargo clippy -p argus --all-targets -- -D warnings 无警告 通过
切换到“按应用” 多连接程序显示为折叠的分组行,单连接程序为普通行 符合,见截图
单击箭头 / 双击 / Enter / ←→ 展开与折叠 符合
搜索 10808 含匹配的分组自动展开,仅显示匹配行 符合,见截图
分组行右键 展开/折叠、转到进程、结束进程 符合
重启测试实例 视图与展开的分组保留 符合
切回“列表” 与改动前相同 符合
  • 未覆盖的场景与原因 / Unverified scenarios and reasons: 未运行完整 pnpm check(只改动 src-gpui 前端与文档);未核对浅色主题与小窗口。

提交前检查 / Checklist

  • 标题与提交信息符合 Conventional Commits / The title and commit messages follow Conventional Commits.
  • 已完成与改动范围相符的验证,并填写实际结果 / Validation appropriate to the change is complete and actual results are recorded.
  • 涉及 UI 的改动已附可直接查看的改后截图,交互与显示行为修复同样适用 / UI changes include viewable after screenshots, including interaction and visibility fixes.
  • 涉及持续开销的改动已附对照测量 / N/A:仅在按应用视图下对已排序的行做一次线性分组
  • 新增或修改文案已同步全部支持的语言,遵循术语表,并通过 pnpm i18n / N/A:复用现有的 shell.viewMode.*,无新增文案
  • 行为变化已同步相关文档及受影响的官网演示 / 使用指南、测试控制文档与官网连接页演示已更新
  • 依赖变化已更新 THIRD-PARTY-NOTICES.txt / N/A

@chatgpt-codex-connector

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-20T08:43:48.092475Z
We couldn’t complete this review. Comment @codex review to try again.
d5815c7 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

页面栏新增“应用 / 列表”切换。按应用显示时,同一可执行文件的连接归入一个分组:
标题行显示图标、名称与连接数,默认折叠,单击箭头、双击、Enter 或方向键展开,
展开状态与所选视图会被记住。只有一个连接的程序仍显示为普通行;搜索时含匹配项的
分组自动展开。分组标题的右键菜单提供展开/折叠、转到进程与结束进程。
@digital-bombyx
digital-bombyx force-pushed the feat/connections-group-by-app branch from d5815c7 to 4a1d4ab Compare November 21, 2026 11:09
Ray-lea and others added 3 commits November 21, 2026 15:51
Co-authored-by: bronyaicu <264752859+bronyaicu@users.noreply.github.com>
Co-authored-by: bronyaicu <264752859+bronyaicu@users.noreply.github.com>
Co-authored-by: bronyaicu <264752859+bronyaicu@users.noreply.github.com>

@Ray-lea Ray-lea left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已核对按路径分组和无路径时按文件名分组的回归测试。桌面模拟数据的 30 条连接折叠为 6 行,搜索自动展开 9 条匹配连接。两种绘制路径的 32 张截图逐像素一致,官网演示也通过折叠、展开和切回列表的检查。

Ray-lea and others added 2 commits November 21, 2026 16:20
Co-authored-by: bronyaicu <264752859+bronyaicu@users.noreply.github.com>
Co-authored-by: bronyaicu <264752859+bronyaicu@users.noreply.github.com>
@Ray-lea
Ray-lea merged commit 936fc7b into Ray-lea:main Nov 22, 2026
2 checks passed
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.

2 participants