Repository navigation
feat(desktop): 侧栏按钮可以隐藏,隐藏的工具窗口列在“…”按钮里 - #1901
Merged
Merged
Conversation
xiaoyumuxi
marked this pull request as ready for review
November 14, 2026 06:05
23 of 29 tasks
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 / Linked issue
PR 类型 / Type
改动说明 / What changes
背景 / Why
Viva 桌面端的侧栏按钮可以拖动和移动,但没法隐藏。旧客户端(#1677)和 IDEA 都允许把不用的工具窗口按钮从侧栏收起,并在侧栏上留一个“…”按钮,列出被收起的窗口,随时可以找回。这个 PR 在 Viva 桌面端补上:右键隐藏,“…”找回。
改动 / Changes
scripts/desktop/build-desktop-core.sh的PINNED_CORE_REVISION升到 Lithe-core-rust#34 的合并提交1d4556b。workbench.chromeLayout.reduce新增setHidden动作,布局状态新增hidden。隐藏的按钮保留原分区和位置;隐藏时关闭它的工具窗口;只有工具栏按钮能隐藏,标题栏和状态栏按钮会被拒绝。internal/core/chrome.go):ChromeLayout新增Hidden,空时编码成[]。SetChromeHidden(id, hidden)和对应的精确 JSON 形状。core_test.go覆盖编码、隐藏后关闭窗口、保留位置、取消隐藏,以及拒绝隐藏标题栏按钮。chrome_view.gostripeButtonMenu):app.gohideEntry)。chrome_view.gohiddenToolWindows):catalog.go的hiddenToolWindowsIcon。hiddenToolWindowList/hiddenToolWindowRow):tool.<id>命令,commands.go把前缀提成常量toolCommandPrefix。workbench-layout-v2.json,重启后仍然隐藏。app.action.performed,动作名分别是workbench.toolWindow.hideEntry、workbench.toolWindow.showHidden、workbench.toolWindow.unhide。native.hideEntry、native.toolWindows、mac.workbench.unhide,在messages.json里给它们加上desktop平台,并重新生成shared.generated.go。workbench-tool-window-docking加上chrome_view.go和chrome_menu_test.go作为证据,说明补上这一行为;顺便把过时的“未核到组内排序、右键移动”改成已由测试覆盖。chrome_menu_test.go):TestHiddenStripeButtonIsListedUnderTheEllipsisAndComesBack:TestUnhidePutsTheButtonBackWithoutTouchingItsToolWindow:TestChromeStateKeepsTheZoneOfAHiddenButton:隐藏按钮的窗口仍在原分区的槽位打开。不在本 PR 范围内 / Out of scope
类型专属:feat
多平台对齐
platform-specific),理由:范围检查 / Scope checks
功能矩阵 / Feature matrix
shared/platform-feature-matrix/features/workbench-tool-window-docking.json:证据路径和说明;两端验证状态保持pending,没有做实机验收./scripts/platform-feature-matrix/verify-platform-feature-matrix.sh和./scripts/platform-feature-matrix/verify-platform-feature-matrix-change.sh origin/preview HEAD.artifacts/下生成的矩阵视图统一日志系统 / Structured logging
app.action.performed(a.performed),没有新增事件、print或手写事件 IDreduceChrome边界记录一次generate-log-events.mjs --check/verify-log-usage.mjs:仓库里已没有scripts/logging/,本 PR 也没有新增事件声明界面文案 / i18n
shared/i18n/messages.json加上desktop平台,运行node scripts/i18n/generate-i18n.mjs并提交生成结果node scripts/i18n/verify-app-language-localization.mjs和node scripts/i18n/generate-i18n.mjs --check,没有放宽脚本或扩大豁免名单逻辑归属 / Logic placement
workbench.chromeLayout.reduce(Lithe-core-rust#34),桌面端只负责菜单、列表和保存性能与内存 / Performance and memory
N/A:没有后台任务、子进程、缓存或 I/O;“…”只在有隐藏按钮时声明,列表只在打开时声明。
设置 / Settings
N/A:没有新增设置项,隐藏状态属于布局。
插件契约 / Plugin contract
N/A:
workbench.chromeLayout.reduce是宿主内部命令,不属于插件契约,没有新增或修改宿主方法与通知。发行包与资源 / Bundle and resources
workbench-layout-v2.json。已运行./scripts/desktop/verify/verify-runtime-bundle-immutability.sh,通过无用代码与重构 / Dead code and refactoring
"tool."前缀提成常量,与快捷键标签共用验证 / Verification
scripts/desktop/desktop-go.sh test ./... -count=1(LITHE_CORE_RUST_DIR指向 Lithe-core-rust#35 的9fa94ce,它包含固定的1d4556b,只多出构建忽略路径)scripts/desktop/desktop-go.sh test ./internal/workbench -run 'Hidden|Unhide|Stripe|IconButtons|ChromeState|ToolWindow'(变基到含 #1897 的 preview 后)node scripts/i18n/generate-i18n.mjs --checknode scripts/i18n/verify-app-language-localization.mjsnode --test scripts/i18n/test-i18n.mjsgofmt子进程上,单独重跑通过)./scripts/platform-feature-matrix/verify-platform-feature-matrix.sh./scripts/platform-feature-matrix/verify-platform-feature-matrix-change.sh origin/preview HEAD./scripts/desktop/verify/verify-runtime-bundle-immutability.shcargo test --workspace、clippy -D warnings、fmt --check未能执行的检查和原因:
pending。提交前确认 / Final checks
preview创建(已变基到包含 feat(desktop): 工具窗口栏换成 IDEA New UI 图标和尺寸,纯图标按钮悬停显示名称 #1897–feat(desktop): 设置新增“关于”页,更新改为 Motty 式检查与一键更新,版本区分正式版与预览版 #1900 的 preview,变基后重跑了 workbench、core、i18n 测试和 i18n、矩阵检查);目标分支preview