Repository navigation
Conversation
commit: |
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
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
无。基于
TodoList现有能力的功能扩展。💡 背景与方案
Agent 的任务计划经常是分层的(父任务下挂子任务,或在任务行下方展示自定义内容),但当前
TodoList只渲染一层扁平列表,也没有"行下方内容"的插槽。本次扩展在不改变现有items扁平契约、不改动已有 DOM/class 的前提下,为它补上树形展开与自定义节点能力,零 breaking change。数据层(
TodoItem,依赖已有的索引签名保持兼容)childrenTodoItem[]payloadunknownitemExtra消费expandableboolean新增 Props / Slots / Emits / 实例方法
expandedKeys/defaultExpandedKeysopen的双轨写法indentSize、recursiveCountfalse,保持兼容)itemExtra({ item, index, status, depth, expanded, toggle })itemExpandIcon({ item, index, status, depth })update:expandedKeys/expandedKeysChangeopenChange对称expandAll/collapseAll/setExpandedKeyssetOpen关键实现点
li用flex-wrap在末尾换行出展开区,状态图标 / 标题 / 详情 / 删除线的 DOM 与 class 全部不动;没有树形数据的清单渲染结果与改动前一致。statsItems统一头部计数与自动折叠判定,避免顶层全完成但子树还在跑时误折叠。children,或itemExtra插槽对该行返回实质内容"的行才出现箭头;纯叶子不显示。探测插槽时传expanded: true,并用hasSlotContent()过滤v-if假分支产生的注释 VNode。auto;同步 reduced-motion 降级。itemExpandGap(默认 4px)专控父行与展开区的间距,横向columnGap仍为 8px;嵌套清单无额外 margin。Enter/Space切换,带role="button"/aria-expanded/ focus 轮廓;点击标题内的链接或按钮不会误触。文档:中英文各补一个「树形任务与自定义节点」demo,以及新增 API / token / 方法表格与动效说明。
✅ 验证
vp run --filter @antdv-next/x-pro type-check:通过。vp test --run packages/x-pro/tests/todo-list-utils.test.ts packages/x-pro/tests/todo-list.test.ts:86 个测试全过(新增树形、动画、叶子判定、标题交互等用例)。vp test --run:全量 1083 个测试通过(无回归)。4 of 10 completed与展平行数吻合;展开 / 收起逐帧采样高度与透明度过渡正常;标题点击、插槽内链接不误触、纯叶子无箭头均验证通过。📝 变更日志
TodoListwith tree expansion and custom nodes: nested child lists, per-row extra slot, controlled expanded keys, animated expand/collapse, clickable titles and compact nested spacing — fully backward compatible.TodoList扩展树形展开与自定义节点:支持递归子清单、行级展开插槽、受控展开状态、展开收起动画、点击标题切换与紧凑嵌套间距,完全向后兼容。