Skip to content

fix(fields): #3318 aria-invalid 交付批次 —— 20 个 widget 校验失败后向辅助技术宣告状态(账本 29 → 9) - #3345

Merged
xuyushun441-sys merged 2 commits into
mainfrom
claude/issue-3318-widget-aria-invalid-delivery
Aug 4, 2026
Merged

fix(fields): #3318 aria-invalid 交付批次 —— 20 个 widget 校验失败后向辅助技术宣告状态(账本 29 → 9)#3345
xuyushun441-sys merged 2 commits into
mainfrom
claude/issue-3318-widget-aria-invalid-delivery

Conversation

@xuyushun441-sys

Copy link
Copy Markdown
Contributor

Refs #3318(账本有残留,issue 保持 open 直至清零)

做了什么

#3222/#3306 范式逐个交付:toDomProps(props) 白名单 spread 到 widget 的真实可聚焦控件(绝不挂非可聚焦包装层,绝不落在非 DOM 的 Radix Root 上),spread 之后显式 aria-invalid={!!error}error 为 spec FieldWidgetPropsSchema 的发布槽位,widget 自己的计算胜出)。消息文本仍归 FieldMessage,widget 只置状态。

本批交付 20 个类型(已从 NOT_YET_DELIVERED 账本移除、转入正向守卫):
multiselectradiocheckboxestagslookupmaster_detailuserownerfileimagelocationobjectcolorratingcodeavataraddressgeolocationqrcodeobject-ref

落点值得说明的:

widget真实可聚焦控件 / 处理
radioRadix RadioGroup Root——它是真实 DOM 元素 div[role=radiogroup],且 radiogroup 正是 WAI-ARIA 为一组 radio 指定的 aria-invalid 载体(radio 角色本身不支持该属性)
multiselect / checkboxes / rating状态落在每个可聚焦选项控件(chip 按钮 / checkbox / 星标);容器 div 只携带 id / aria-describedby,不带 aria-invalid,也不带namename 只在表单控件上是合法 DOM 属性——#3291 泄漏类,dom-leak 守卫实测抓到后修正)
lookup 族(含 master_detail/user/owner共享 triggerButton(两个 picker 分支同一落点);name#3306 SelectTrigger 同理不转发
object-ref / recipient-pickerCombobox(components 包)新增标准 button 属性到其可聚焦 role="combobox" trigger 的转发——#3306 给 SelectTrigger 开的同一条缝,否则 combobox 型 widget 无处送达
file / image / avatar可聚焦上传控件(dropzone role="button" / 上传按钮)——通往隐藏 file input 的键盘路径
address / geolocation复合子输入:spread 落第一个子输入,aria-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

步骤命令(缩写)结果
基线aria-invalid registry sweep48 passed
修完未改账本(棘轮实证)同上恰好 11 个 Batch-A 账本行变红(KNOWN GAP 断言失败 = 已交付)
改账本后同上48 passed(37 正向 + 9 账本 + 2 元断言)
dom-leak 守卫widget-dom-leak-e2e首轮抓到 4 个 widget 容器 div 泄漏 name="f" → 排除 name281 passed(两守卫合跑)
fields 全量vitest run packages/fields + combobox 测试47 files / 827 passed
components 全量vitest run packages/components69 files / 530 passed
app-shell 关联FlowReferenceField.lookup.test11 passed
typecheckturbo run type-check --filter=@object-ui/components --filter=@object-ui/fields11 tasks successful

破坏验证实录(三种形态各一)

同时回退三处交付(删 spread + 删显式 aria-invalid):LocationField(简单 spread 型)、LookupField triggerButton(Radix trigger 型)、RadioField(Radix group 型)→ 正向守卫恰好 6 个类型变红location / radio / lookup / master_detail / user / owner——lookup 一处破坏正确联动 4 个注册类型),还原后全绿。

Changeset

@object-ui/fields + @object-ui/componentspatch(fixed group,无 major)。

顺手发现(未在本 PR 修,已立未认领 issue)


🤖 Generated with Claude Code

https://claude.ai/code/session_01NVPjPzmmAJ2Ngtvgg5MSRa


Generated by Claude Code

…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
@vercel

vercelBot commented Aug 4, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
ProjectDeploymentActionsUpdated (UTC)
objectuiIgnoredIgnoredAug 4, 2026 5:38am

Request Review

