Repository navigation
feat(remote): 保存的连接带颜色和分组,列表按 Core 算好的分区显示(#2231) - #152
Merged
Merged
Conversation
- SavedConnection 新增可选 color(red/orange/yellow/green/blue/purple)和 group(去首尾空白,最多 64 字符,不含控制字符;空白视为不分组;与其他条目只差大小写时沿用已有写法)。 - Connections::sections() 按分组第一次出现的顺序给出分区,未分组的放最后;remote.connections 和 remote.editConnections 的结果都带 sections,客户端照着显示,不自己分组或排序。 - remote.editConnections 的 save 接收 color 和 group,缺省即清除;文档仍为 version 1,未设置时不写这两个字段。 - 更新契约 rust-core-api.md 的 Saved connections 一节和测试。
xiaoyumuxi
marked this pull request as ready for review
November 21, 2026 06:30
29 of 33 tasks
xiaoyumuxi
added a commit
to 1lck/Lithe-IDEA
that referenced
this pull request
Nov 21, 2026
* feat(desktop): 远程开发窗口改为分组列表加概览,连接可设颜色和分组 (#2231) - 左侧列表按 Core 给出的分组顺序列出连接,分组标题带数量,未分组的排在最后;每行带颜色条 - 选中已保存的连接先显示概览:颜色图标、名称、分组、地址和跳板机,本次运行最近一次测试得到的主机信息,以及逐项列出的连接设置(未填写的显示实际回退值) - 点“编辑”才进入表单,表单按名称与颜色、主机与端口、用户名与身份验证、分组分行,高级选项折叠;“取消”回到原来的连接 - 颜色和分组随连接保存在 Core(固定 Core 57230e6,Lithe-IDEA/Lithe-core-rust#152),分组可选已有分组或新建 - 新增新建、编辑、取消编辑三个操作日志;更新无头测试与截图 * fix(desktop): 固定 Core main 53c7cfa,测试结果只为已保存的连接保留,说明里写明未填项显示回退规则 (#2231)
1 task done
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.
关联 Issue
1lck/Lithe-IDEA#2231(远程开发完整设计):远程开发窗口重设计。窗口参照 Motty 的“新建主机”,给每个保存的连接加颜色和分组,侧栏按分组列出连接。颜色和分组存在 Core 管理的连接文档里,以后从 Motty 导入时也能对应上它的分组和颜色。
类型
color和group;remote.connections、remote.editConnections的结果新增sections改动说明
数据(
crates/remote/src/client/connections.rs)SavedConnection新增两个可选字段,两者都不会传给 SSH:color:red、orange、yellow、green、blue或purple。不设置表示没有颜色,明暗主题下的具体色值由客户端决定。group:分组名。group的处理:{ field: "group", reason: "tooLong" | "invalid" }。group;color出现未知值时,整份文档按无法解析处理。Connections::sections():null分区;save()多接收一个Label { color, group }。缺省就是清除,所以每次保存都要带上条目当前的值。命令(
crates/workspace/src/connections.rs)remote.editConnections的save接收color和group,缺省表示不设置。remote.connections和remote.editConnections的结果都带sections: [{ group: string|null, ids: [id] }]。分组、排序这类列表投影由 Core 计算,桌面端照着显示,不自己分组或排序。契约(
rust/contracts/rust-core-api.md的 Saved connections 一节)color?、group?和sections的结构与顺序规则,以及save对分组的处理。color或group的文档,会因为出现未知字段而拒绝。远程开发还在预发布阶段,所以没有升版本号。范围
改动只涉及
crates/remote、crates/workspace和契约文档,dispatcher 不需要改。验证
cargo test -p lithe-remote -p lithe-workspace:104 个通过。新增labels_are_saved_and_groups_become_sections_in_first_use_order、colors_and_groups_are_saved_and_listed_by_section,文档校验补了三种非法情况。cargo test -p lithe-core remote:通过。cargo clippy -p lithe-remote -p lithe-workspace -p lithe-core --all-targets --all-features -D warnings:通过。Windows 目标(x86_64-pc-windows-msvc)也通过。cargo fmt --all --check、scripts/rust-core/verify-rust-core-comments.sh:通过。桌面端在 Draft PR 里固定到本分支的 commit,本 PR 合入后再换成 main 上的 commit。