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 账本移除、转入正向守卫):
multiselect radio checkboxes tags lookup master_detail user owner file image location object color rating code avatar address geolocation qrcode object-ref

落点值得说明的:

widget 真实可聚焦控件 / 处理
radio Radix 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-picker Combobox(components 包)新增标准 button 属性到其可聚焦 role="combobox" trigger 的转发——#3306 给 SelectTrigger 开的同一条缝,否则 combobox 型 widget 无处送达
file / image / avatar 可聚焦上传控件(dropzone role="button" / 上传按钮)——通往隐藏 file input 的键盘路径
address / geolocation 复合子输入:spread 落第一个子输入,aria-invalid每个子输入(表单级失败意味着整个复合值缺失)
object / filter-condition aria-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 sweep 48 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/components 69 files / 530 passed
app-shell 关联 FlowReferenceField.lookup.test 11 passed
typecheck turbo run type-check --filter=@object-ui/components --filter=@object-ui/fields 11 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

claude added 2 commits August 4, 2026 05:30
…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
@vercel

vercel Bot commented Aug 4, 2026

Copy link
Copy Markdown

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

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
objectui Ignored Ignored Aug 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 queue Aug 4, 2026
Merged via the queue into main with commit 8d8094a Aug 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

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

✅ Console Performance Budget

Metric Value Budget
Main entry (gzip) 28.1 KB 350 KB
Entry file index-DA4m84nm.js
Status PASS

📦 Bundle Size Report