@xuyushun441-sys
xuyushun441-sys marked this pull request as ready for review August 4, 2026 05:40
@xuyushun441-sys
xuyushun441-sys added this pull request to the merge queueAug 4, 2026
Merged via the queue into main with commit 8d8094aAug 4, 2026
16 checks passed
@xuyushun441-sys
xuyushun441-sys deleted the claude/issue-3318-widget-aria-invalid-delivery branch August 4, 2026 05:40
@github-actions

Copy link
Copy Markdown
Contributor

✅ Console Performance Budget

MetricValueBudget
Main entry (gzip)28.1 KB350 KB
Entry fileindex-DA4m84nm.js
StatusPASS

📦 Bundle Size Report

PackageSizeGzipped
app-shell (index.js)8.47KB3.09KB
app-shell (runtime-config.js)7.42KB2.32KB
app-shell (types.js)0.01KB0.04KB
app-shell (urlParams.js)7.57KB2.97KB
auth (AuthContext.js)0.31KB0.24KB
auth (AuthGuard.js)1.17KB0.53KB
auth (AuthProvider.js)22.10KB4.37KB
auth (AuthShell.js)3.49KB1.40KB
auth (ForgotPasswordForm.js)12.21KB3.45KB
auth (LoginForm.js)18.13KB5.39KB
auth (PreviewBanner.js)0.90KB0.50KB
auth (RegisterForm.js)6.64KB2.21KB
auth (SocialSignInButtons.js)9.60KB3.89KB
auth (UserMenu.js)3.40KB1.22KB
auth (auth-gate-events.js)1.29KB0.66KB
auth (authStyles.js)5.04KB1.72KB
auth (createAuthClient.js)35.76KB9.11KB
auth (createAuthenticatedFetch.js)4.37KB1.69KB
auth (index.js)2.35KB1.07KB
auth (org-roles.js)6.66KB2.78KB
auth (phone-identifier.js)1.11KB0.66KB
auth (types.js)0.59KB0.35KB
auth (useAuth.js)4.91KB0.87KB
auth (useIsWorkspaceAdmin.js)1.61KB0.85KB
collaboration (CommentThread.js)18.38KB4.49KB
collaboration (LiveCursors.js)3.17KB1.27KB
collaboration (PresenceAvatars.js)3.65KB1.42KB
collaboration (PresenceProvider.js)2.79KB1.13KB
collaboration (index.js)1.25KB0.53KB
collaboration (useCommentSearch.js)1.98KB0.88KB
collaboration (useConflictResolution.js)7.75KB1.86KB
collaboration (useMentionNotifications.js)1.81KB0.68KB
collaboration (usePresence.js)6.33KB1.84KB
collaboration (useRealtimeSubscription.js)7.91KB2.01KB
components (index.js)476.68KB104.68KB
core (index.js)2.25KB0.80KB
create-plugin (index.js)9.28KB2.98KB
data-objectstack (index.js)136.23KB34.75KB
fields (index.js)226.52KB55.50KB
i18n (LocalizationContext.js)1.76KB0.96KB
i18n (currency.js)1.22KB0.64KB
i18n (i18n.js)4.32KB1.77KB
i18n (index.js)2.46KB0.96KB
i18n (pickLocalized.js)1.70KB0.83KB
i18n (provider.js)5.37KB1.72KB
i18n (useObjectLabel.js)26.14KB6.07KB
i18n (useSafeTranslation.js)3.26KB1.44KB
layout (index.js)38.53KB10.71KB
mobile (MobileProvider.js)0.92KB0.49KB
mobile (ResponsiveContainer.js)0.94KB0.38KB
mobile (breakpoints.js)1.51KB0.70KB
mobile (createOfflineDataSource.js)5.61KB1.74KB
mobile (index.js)1.50KB0.62KB
mobile (offlineQueue.js)3.91KB1.35KB
mobile (pwa.js)0.97KB0.49KB
mobile (serviceWorker.js)1.48KB0.62KB
mobile (serviceWorkerSource.js)3.41KB1.48KB
mobile (useBreakpoint.js)1.54KB0.65KB
mobile (useGesture.js)6.96KB1.98KB
mobile (useOfflineSync.js)1.99KB0.72KB
mobile (usePullToRefresh.js)2.53KB0.85KB
mobile (useResponsive.js)0.71KB0.42KB
mobile (useResponsiveConfig.js)1.36KB0.63KB
mobile (useSpecGesture.js)4.05KB1.53KB
mobile (useTouchTarget.js)1.01KB0.54KB
permissions (MePermissionsProvider.js)8.75KB3.06KB
permissions (PermissionContext.js)0.31KB0.25KB
permissions (PermissionGuard.js)0.89KB0.45KB
permissions (PermissionProvider.js)3.67KB1.12KB
permissions (evaluator.js)4.41KB1.44KB
permissions (index.js)0.91KB0.41KB
permissions (store.js)0.91KB0.42KB
permissions (useFieldPermissions.js)1.28KB0.52KB
permissions (usePermissions.js)1.55KB0.71KB
plugin-ai (index.js)15.71KB3.79KB
plugin-calendar (index.js)44.98KB12.37KB
plugin-charts (index.js)60.54KB17.13KB
plugin-chatbot (index.js)180.09KB42.72KB
plugin-dashboard (index.js)112.01KB28.86KB
plugin-designer (index.js)210.51KB42.51KB
plugin-detail (index.js)230.61KB56.81KB
plugin-editor (index.js)2.46KB1.10KB
plugin-form (index.js)111.54KB26.97KB
plugin-gantt (index.js)162.25KB39.55KB
plugin-grid (index.js)185.08KB49.04KB
plugin-kanban (index.js)47.89KB13.18KB
plugin-list (index.js)104.94KB25.32KB
plugin-map (index.js)16.81KB5.24KB
plugin-markdown (index.js)13.72KB4.69KB
plugin-report (index.js)40.55KB10.59KB
plugin-timeline (index.js)25.76KB7.33KB
plugin-tree (index.js)8.34KB2.82KB
plugin-view (index.js)83.67KB20.43KB
providers (DataSourceProvider.js)0.75KB0.39KB
providers (MetadataProvider.js)1.37KB0.59KB
providers (ThemeProvider.js)1.90KB0.85KB
providers (UploadProvider.js)11.71KB3.53KB
providers (index.js)0.44KB0.22KB
providers (types.js)0.01KB0.04KB
react-runtime (index.js)5.67KB2.37KB
react (LazyPluginLoader.js)3.77KB1.33KB
react (SchemaRenderer.js)19.28KB6.38KB
react (data-invalidation.js)5.05KB2.08KB
react (index.js)1.02KB0.55KB
react (spec-input.js)0.20KB0.18KB
sdui-parser (codegen.js)4.09KB1.74KB
sdui-parser (index.js)4.47KB2.03KB
sdui-parser (parse.js)10.04KB2.82KB
sdui-parser (types.js)0.29KB0.24KB
sdui-parser (validate.js)4.69KB1.48KB
types (ai.js)0.20KB0.17KB
types (api-types.js)0.20KB0.18KB
types (app.js)2.87KB0.99KB
types (base.js)0.20KB0.18KB
types (blocks.js)0.20KB0.18KB
types (complex.js)0.20KB0.18KB
types (crud.js)0.20KB0.18KB
types (data-display.js)0.20KB0.18KB
types (data-protocol.js)0.20KB0.19KB
types (data.js)0.20KB0.18KB
types (designer.js)1.87KB0.85KB
types (disclosure.js)0.20KB0.18KB
types (error-code.js)1.54KB0.88KB
types (feedback.js)0.20KB0.18KB
types (field-types.js)0.20KB0.18KB
types (form.js)0.20KB0.18KB
types (http-retry.js)4.32KB2.02KB
types (index.js)2.46KB1.21KB
types (layout.js)0.20KB0.18KB
types (managed-by.js)0.19KB0.18KB
types (mobile.js)0.20KB0.18KB
types (navigation.js)0.20KB0.18KB
types (objectql.js)0.20KB0.18KB
types (overlay.js)0.20KB0.18KB
types (permissions.js)0.20KB0.18KB
types (plugin-scope.js)0.20KB0.18KB
types (record-components.js)0.20KB0.19KB
types (record-semantics.js)1.28KB0.67KB
types (registry.js)0.20KB0.18KB
types (reports.js)0.20KB0.18KB
types (spec-report.js)5.05KB1.93KB
types (system-fields.js)3.33KB1.54KB
types (theme.js)0.20KB0.18KB
types (ui-action.js)3.40KB1.71KB
types (views.js)0.20KB0.18KB
types (widget.js)0.20KB0.18KB

Size Limits

  • ✅ Core packages should be < 50KB gzipped
  • ✅ Component packages should be < 100KB gzipped
  • ⚠️ Plugin packages should be < 150KB gzipped

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@xuyushun441-sys@claude