Repository navigation
feat(run): 运行/调试配置对话框,cmd 批处理在 macOS 和 Linux 上可编辑但不能运行 - #2129
Merged
Merged
Conversation
- 标题栏运行下拉的“新建运行配置…”“编辑运行配置…”、构建窗口列表头的 + 和列表的编辑按钮, 都打开新的“运行/调试配置”对话框:左侧 + − 复制工具栏和按类型分组的配置树,右侧是选中配置的 编辑器,底部是 运行 / 取消 / 应用 / 确定。去掉标题栏的“新建运行配置 >”子菜单和构建窗口的新建菜单。 - 对话框里可以同时新建、修改、删除多个配置:应用先删除再按树的顺序保存,失败时停在出错的配置上; 确定保存并关闭;取消丢弃全部改动;运行保存后关闭并启动选中的配置。复制生成“<原名>(副本)”。 - 插件运行的编辑器并入对话框右侧,不再单独弹窗。两种编辑器都保留启动前步骤列表, 步骤的添加、移动、移除算作修改,由应用 / 确定 / 运行一并保存。 - 脚本选项、解释器路径、解释器选项加占位说明和 ⓘ,写清各自传给谁。 - cmd 批处理在所有平台都能新建、编辑、保存;不在 Windows 上时编辑器顶部提示只能在 Windows 上运行, 配置树标警告图标,对话框的“运行”置灰,标题栏运行按钮变灰、按下只提示原因,运行下拉标“仅 Windows”。 - Core 改动是 Lithe-core-rust#87(已合入 Core main 6f5fbcc),main 现在固定的 Core 5c48a67 已包含它: 批处理在非 Windows 上能列出、编辑、保存,不作为启动前步骤候选,项目文件引用它时以 unavailable 拒绝。 build-desktop-core.sh 只补 #87、#90 的说明,不换固定版本。 - 补中英 i18n 词条、对话框和批处理测试、无头截图(含 #2123 的运行下拉截图)、Agent Note 和功能矩阵。 - 测试隔离:命令安装测试改用私有临时目录,不再把其他测试进程的 lithe-command-install-* 当成泄漏; 对话框测试等草稿读完再按按钮。 Refs #2100
xiaoyumuxi
marked this pull request as ready for review
November 18, 2026 03:54
This was referenced Nov 18, 2026
23 of 24 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
#2117 合入后,有三处体验问题:
.cmd配置在这些平台上也无法修改。用户希望在所有平台都能新建和编辑,只是提醒不能在本平台运行,并把运行按钮置灰。改动 / Changes
1. “运行/调试配置”窗口(新增
desktop/internal/workbench/runconfig_dialog.go、runconfig_dialog_view.go;root.go)+新建(菜单列出本平台的内置运行类型)、−删除、复制。−标记的配置,再按配置树的顺序保存有改动的配置。某一个保存失败时停下来,选中并展开出错的配置,错误显示在它的编辑器里;已经保存的不回滚。保存后窗口保持打开,新建的配置换成保存后的 ID。−置灰。runConfigFormEdited标脏,插件运行编辑器把步骤列表纳入fingerprint,保存成功后同步savedBeforeLaunch。“应用 / 确定 / 运行”会一并保存。2. 入口(
title_run.go、title_run_view.go、runconfig_view.go)+改为打开这个窗口(删除原来的新建类型菜单);列表的编辑操作打开窗口并选中该配置。runConfigState.form、editor、newMenu和对应的弹窗绘制代码已删除。3. 参数框的说明(
runconfig_form_view.go、shared/i18n/)$1、$2…,PowerShell 用$args或param(),批处理用%1、%2…。解释器选项写在脚本路径前面、交给解释器本身,脚本读不到。4. cmd 批处理在 macOS、Linux 上可编辑但不能运行(
title_run.go、chrome_view.go、runconfig_dialog_view.go、desktop/internal/core/run_config.go、run_process.go)availability: unsupportedPlatform;编辑和保存照常,createLaunchPlan拒绝启动。+菜单和空白页列出批处理,并注明“仅 Windows”。unavailable拒绝,界面显示“不可用”的原因(Core [Feature] 从 Finder 打开单个文件时进入快速文本编辑模式 #87 新增测试a_batch_script_outside_windows_is_no_step)。5. Core 固定版本(
scripts/desktop/build-desktop-core.sh)PINNED_CORE_REVISION不变,沿用 main 的 5c48a67(已包含 Core main 6f5fbcc,即 [Feature] 从 Finder 打开单个文件时进入快速文本编辑模式 #87)。只在注释的版本记录里补上 [Feature] 从 Finder 打开单个文件时进入快速文本编辑模式 #87 和 [Feature] 优化插件市场与插件管理界面 #90 的说明。6. 文案、测试、截图、文档
shared/i18n/补中英词条(窗口标题、工具栏、底部按钮、空白页、复制名称、各参数 ⓘ、批处理不可运行提示等),重新生成shared.generated.go。runconfig_dialog_test.go:多个新建一起应用、取消丢弃删除和新建、删除等确定后生效且选中下一行、复制、分组折叠、非 Windows 上批处理可编辑但不能运行。runconfig_before_launch_test.go新增TestRunConfigDialogSavesAnAddedStep:在窗口里点“添加步骤”并从菜单选一项后,配置显示为有改动,“应用”把步骤写进配置。去掉标脏接线后这个测试失败。runconfig_edit_test.go、runconfig_process_test.go、title_run_test.go改为经窗口新建和编辑;runconfig_edit_test.go增加步骤列表改动算作修改、清空后不算修改的检查。docs/assets/builtin-process-runs/(更新 README 和全部场景,新增空白窗口、批处理、标题栏置灰三组)、docs/assets/run-config-empty/、docs/assets/before-launch/before-launch-editor-*(编辑器现在在窗口里),以及 feat(run): 当前文件运行——构建插件按文件找入口,保存为运行配置后运行 #2123 的docs/assets/run-current-file/run-current-file-menu-*(运行下拉不再有“新建运行配置 >”子菜单)。TestCommandInstallManagedRecordsWhereLaterLaunchesFindTheCommand(feat(desktop): 插件缺少的命令可在能力卡片上一键安装(API-23 commandInstallers) #1971)原来扫描整机共用的os.TempDir()找残留的lithe-command-install-*。本机另一个工作树同时跑测试时,会把对方正在用的目录当成泄漏而失败。现在测试用私有临时目录(设置TMPDIR、TMP、TEMP),只检查这次安装留下的目录。去掉安装结束时的删除后,这个测试仍会失败。runconfig_dialog_test.go的applyDialog先等所有草稿读完再按按钮,和界面上按钮的置灰条件一致;原来负载高时按钮在草稿还在读取时被按下,动作被忽略。2026-11-18-builtin-process-runs-and-run-file-formats.md记录窗口的保存语义和批处理在非 Windows 上的处理;2026-11-18-run-configuration-before-launch-steps.md补充步骤在窗口里的标脏方式和不可运行配置不作为候选。builtin-process-runs.json、run-before-launch-steps.json更新说明、证据和验证动作。不在本 PR 范围内 / Out of scope
split_arguments把单引号外的反斜杠当转义,Windows 上C:\tools\a.txt写在参数框里会变成C:toolsa.txt。这是 feat(desktop): 内置运行 Shell、PowerShell、cmd 脚本和可执行程序,运行配置改存 YAML/TOML #2117 起就有的 Core 行为,本 PR 没改,需要在 Core 单独修。类型专属:feat
多平台对齐
范围检查 / Scope checks
功能矩阵 / Feature matrix
shared/platform-feature-matrix/features/builtin-process-runs.json和run-before-launch-steps.json:说明、证据路径、验证动作已更新;没有做原生验收,两端验证状态保持pending./scripts/platform-feature-matrix/verify-platform-feature-matrix.sh(203 项通过)和./scripts/platform-feature-matrix/verify-platform-feature-matrix-change.sh origin/main(通过).artifacts/下生成的矩阵视图插件归属 / Plugin ownership
develop-lithe第三节的自查命令,结果为空dev.example.engine)和系统 shell;没有读取具体插件shared/i18n/;没有写插件的构建步骤或资源路径runOptions字段和保存协议没变UI 验证 / UI evidence
scripts/desktop/desktop-go.sh test -tags 'vivahead lithevisual' ./internal/workbench -run '^(TestVisualBuiltInProcessRuns|TestVisualTitleRunWithoutConfigurations|TestVisualBeforeLaunchSteps)$' -count=1;提交 53ce08c,macOS 无头,深色中文、浅色英文,1200×760(启动前步骤 1200×820)改动前后:标题栏运行下拉
改动前后:编辑配置
窗口的其他场景
+菜单全部场景(明暗、中英)见
docs/assets/builtin-process-runs/README.md。统一日志系统 / Structured logging
N/A:没有新增生命周期里程碑、终态或失败路径。窗口的保存沿用已有的
saveRunConfigForm/saveRunConfigEditor和运行启动路径,按钮点击沿用已有的performed记录。界面文案 / i18n
shared/i18n/补齐中英词条,运行node scripts/i18n/generate-i18n.mjs并提交生成结果node scripts/i18n/verify-app-language-localization.mjs和node scripts/i18n/generate-i18n.mjs --check,都通过逻辑归属 / Logic placement
availability呈现unsupportedPlatform性能与内存 / Performance and memory
设置 / Settings
.lithe/run/里的真实来源,窗口打开时不写文件,点应用或确定才写插件契约 / Plugin contract
availability和步骤候选,不改shared/plugins/contract/v1/、能力版本或插件函数协议scripts/desktop/build-desktop-core.sh的PINNED_CORE_REVISION沿用 main 的 5c48a67,已包含 [Feature] 从 Finder 打开单个文件时进入快速文本编辑模式 #87;注释补上 [Feature] 从 Finder 打开单个文件时进入快速文本编辑模式 #87、[Feature] 优化插件市场与插件管理界面 #90 的说明发行包与资源 / Bundle and resources
./scripts/desktop/verify/verify-runtime-bundle-immutability.sh,通过无用代码与重构 / Dead code and refactoring
runConfigState.form、editor、newMenu)split_arguments的反斜杠问题是 Core 行为缺陷,写在“不在本 PR 范围内”;发现的测试隔离问题已在本 PR 修复(见改动 6)验证 / Verification
scripts/desktop/desktop-go.sh vet ./internal/workbench(含-tags 'vivahead lithevisual')gofmt -l desktop/internal/workbenchscripts/desktop/desktop-go.sh test ./... -count=1localshell的TestClosingAnIntegratedShellRightAfterACommandHangsUpItsJobs外全部通过。该测试在另一个工作树同时跑整套测试时超出 5 秒时限,单独连跑 3 次都通过,本 PR 没有改 localshell。变基到 75abcb7 后重跑./internal/workbench整包,通过(231 秒)./.agents/skills/write-stable-tests/scripts/test-stability-macos.sh --package ./internal/workbench --filter '<窗口、批处理、启动前步骤相关测试>'TestCommandInstallManaged…,超过 1 秒提示线,低于 15 秒上限)node scripts/i18n/verify-app-language-localization.mjs、node scripts/i18n/generate-i18n.mjs --check./scripts/platform-feature-matrix/verify-platform-feature-matrix.sh、verify-platform-feature-matrix-change.sh origin/main./scripts/agent-notes/verify-agent-notes.shnode scripts/desktop/validate-pins.mjs./scripts/desktop/verify/verify-runtime-bundle-immutability.shcargo fmt --all -- --check、cargo test -p lithe-execution -p lithe-core、注释与平台测试检查未能执行的检查和原因:
desktop-go.sh不做跨系统构建,Draft 阶段由 Linux CI 覆盖,ready 后由 Windows CI 覆盖。Windows 和 Linux 的实机验证由维护者完成。提交前确认 / Final checks
main(75abcb7,含 feat(run): 当前文件运行——构建插件按文件找入口,保存为运行配置后运行 #2123 当前文件运行、feat(git): 多仓库分支弹窗列出共同本地/远程分支,可在所有仓库检出、新建分支并回滚;合并日志高亮各仓库当前分支 #2126 多仓库 Git)变基;目标分支main