fix(fields): #3318 aria-invalid 交付批次 —— 20 个 widget 校验失败后向辅助技术宣告状态(账本 29 → 9) - #3345
Merged
xuyushun441-sys merged 2 commits intoAug 4, 2026
Merged
Conversation
…r validation failure (#3318) Apply the #3222/#3306 pattern per widget: spread toDomProps(props) onto the widget's real focusable control (never a non-focusable wrapper, never a non-DOM Radix Root), then an explicit aria-invalid={!!error} after the spread so the widget's own computation from the published error slot wins. Delivered types (removed from the NOT_YET_DELIVERED ratchet ledger): multiselect, radio, checkboxes, tags, lookup, master_detail, user, owner, file, image, location, object, color, rating, code, avatar, address, geolocation, qrcode, object-ref. Placement notes: - radio: onto the Radix RadioGroup Root, a real <div role="radiogroup"> — the ARIA-designated carrier of aria-invalid for a set of radios. - multiselect / checkboxes / rating: onto every focusable option control; the wrapper div carries id/aria-describedby but never aria-invalid, and never `name` (only DOM-legal on form controls — the #3291 leak class). - lookup family: onto the shared trigger button (both picker branches). - object-ref / recipient-picker: Combobox now forwards standard button attributes to its focusable role="combobox" trigger (the #3306 SelectTrigger reasoning), so widgets finally have an element to deliver to. - file / image / avatar: onto the focusable upload control (dropzone / upload button) — the keyboard path to the hidden file input. Still on the ledger, each with its blocker documented in the ledger comment: formula, summary, auto_number, vector, grid, slider, signature, filter-condition, recipient-picker (the last two now deliver in their editable states but render a gate hint with no focusable control in the sweep's fresh-form state). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NVPjPzmmAJ2Ngtvgg5MSRa
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NVPjPzmmAJ2Ngtvgg5MSRa
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
xuyushun441-sys
marked this pull request as ready for review
August 4, 2026 05:40
xuyushun441-sys
deleted the
claude/issue-3318-widget-aria-invalid-delivery
branch
August 4, 2026 05:40
Contributor
✅ Console Performance Budget
📦 Bundle Size Report
Size Limits
|
This was referenced Aug 4, 2026
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.
Refs #3318(账本有残留,issue 保持 open 直至清零)
做了什么
按 #3222/#3306 范式逐个交付:
toDomProps(props)白名单 spread 到 widget 的真实可聚焦控件(绝不挂非可聚焦包装层,绝不落在非 DOM 的 Radix Root 上),spread 之后显式aria-invalid={!!error}(error为 specFieldWidgetPropsSchema的发布槽位,widget 自己的计算胜出)。消息文本仍归 FieldMessage,widget 只置状态。本批交付 20 个类型(已从
NOT_YET_DELIVERED账本移除、转入正向守卫):multiselectradiocheckboxestagslookupmaster_detailuserownerfileimagelocationobjectcolorratingcodeavataraddressgeolocationqrcodeobject-ref落点值得说明的:
radiodiv[role=radiogroup],且radiogroup正是 WAI-ARIA 为一组 radio 指定的aria-invalid载体(radio角色本身不支持该属性)multiselect/checkboxes/ratingname(name只在表单控件上是合法 DOM 属性——#3291 泄漏类,dom-leak 守卫实测抓到后修正)lookup族(含master_detail/user/owner)name按 #3306 SelectTrigger 同理不转发object-ref/recipient-pickerCombobox(components 包)新增标准 button 属性到其可聚焦role="combobox"trigger 的转发——#3306 给 SelectTrigger 开的同一条缝,否则 combobox 型 widget 无处送达file/image/avatarrole="button"/ 上传按钮)——通往隐藏 file input 的键盘路径address/geolocationaria-invalid落每个子输入(表单级失败意味着整个复合值缺失)object/filter-conditionaria-invalid同时并入 widget 自身的「JSON 不可解析」内部态(红字已在渲染,状态不应缄默)账本残留(9 个,原因已写入账本注释本体)
formula/summary/auto_number/vector—— 只读计算/展示型:整行没有任何可聚焦控件,无处送达;把属性挂到静态文本 span 正是裁决禁止的「非可聚焦包装层充数」。grid—— 复合行编辑器,自有 per-cell aria-invalid;表单级失败驱动它需要设计决策(落哪个 cell?),非一个 spread 能解。slider—— 可聚焦 thumb(role="slider",ARIA 指定载体)在 shadcn 同步文件ui/slider.tsx(No-Touch 构建一个 **Live Playground (实时演练场)** (用于展示引擎能力) #7)内部,Root span 不可聚焦;需 components 级方案。signature—— canvas 不可聚焦(键盘根本无输入路径),唯一可聚焦的是辅助 Clear 按钮;需要真正的 a11y 设计。filter-condition/recipient-picker—— 依赖门控型:兄弟字段未选时(新表单与守卫 sweep 的状态)渲染提示段落、无可聚焦控件。其可编辑态本 PR 已交付 aria-invalid(raw JSON textarea / Combobox trigger / 兜底 input)。验证
统一仓根
pnpm exec vitest run(#3288),重活全部经flock /tmp/os-heavy-verify.lock+NODE_OPTIONS=--max-old-space-size=4096:name="f"→ 排除name后 281 passed(两守卫合跑)vitest run packages/fields+ combobox 测试vitest run packages/componentsturbo run type-check --filter=@object-ui/components --filter=@object-ui/fields破坏验证实录(三种形态各一)
同时回退三处交付(删 spread + 删显式 aria-invalid):
LocationField(简单 spread 型)、LookupFieldtriggerButton(Radix trigger 型)、RadioField(Radix group 型)→ 正向守卫恰好 6 个类型变红(location/radio/lookup/master_detail/user/owner——lookup 一处破坏正确联动 4 个注册类型),还原后全绿。Changeset
@object-ui/fields+@object-ui/components均 patch(fixed group,无 major)。顺手发现(未在本 PR 修,已立未认领 issue)
🤖 Generated with Claude Code
https://claude.ai/code/session_01NVPjPzmmAJ2Ngtvgg5MSRa
Generated by Claude Code