{
  "_description": "本文件由 data/ 生成：请改动来源文件，不要改这里。各字段的证据边界见接入指南。",
  "schemaVersion": "1.0.0",
  "kind": "entry",
  "locale": "zh-CN",
  "id": "undo-redo",
  "name": {
    "zh": "撤销与重做",
    "en": "Undo and Redo"
  },
  "page": "https://designvocabulary.com/zh/entries/undo-redo/",
  "self": "https://designvocabulary.com/zh/entries/undo-redo.json",
  "alternates": {
    "zh-CN": "https://designvocabulary.com/zh/entries/undo-redo.json",
    "en": "https://designvocabulary.com/en/entries/undo-redo.json"
  },
  "site": {
    "catalogSchemaVersion": "0.1.0",
    "entries": 158,
    "index": "https://designvocabulary.com/zh/entries/index.json",
    "query": "https://designvocabulary.com/api/query?lang=zh",
    "guide": "https://designvocabulary.com/zh/agents/",
    "llms": "https://designvocabulary.com/llms.txt"
  },
  "provenance": {
    "sourceBacked": [
      "entry.definition"
    ],
    "editorial": [
      "entry.boundary",
      "entry.signature",
      "entry.when",
      "entry.when_not",
      "entry.tradeoff",
      "entry.comparison",
      "entry.rules",
      "entry.relations",
      "entry.implementationNote",
      "entry.behavior"
    ],
    "scope": "定义参考以上来源；数字界面示例、选择建议、条件关系及配方由本样例编辑，尚未经用户研究验证。",
    "editorialStatus": "drafted",
    "specimenData": "fictional",
    "specimenNote": "示例为原创虚构界面；定义附来源，用法与配方为编辑建议。",
    "sources": [
      {
        "id": "nng-user-control-freedom",
        "url": "https://www.nngroup.com/articles/user-control-and-freedom/",
        "title": "NN/g · User Control and Freedom (Usability Heuristic #3)",
        "checkedAt": "2026-09-15",
        "archive": {
          "status": "available",
          "confirmed": true,
          "url": "https://web.archive.org/web/20260916035135/https://www.nngroup.com/articles/user-control-and-freedom/",
          "capturedAt": "2026-09-16T03:51:35Z",
          "lookupUrl": "https://web.archive.org/web/20260915*/https://www.nngroup.com/articles/user-control-and-freedom/"
        }
      },
      {
        "id": "nng-reset-cancel-buttons",
        "url": "https://www.nngroup.com/articles/reset-and-cancel-buttons/",
        "title": "NN/g · Reset and Cancel Buttons",
        "checkedAt": "2026-09-15",
        "archive": {
          "status": "available",
          "confirmed": true,
          "url": "https://web.archive.org/web/20260916040017/https://www.nngroup.com/articles/reset-and-cancel-buttons/",
          "capturedAt": "2026-09-16T04:00:17Z",
          "lookupUrl": "https://web.archive.org/web/20260915*/https://www.nngroup.com/articles/reset-and-cancel-buttons/"
        }
      },
      {
        "id": "wcag-error-prevention-legal-financial-data",
        "url": "https://www.w3.org/WAI/WCAG22/Understanding/error-prevention-legal-financial-data.html",
        "title": "W3C · Understanding SC 3.3.4: Error Prevention (Legal, Financial, Data)",
        "checkedAt": "2026-09-15",
        "archive": {
          "status": "available",
          "confirmed": true,
          "url": "https://web.archive.org/web/20260916040037/https://www.w3.org/WAI/WCAG22/Understanding/error-prevention-legal-financial-data.html",
          "capturedAt": "2026-09-16T04:00:37Z",
          "lookupUrl": "https://web.archive.org/web/20260915*/https://www.w3.org/WAI/WCAG22/Understanding/error-prevention-legal-financial-data.html"
        }
      }
    ],
    "lists": [
      {
        "id": "I-C",
        "edition": "classic",
        "seat": 7,
        "origin": "issue-1-ledger",
        "page": "https://designvocabulary.com/zh/lists/I-C/",
        "json": "https://designvocabulary.com/zh/lists/I-C.json"
      },
      {
        "id": "I-Y",
        "edition": "2026-focus",
        "seat": 5,
        "origin": "issue-1-ledger",
        "page": "https://designvocabulary.com/zh/lists/I-Y/",
        "json": "https://designvocabulary.com/zh/lists/I-Y.json"
      }
    ],
    "ordered": false,
    "listDisclaimer": "席位号是编辑位置，不是评分、排名或人气统计；清单未收满时保持原样，不补足。"
  },
  "entry": {
    "id": "undo-redo",
    "type": "interaction",
    "name": {
      "zh": "撤销与重做",
      "en": "Undo and Redo"
    },
    "aliases": [
      "撤销重做",
      "Undo/Redo",
      "Ctrl+Z"
    ],
    "granularity": "flow",
    "intents": [
      "undo-action",
      "confirm-action"
    ],
    "tags": [
      "撤销",
      "重做",
      "命令历史",
      "可逆",
      "紧急出口"
    ],
    "definition": "把已经完成的操作记入命令历史，让用户可以逐步撤回最近的改动或重新应用被撤回的改动；撤销针对的是已提交、已生效的动作，而不是尚未完成的操作。",
    "boundary": "撤销与重做是用户控制与自由原则在编辑类场景中的具体实现，而不是原则本身：原则讲的是要有清晰的出口，撤销与重做只是众多出口手段之一。它与取消不同——取消放弃的是尚未完成、还在进行中的操作（例如正在上传或正在填写的表单），撤销面对的是已经完成并生效的动作；它也不同于错误预防——错误预防在动作发生前拦截或要求确认，撤销与重做在动作发生之后提供回退路径。“撤销提示条”（undo toast）只是撤销的一种呈现方式，不是撤销本身；只呈现提示条而没有工具栏或菜单入口，不构成完整实现。",
    "signature": [
      "存在持久的命令历史，撤销与重做可以连续、多步地应用而不止一次",
      "撤销入口在界面上可见，例如工具栏图标、菜单项或提示条中的按钮，不只依赖键盘快捷键",
      "撤销的提示或标签说明将要撤销的具体内容，而不是笼统的“已撤销”"
    ],
    "when": [
      "操作会修改或删除已提交的内容，且用户可能在事后改变主意",
      "任务允许试错，用户需要放心尝试再回退，而不是每一步都先确认",
      "同一会话中可能连续发生多次可撤销的改动，需要支持多级撤销与重做"
    ],
    "when_not": [
      "操作尚未完成或尚未生效，此时应提供取消而不是撤销",
      "操作因涉及法律、金钱或不可逆的外部效果而根本无法回退，此时撤销不能替代事前确认",
      "把“可以撤销”当作省略必要说明或警示的理由，用在用户可能并不知道发生了什么的场合"
    ],
    "tradeoff": "撤销与重做能降低误操作的代价、鼓励探索，但需要维护持久的命令历史和状态回滚逻辑，涉及外部副作用（例如已发送的请求）的操作难以真正撤销；提示条这种呈现方式还受限于展示时长，过短会让用户来不及点击。",
    "comparison": {
      "focus": "回退或重新应用已经完成并生效的操作",
      "mechanism": "维护命令历史，记录每一步改动以便反向或正向重放",
      "cost": "历史状态的存储与一致性维护，以及对不可逆外部效果的处理"
    },
    "sources": [
      {
        "id": "nng-user-control-freedom",
        "title": "NN/g · User Control and Freedom (Usability Heuristic #3)",
        "url": "https://www.nngroup.com/articles/user-control-and-freedom/",
        "claim": "撤销与重做是用户控制与自由的实现手段之一：用户短时间内可能连续做出多个改动，因此应支持多级撤销与重做而不止撤销最后一步；撤销入口应放在用户预期的位置（WYSIWYG 应用常在工具栏或菜单，网页应用常在提示条或上下文菜单），并保持可见，例如 iOS 的摇一摇撤销因难以发现而很少被使用。",
        "checkedAt": "2026-09-15",
        "archive": {
          "lookupUrl": "https://web.archive.org/web/20260915*/https://www.nngroup.com/articles/user-control-and-freedom/",
          "status": "available",
          "checkedAt": "2026-09-16T03:59:51.314Z",
          "jobId": "spn2-3a0ff97744af06a7cb1daace1073bb8545c95cac",
          "url": "https://web.archive.org/web/20260916035135/https://www.nngroup.com/articles/user-control-and-freedom/",
          "timestamp": "20260916035135"
        }
      },
      {
        "id": "nng-reset-cancel-buttons",
        "title": "NN/g · Reset and Cancel Buttons",
        "url": "https://www.nngroup.com/articles/reset-and-cancel-buttons/",
        "claim": "区分取消/重置与撤销：取消、重置作用于提交前尚未生效的表单输入；撤销则是编辑类系统中常见的命令，使文档恢复到用户最近一次改动之前的状态，处理的是已经生效的改动，而不是尚未完成的输入。",
        "checkedAt": "2026-09-15",
        "archive": {
          "lookupUrl": "https://web.archive.org/web/20260915*/https://www.nngroup.com/articles/reset-and-cancel-buttons/",
          "status": "available",
          "checkedAt": "2026-09-16T03:59:52.137Z",
          "jobId": "spn2-0e35c97616088067a4b3b5961d3c4879bc8ca3f8",
          "url": "https://web.archive.org/web/20260916040017/https://www.nngroup.com/articles/reset-and-cancel-buttons/",
          "timestamp": "20260916040017"
        }
      },
      {
        "id": "wcag-error-prevention-legal-financial-data",
        "title": "W3C · Understanding SC 3.3.4: Error Prevention (Legal, Financial, Data)",
        "url": "https://www.w3.org/WAI/WCAG22/Understanding/error-prevention-legal-financial-data.html",
        "claim": "WCAG 2.2 AA 级要求：涉及法律承诺、金融交易、修改或删除用户可控数据、或提交测试答案的页面，至少满足以下之一：提交可撤销、数据经检查并可更正、或提交前可审阅确认；三者是被认可的等效机制，可撤销只是其中一种，而不是唯一或默认选项。",
        "checkedAt": "2026-09-15",
        "archive": {
          "lookupUrl": "https://web.archive.org/web/20260915*/https://www.w3.org/WAI/WCAG22/Understanding/error-prevention-legal-financial-data.html",
          "status": "available",
          "checkedAt": "2026-09-16T04:00:13.756Z",
          "jobId": "spn2-a2bf6eb9a9eda64f0ecf111bca4833c22543ba4b",
          "url": "https://web.archive.org/web/20260916040037/https://www.w3.org/WAI/WCAG22/Understanding/error-prevention-legal-financial-data.html",
          "timestamp": "20260916040037"
        }
      }
    ],
    "relations": [
      {
        "target": "user-control",
        "kind": "realized_by",
        "condition": "编辑类场景需要一个具体的、可连续操作的回退机制",
        "reason": "用户控制与自由要求有清晰的出口，撤销与重做是这一原则在已完成操作上的具体实现，而不是原则本身；原则条目未单独展开撤销与重做的界面细节。",
        "basis": "editorial"
      },
      {
        "target": "error-prevention",
        "kind": "composes_with",
        "condition": "操作代价高但仍可逆，或者操作根本无法撤销",
        "reason": "错误预防在动作发生前拦截或要求确认，撤销与重做在动作之后提供回退；当某个操作确实无法撤销时，应把这一点在执行前用错误预防手段说清楚，而不是执行后才告知。",
        "basis": "editorial"
      },
      {
        "target": "status-message",
        "kind": "composes_with",
        "condition": "删除或修改之后需要立即提供回退入口",
        "reason": "撤销提示条把撤销入口放进一条状态消息里，用状态消息的短暂可见性换取更低的界面侵入性；但提示条只是撤销的一种呈现方式，撤销机制本身不依赖它。",
        "basis": "editorial"
      }
    ],
    "rules": [
      {
        "when": "提供撤销功能",
        "instruction": "在界面上放置可见的撤销入口，例如工具栏图标、菜单项或提示条按钮；不能只依赖键盘快捷键，否则不可发现的用户等同于没有这个功能。",
        "strength": "must",
        "basis": "editorial"
      },
      {
        "when": "撤销发生后向用户反馈",
        "instruction": "说明具体撤销了什么内容，例如“已撤销删除《周报》”，而不是只显示笼统的“已撤销”。",
        "strength": "recommend",
        "basis": "editorial"
      },
      {
        "when": "某个操作一旦执行就确实无法撤销",
        "instruction": "在执行前说明这一点并要求确认，而不是等操作完成后才告知用户无法挽回。",
        "strength": "must",
        "basis": "editorial"
      }
    ],
    "behavior": {
      "states": [
        "idle",
        "action-committed",
        "undo-available",
        "undoing",
        "undone",
        "redo-available",
        "redoing"
      ],
      "a11y": [
        "撤销入口是可键盘操作的真实按钮或菜单项，而不是仅能通过快捷键触发的隐藏功能",
        "撤销、重做发生后，具体被撤销或重做的内容通过文字向辅助技术宣告",
        "提示条形式的撤销入口在辅助技术下保持足够时间可达，不因短暂显示而无法被读出或点击"
      ],
      "motion": "提示条的出现与消失不承载撤销结果本身；减弱动态偏好下可直接显示或移除，不依赖滑入滑出动画"
    },
    "demo": null,
    "version": "0.1.0",
    "editorialStatus": "drafted",
    "requirements": [],
    "demoCapabilities": [],
    "implementationNote": "本词条尚无可操作示例；插画为编辑示意。应用到产品时仍须验证撤销是否真正回滚了数据而不只是界面状态、涉及外部副作用的操作是否被诚实地标记为不可撤销，以及撤销提示条在辅助技术下是否有足够的可达时间。",
    "image": {
      "src": "/images/undo-redo.webp",
      "alt": "虚构的 FIELDNOTES 编辑器：顶部工具栏有清晰可见的撤销箭头图标，底部弹出一条提示条，写着删除已完成并带有撤销按钮，背景带有一叠淡淡的堆叠卡片暗示操作历史。"
    },
    "searchTerms": [
      "undo",
      "redo",
      "command history",
      "reversible",
      "emergency exit"
    ]
  }
}
