Repository navigation
feat(workbench): 侧栏按钮可以隐藏,布局状态记录隐藏的入口 - #34
Merged
Merged
Conversation
- chrome layout 的 State 新增 hidden,按 placements 的顺序列出用户隐藏的侧栏按钮;旧状态没有这个字段也能读入。
- 新增 Action::SetHidden { id, hidden }。隐藏时关闭该入口的面板,取消隐藏不改变面板状态;隐藏的入口保留原来的分区和位置,取消隐藏后回到原处。
- 隐藏的入口仍可以由快捷键或命令打开面板,打开后依然保持隐藏;移动隐藏的入口也保持隐藏。
- 只有侧栏按钮能隐藏,标题栏和状态栏的按钮返回 invalid_request;Reset 恢复全部入口;Normalize 去掉未知、重复和非侧栏的 id。
- 同步更新 command.rs 与 rust-core-api.md 中 workbench.chromeLayout.reduce 的说明。
xiaoyumuxi
marked this pull request as ready for review
November 14, 2026 05:15
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
无单独 Issue。来自用户反馈:桌面端(Viva)在侧栏把按钮隐藏后再也找不回来。桌面端改动在 1lck/Lithe-IDEA 的配套 PR(见下方评论),它把 Core 固定到本 PR 的提交。
改动
workbench.chromeLayout.reduce的布局状态可以记录隐藏的侧栏按钮:State新增hidden,按placements的顺序列出隐藏的侧栏按钮。字段带#[serde(default)],旧的保存状态没有它也能读入。Action::SetHidden { id, hidden }({"kind":"setHidden","id":"…","hidden":true}):SetOpen/Toggle)打开面板,打开后依然隐藏。invalid_request。Reset恢复全部入口;Normalize去掉hidden里未知、重复和非侧栏的 id。command.rs的命令说明和rust/contracts/rust-core-api.md中workbench.chromeLayout.reduce一节。没有改插件契约、能力版本或插件函数协议。
验证
cargo fmt --all -- --check./scripts/rust-core/verify-rust-core-comments.shcargo clippy --locked --workspace --all-targets -- -D warningscargo test --locked --workspacedesktop-go.sh test ./internal/core/ ./internal/workbench/,LITHE_CORE_RUST_DIR指向本提交新增的
chrome_layout.rs测试覆盖:隐藏关闭面板、取消隐藏保留面板状态、隐藏后保留位置、隐藏入口由快捷键打开、移动隐藏入口、非侧栏入口和未知 id 报错、Reset、Normalize,以及没有hidden字段的旧状态。未能执行的检查:没有在 Windows 上运行
cargo test。