Repository navigation
feat(desktop): Run 窗口按 IDEA 样式为每次执行开标签,控制台按 ANSI 转义着色 - #1932
Merged
Merged
Conversation
Run 窗口改成 IntelliJ IDEA 的布局:标题“运行”后面是每次执行一个标签(状态图标、名称、结束后的关闭按钮), 左侧竖排工具栏是绿色的再次运行和红色的停止,执行树显示状态、粗体名称、开始时间和右对齐耗时,右侧控制台 带滚动到末尾和清空。宿主构建任务、运行配置和插件发起的运行都进 Run 窗口,Build 窗口不再内嵌运行输出。 控制台输出经 Rust Core 的 outputStyle.decode 解码为纯文本行和着色区间,在读取输出的 goroutine 上分片调用; 纯文本供复制、搜索、输出链接、快照和 IDE API,样式按终端同一套 16 色配色绘制。运行、构建和测试控制台跟随 最新输出,向上滚动后停止跟随。Core 固定到 Lithe-core-rust #44 的 cdc0258(合入后改为 main 上的 commit)。
xiaoyumuxi
marked this pull request as ready for review
November 14, 2026 15:57
xiaoyumuxi
added a commit
that referenced
this pull request
Nov 14, 2026
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
outputStyle.decode,附共享 fixturerust/fixtures/terminal/output-style-v1.json)。本 PR 暂时固定在它的 commitcdc0258,Core PR 合入后改为 main 上的 commit,再标记 ready。PR 类型 / Type
改动说明 / What changes
背景 / Why
原来 Build 窗口执行的任务和运行配置的输出挤在一个共享的控制台里,看不出每次执行的结果和耗时;输出里的 ANSI 转义要么原样显示成乱码,要么颜色全丢(例如构建工具强制彩色输出时的
[INFO]、WARNING、BUILD SUCCESS)。这个 PR 把 Run 窗口改成 IntelliJ IDEA 的样子:每次执行一个标签,左边是执行的状态和耗时,右边是带颜色的控制台。改动 / Changes
Run 窗口(
run_view.go,新文件;build_view.go删掉原来的运行视图)runs.go的closeRunSession)。runToolButton自己画。runpanels.go的runSplit,键盘调整在editor_view.go接入)。git.console.scrollToEnd、git.console.clear词条,git.console.clear的平台加上desktop)。shell_view.go,和终端标签同一处)。showBuildConsole改为把 Run 窗口带到前面并选中正在运行的那次执行。执行会话(
runs.go、build.go、runconfig.go、ide_api_dispatch.go)lithe/host/run/start发起的运行,都是 Run 窗口里的一个会话:beginBuildOperation新增restart参数(再次运行时调用),每次执行有自己的有界控制台(4000 行、4 MiB)。同名的已结束会话让位给新会话;最多保留 8 个,超出时去掉最旧的已结束会话。p.build.output删除;IDE API 读一次执行的输出(ideAPIOperationText)改为读该会话自己的控制台,读到的是去掉转义的纯文本,被裁掉的行仍由 Core 报告不连续。p.build.status,现在统一走endBuildOperation。控制台着色(
core/output_style.go、workbench/output_style.go、outputlinks_view.go、termview/palette.go)DecodeOutputStyle,Kernel接口同步。outputDecoder在读取输出的 goroutine 上按 256 KiB 分片调用outputStyle.decode,带上一次的状态,补齐被切开的 UTF-8 字符;同一个控制台的块按解码顺序交给界面线程。Core 失败时记一次operation_failed(output_style),该控制台其余输出按原样分行显示。outputBuffer保存纯文本行和样式区间,按行数和字节数上限裁剪,sequence单调递增;复制、搜索、输出链接、快照和 IDE API 都只读纯文本。outputlinks.go的splitUTF16、utf16Tail改成按段切分的outputSegments)。0–15 号颜色用termview新导出的Look.ANSI(),和终端同一套配色(含 Terminal.app 描述文件导入与对比度回退);粗体的 8 个基本色取亮色;支持反显、暗淡、隐藏、下划线、删除线、背景色。ui.List(...).Follow(true)),用户向上滚动后不再跳动;运行、构建、测试三个控制台都一样。测试窗口(
tests.go、tests_view.go)文案(
shared/i18n/、desktop/internal/i18n/run_messages.go)desktop.run.*:关闭、开始时间“: 在 {time}”、四种状态、耗时(毫秒;秒+毫秒;分+秒;时+分)。耗时接口参数是整数毫秒,符合目录检查只允许 string/int/bool 参数的规则。其他
PINNED_CORE_REVISION升到 Lithe-core-rust#44 的cdc0258,注释补上 [Bug] 双Shift搜索列表无法下拉 #44 并把 [Feature] 关闭项目类似IDEA一样 回退到欢迎页面 #43 改为已 squash 合入。run-window-execution-tabs、run-console-ansi-styles;run-output-snapshot、debug-performance、plugin-backend-run-start的证据路径从build_view.go改为run_view.go,plugin-backend-run-start的说明从“Build 面板里的运行视图”改为“Run 窗口中这次运行自己的标签”。beginBuildOperation五参数、feedBuildOutput辅助函数、各测试改用有界控制台;run_panels_test.go改为断言控制台停在末尾。不在本 PR 范围内 / Out of scope
-Dstyle.color=always在插件仓库另提 PR;它要先确认测试结果解码读的原始输出能处理转义。pending。类型专属:feat
多平台对齐
desktop/internal/**),Core 命令两端共用。platform-specific),理由:范围检查 / Scope checks
功能矩阵 / Feature matrix
shared/platform-feature-matrix/features/<id>.json:新增两条,改三条证据路径;两端implemented/pending,证据路径、owner、验证动作都如实填写./scripts/platform-feature-matrix/verify-platform-feature-matrix.sh和./scripts/platform-feature-matrix/verify-platform-feature-matrix-change.sh origin/preview HEAD.artifacts/下生成的矩阵视图插件归属 / Plugin ownership
develop-lithe第三节“插件归属与宿主零依赖”的自查命令,结果为空lithe/host/run/*的参数、返回值和通知不变,插件的运行只是换到 Run 窗口的标签里显示统一日志系统 / Structured logging
operation_failed事件(字段output_style),每个控制台只记一次;没有新增事件 ID,没有直接写 stderr界面文案 / i18n
shared/i18n/补齐中英词条,已运行node scripts/i18n/generate-i18n.mjs并提交生成结果;Viva 代码通过desktop/internal/i18n/读取node scripts/i18n/verify-app-language-localization.mjs和node scripts/i18n/generate-i18n.mjs --check,没有放宽脚本或扩大豁免名单逻辑归属 / Logic placement
性能与内存 / Performance and memory
设置 / Settings
N/A:没有新增或修改设置。
插件契约 / Plugin contract
N/A:不涉及插件契约、能力版本、插件函数协议或宿主方法;Core 新命令只是宿主内部命令。
PINNED_CORE_REVISION已按上面说明升到cdc0258。发行包与资源 / Bundle and resources
./scripts/desktop/verify/verify-runtime-bundle-immutability.sh,通过无用代码与重构 / Dead code and refactoring
p.build.output、Build 窗口里的运行视图、splitUTF16/utf16Tail、测试视图里不再用的strings导入验证 / Verification
LITHE_CORE_RUST_DIR=<Core #44 检出> scripts/desktop/desktop-go.sh test ./...scripts/desktop/desktop-go.sh test -race ./internal/workbench/ ./internal/core/ ./internal/i18n/ ./internal/termview/scripts/desktop/desktop-go.sh vet ./...,以及-tags vivahead,lithevisual的 workbenchgofmt -l desktop/internalTestRunWindowGivesEachExecutionATab(两个标签、选中最新、执行树状态与耗时、切换标签、控制台无转义、× 关闭并选中相邻标签)TestRunDurationPicksTheLargestTwoUnits(中英文的毫秒、秒、分、时四档和负值)LITHE_VISUAL_OUTPUT_DIR=… desktop-go.sh test -tags vivahead,lithevisual -run TestVisualBuildPanels ./internal/workbench/:build-and-run 场景用合成的彩色构建输出截图,明暗主题、中英文node scripts/i18n/verify-app-language-localization.mjs、node scripts/i18n/generate-i18n.mjs --check、node --test scripts/i18n/test-i18n.mjsverify-platform-feature-matrix.sh、verify-platform-feature-matrix-change.sh origin/preview HEAD.agents/skills/write-stable-tests/scripts/verify-test-stability.shscripts/desktop/verify/verify-runtime-bundle-immutability.shcargo test -p lithe-terminal -p lithe-core、cargo fmt --check、cargo clippy -D warnings未能执行的检查和原因:
pending。提交前确认 / Final checks
preview创建,已 rebase 到 feat(keymap): 内置 VS Code 和 IDEA 快捷键导入 #1930,并 merge 了之后合入的 feat(plugins): 在设置窗口完成插件市场下载与安装 #1931;目标分支preview