Skip to content

feat(history): implement undo/redo grouping#143

Open
WZQHYP wants to merge 1 commit into
floatboatai:mainfrom
WZQHYP:feat/undo-redo-grouping
Open

feat(history): implement undo/redo grouping#143
WZQHYP wants to merge 1 commit into
floatboatai:mainfrom
WZQHYP:feat/undo-redo-grouping

Conversation

@WZQHYP

@WZQHYP WZQHYP commented Jul 9, 2026

Copy link
Copy Markdown

Summary / 摘要

Motivation / 背景与动机

  • Issue:
  • Roadmap (docs/ROADMAP.md):
  • OpenSpec change:

Changes / 变更内容

  • packages/plugin-history:

    • 新增基于 CodeMirror 6 Transaction Filtering 的分组逻辑
    • 通过 annotations 标记分组事务,实现时间窗口(500ms)自动分组
    • 新增分组开启/关闭的 API 方法
    • 新增单元测试用例
  • packages/plugin-table: (如果修改了表格相关代码,请列出;否则删除此行)

    • 协调 tableEditingCount 与分组逻辑的交互

Testing / 测试

  • pnpm test passes / 全绿
  • Affected packages build (pnpm build) / 受影响包构建通过
  • New / updated vitest cases:已为分组逻辑添加单元测试
  • Manual UI check in electron-demo:
    • 连续输入 "hello world",按一次 Ctrl+Z 一次性撤销全部输入 ✓
    • 输入后停顿超过 500ms,按 Ctrl+Z 正常撤销 ✓
    • 原有撤销/重做功能未受影响 ✓

Compliance / 合规自检

  • CLA signed — 已签署

  • AI disclosure: the functional code in this PR is not primarily generated by AI. AI assistance, if any, is described below.
    AI-assisted notes / AI 使用说明:
    使用了 Qoder CN(通义灵码)作为辅助编程工具。具体使用方式:
    1. 使用 Repo Wiki 功能帮助理解项目架构和 plugin-history 模块
    2. 使用 Quest 模式辅助实现撤销/重做分组的核心逻辑
    3. 本人负责了方案设计、代码审查、测试验证和最终集成
    核心算法设计(时间窗口分组策略、与 CodeMirror 6 Transaction 的交互方式)由本人主导,AI 辅助生成代码实现。

  • New dependencies (if any) listed with license & rationale (none if blank):

  • No build artifacts committed / 未提交构建产物

  • No secrets / .env / personal vault data committed / 无敏感信息

Checklist / 自检清单

  • Title follows Conventional Commits / 标题遵循 Conventional Commits
  • Public API changes update package README / types — 已更新 plugin-history 的类型导出
  • Touched live-preview-table.ts → walked through the 12 Table Widget rules in CLAUDE.md(未修改表格相关代码,此项不适用)
  • New capability / breaking change → OpenSpec proposal linked(非 breaking change,无需 OpenSpec)
  • Change aligns with project scope (GOVERNANCE.md §4) / 改动符合 GOVERNANCE.md §4 的项目范围

Screenshots / Recordings · 截图或录屏 (UI changes)

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants