Repository navigation
fix(git): add checkbox staging with optimistic updates - #85
Merged
Merged
Conversation
Staging checkboxes on file rows and section headers now stage or unstage the corresponding files immediately with optimistic UI feedback, then reconcile against the real Git index after refresh. Per-file and section-wide toggles, including untracked files, stay in their original section while staged. Staging no longer changes the selected diff.
Owner
|
做完了吗 |
Contributor
Author
完成了 |
1lck
approved these changes
Aug 15, 2026
31 of 37 tasks
xiaoyumuxi
added a commit
that referenced
this pull request
Nov 18, 2026
…2117) - 不装插件也能新建、编辑、运行四种内置运行(process.shell、process.powershell、 Windows 上的 process.batch、process.executable);表单由 Core 的 runConfig.editorForm 描述,宿主只画认识的字段类型,不认识的跳过并原样回传 - 运行配置的编辑由 Core 返回文件改动,宿主按哈希检查后一次性应用 (.lithe/run/configurations.yaml、local.yaml、plugin/<插件>.toml) - 从对话框、构建窗口列表和再次运行启动时打开 Run 窗口并选中这次运行 - 插件运行配置文件写坏时,标题栏下拉列出未读取的文件,点击在编辑器中打开 - 脚本文本写到系统临时目录,进程退出后删除;Windows 批处理按 Core 给出的命令行启动 - 固定 Core 到 7381e79(Lithe-core-rust #85) - 新增功能矩阵条目 builtin-process-runs、Agent Note 和无头截图 Refs #2100
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.
Summary
Fixes #19
问题与根本原因
报告的现象:点击左侧 Changes 面板的"全选"没有全选下列文件。
对照改动前后实现,根因是"全选/勾选"从未接入真实的暂存操作:
1. 节头勾选框是装饰性图标,节头整行只有一个折叠按钮。 旧实现中整个节头是一个大按钮,
square图标只是装饰,点击只切换展开/收起——"全选下列文件"在语义上不存在。→
节头拆分为折叠箭头、全选勾选框、标题行三个独立按钮;勾选框对节内全部文件执行 stage/unstage(
setStaging),并以三态符号反映"全选/部分/未选"。2. 文件行勾选是"命令 → 刷新"的慢路径,没有即时反馈。 旧实现勾选后
Task { await toggleStaging(change) },状态要等 git命令返回并刷新后才变化,且暂存会连带切换
selectedChange,勾选时右侧 diff 跳动。→GitFeatureModel新增pendingStagingStates乐观状态:点击立即翻转勾选,后台执行真实
stage/unstage,完成后与git status快照对账(
reconcilePendingStagingStates),失败回滚对应勾选;刷新期间到达的陈旧快照不会清掉尚未落盘的乐观状态(新增测试staleSnapshotDoesNotClearOptimisticStagingState覆盖)。暂存不再改变当前选中的 diff。3. 未跟踪文件暂存后会从列表消失。 旧实现 Unversioned 节按
isUntracked收集文件,暂存后状态变为 added 便离开该节。→ 改为按 added状态收集(
addedChanges),未跟踪文件暂存后仍保留在原节显示。边界(明确不包含)
git status快照为准,不做.git/index增量 diff。验证
./scripts/test-macos.sh(swift test全量 381 个测试通过;GitStatusObservationTests11 个含新增staleSnapshotDoesNotClearOptimisticStagingState真实仓库观察测试)./scripts/build-macos.sh(swift builddebug 全 target 编译通过)./scripts/verify-rust-core.sh(内部含cargo test全量、cargo fmt --check、Swift bridge 构建、Rust Core 符号检查;本 PR 无 Rust改动)
cargo fmt --manifest-path rust/lithe-core/Cargo.toml --check./scripts/verify-core.sh./scripts/verify-git-graph.sh./scripts/verify-service-boundaries.sh./scripts/verify-shared-contracts.sh./scripts/verify-windows-boundaries.shgit diff --checkResult