Package Size Gzipped
app-shell (index.js) 8.47KB 3.09KB
app-shell (runtime-config.js) 7.42KB 2.32KB
app-shell (types.js) 0.01KB 0.04KB
app-shell (urlParams.js) 7.57KB 2.97KB
auth (AuthContext.js) 0.31KB 0.24KB
auth (AuthGuard.js) 1.17KB 0.53KB
auth (AuthProvider.js) 22.10KB 4.37KB
auth (AuthShell.js) 3.49KB 1.40KB
auth (ForgotPasswordForm.js) 12.21KB 3.45KB
auth (LoginForm.js) 18.13KB 5.39KB
auth (PreviewBanner.js) 0.90KB 0.50KB
auth (RegisterForm.js) 6.64KB 2.21KB
auth (SocialSignInButtons.js) 9.60KB 3.89KB
auth (UserMenu.js) 3.40KB 1.22KB
auth (auth-gate-events.js) 1.29KB 0.66KB
auth (authStyles.js) 5.04KB 1.72KB
auth (createAuthClient.js) 35.76KB 9.11KB
auth (createAuthenticatedFetch.js) 4.37KB 1.69KB
auth (index.js) 2.35KB 1.07KB
auth (org-roles.js) 6.66KB 2.78KB
auth (phone-identifier.js) 1.11KB 0.66KB
auth (types.js) 0.59KB 0.35KB
auth (useAuth.js) 4.91KB 0.87KB
auth (useIsWorkspaceAdmin.js) 1.61KB 0.85KB
collaboration (CommentThread.js) 18.38KB 4.49KB
collaboration (LiveCursors.js) 3.17KB 1.27KB
collaboration (PresenceAvatars.js) 3.65KB 1.42KB
collaboration (PresenceProvider.js) 2.79KB 1.13KB
collaboration (index.js) 1.25KB 0.53KB
collaboration (useCommentSearch.js) 1.98KB 0.88KB
collaboration (useConflictResolution.js) 7.75KB 1.86KB
collaboration (useMentionNotifications.js) 1.81KB 0.68KB
collaboration (usePresence.js) 6.33KB 1.84KB
collaboration (useRealtimeSubscription.js) 7.91KB 2.01KB
components (index.js) 476.68KB 104.68KB
core (index.js) 2.25KB 0.80KB
create-plugin (index.js) 9.28KB 2.98KB
data-objectstack (index.js) 136.23KB 34.75KB
fields (index.js) 226.52KB 55.50KB
i18n (LocalizationContext.js) 1.76KB 0.96KB
i18n (currency.js) 1.22KB 0.64KB
i18n (i18n.js) 4.32KB 1.77KB
i18n (index.js) 2.46KB 0.96KB
i18n (pickLocalized.js) 1.70KB 0.83KB
i18n (provider.js) 5.37KB 1.72KB
i18n (useObjectLabel.js) 26.14KB 6.07KB
i18n (useSafeTranslation.js) 3.26KB 1.44KB
layout (index.js) 38.53KB 10.71KB
mobile (MobileProvider.js) 0.92KB 0.49KB
mobile (ResponsiveContainer.js) 0.94KB 0.38KB
mobile (breakpoints.js) 1.51KB 0.70KB
mobile (createOfflineDataSource.js) 5.61KB 1.74KB
mobile (index.js) 1.50KB 0.62KB
mobile (offlineQueue.js) 3.91KB 1.35KB
mobile (pwa.js) 0.97KB 0.49KB
mobile (serviceWorker.js) 1.48KB 0.62KB
mobile (serviceWorkerSource.js) 3.41KB 1.48KB
mobile (useBreakpoint.js) 1.54KB 0.65KB
mobile (useGesture.js) 6.96KB 1.98KB
mobile (useOfflineSync.js) 1.99KB 0.72KB
mobile (usePullToRefresh.js) 2.53KB 0.85KB
mobile (useResponsive.js) 0.71KB 0.42KB
mobile (useResponsiveConfig.js) 1.36KB 0.63KB
mobile (useSpecGesture.js) 4.05KB 1.53KB
mobile (useTouchTarget.js) 1.01KB 0.54KB
permissions (MePermissionsProvider.js) 8.75KB 3.06KB
permissions (PermissionContext.js) 0.31KB 0.25KB
permissions (PermissionGuard.js) 0.89KB 0.45KB
permissions (PermissionProvider.js) 3.67KB 1.12KB
permissions (evaluator.js) 4.41KB 1.44KB
permissions (index.js) 0.91KB 0.41KB
permissions (store.js) 0.91KB 0.42KB
permissions (useFieldPermissions.js) 1.28KB 0.52KB
permissions (usePermissions.js) 1.55KB 0.71KB
plugin-ai (index.js) 15.71KB 3.79KB
plugin-calendar (index.js) 44.98KB 12.37KB
plugin-charts (index.js) 60.54KB 17.13KB
plugin-chatbot (index.js) 180.09KB 42.72KB
plugin-dashboard (index.js) 112.01KB 28.86KB
plugin-designer (index.js) 210.51KB 42.51KB
plugin-detail (index.js) 230.61KB 56.81KB
plugin-editor (index.js) 2.46KB 1.10KB
plugin-form (index.js) 111.54KB 26.97KB
plugin-gantt (index.js) 162.25KB 39.55KB
plugin-grid (index.js) 185.08KB 49.04KB
plugin-kanban (index.js) 47.89KB 13.18KB
plugin-list (index.js) 104.94KB 25.32KB
plugin-map (index.js) 16.81KB 5.24KB
plugin-markdown (index.js) 13.72KB 4.69KB
plugin-report (index.js) 40.55KB 10.59KB
plugin-timeline (index.js) 25.76KB 7.33KB
plugin-tree (index.js) 8.34KB 2.82KB
plugin-view (index.js) 83.67KB 20.43KB
providers (DataSourceProvider.js) 0.75KB 0.39KB
providers (MetadataProvider.js) 1.37KB 0.59KB
providers (ThemeProvider.js) 1.90KB 0.85KB
providers (UploadProvider.js) 11.71KB 3.53KB
providers (index.js) 0.44KB 0.22KB
providers (types.js) 0.01KB 0.04KB
react-runtime (index.js) 5.67KB 2.37KB
react (LazyPluginLoader.js) 3.77KB 1.33KB
react (SchemaRenderer.js) 19.28KB 6.38KB
react (data-invalidation.js) 5.05KB 2.08KB
react (index.js) 1.02KB 0.55KB
react (spec-input.js) 0.20KB 0.18KB
sdui-parser (codegen.js) 4.09KB 1.74KB
sdui-parser (index.js) 4.47KB 2.03KB
sdui-parser (parse.js) 10.04KB 2.82KB
sdui-parser (types.js) 0.29KB 0.24KB
sdui-parser (validate.js) 4.69KB 1.48KB
types (ai.js) 0.20KB 0.17KB
types (api-types.js) 0.20KB 0.18KB
types (app.js) 2.87KB 0.99KB
types (base.js) 0.20KB 0.18KB
types (blocks.js) 0.20KB 0.18KB
types (complex.js) 0.20KB 0.18KB
types (crud.js) 0.20KB 0.18KB
types (data-display.js) 0.20KB 0.18KB
types (data-protocol.js) 0.20KB 0.19KB
types (data.js) 0.20KB 0.18KB
types (designer.js) 1.87KB 0.85KB
types (disclosure.js) 0.20KB 0.18KB
types (error-code.js) 1.54KB 0.88KB
types (feedback.js) 0.20KB 0.18KB
types (field-types.js) 0.20KB 0.18KB
types (form.js) 0.20KB 0.18KB
types (http-retry.js) 4.32KB 2.02KB
types (index.js) 2.46KB 1.21KB
types (layout.js) 0.20KB 0.18KB
types (managed-by.js) 0.19KB 0.18KB
types (mobile.js) 0.20KB 0.18KB
types (navigation.js) 0.20KB 0.18KB
types (objectql.js) 0.20KB 0.18KB
types (overlay.js) 0.20KB 0.18KB
types (permissions.js) 0.20KB 0.18KB
types (plugin-scope.js) 0.20KB 0.18KB
types (record-components.js) 0.20KB 0.19KB
types (record-semantics.js) 1.28KB 0.67KB
types (registry.js) 0.20KB 0.18KB
types (reports.js) 0.20KB 0.18KB
types (spec-report.js) 5.05KB 1.93KB
types (system-fields.js) 3.33KB 1.54KB
types (theme.js) 0.20KB 0.18KB
types (ui-action.js) 3.40KB 1.71KB
types (views.js) 0.20KB 0.18KB
types (widget.js) 0.20KB 0.18KB

Size Limits

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

Sign up for free to 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