You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit dc53d4a
Browse filesBrowse the repository at this point in the historyBrowse files
fix(app-shell): disabled Explain and Pick in Explain access say an object is missing (#35289)
<!-- claude-projects-attribution: {"github_login":"os-bill"} -->
_Requested by **Bill** · [project
thread](https://claude.ai/code/project/chan_016iMXWSZDzqWRWvWzdNo8wg?thread=cmsg_016iMXWSZDzqWRWvWzdNo8wg6v19uPsX6gX42G8tGcvvzb)_Fixes#34865
Clause-②: no
Metadata-protocol: none
## 维护者速读
改了什么:Studio「权限解释」(Explain access)面板里,未选对象时灰掉的「解释」按钮和记录「选择」按钮,现在鼠标悬停、键盘
Tab 聚焦、读屏软件三条路都能拿到原因「请先选择对象」。
为什么改:原来两个按钮是原生 disabled,悬停无提示、Tab 跳过、读屏读不到原因;「选择」唯一的 title
就是它自己的名字「Pick」。
风险与回滚:只改显示与可达性,复用已落地的共享包装
`DisabledControlReason`,不改解释请求逻辑;选了对象后两个按钮与原来一样。回滚 = revert 本 PR。
先看:`ui/packages/app-shell/src/views/metadata-admin/AccessExplainPanel.tsx`(两处按钮外包一层
`DisabledControlReason`)→ `AccessExplainPanel.test.tsx` 末尾新增的 describe →
`ui/packages/i18n/src/namespaces/studio/en.ts` / `zh.ts` 各一行新文案。
两分钟验证:`pnpm --filter @object-ui/app-shell exec vitest run --maxWorkers=2
src/views/metadata-admin/AccessExplainPanel.test.tsx`,预期全部通过(含新增 2 条)。
需要你做的:无,席位落地。
## What changes
With no object chosen, "Explain access" draws Explain and the record
Pick disabled, and both were bare disabled buttons: a natively disabled
button takes neither hover nor focus, so no tooltip opened, Tab skipped
it, and nothing reached the accessibility tree. Pick's only `title` was
its own label, "Pick".
Both now take the treatment the closed#32103, #32104 and #32105 gave
the same class (`ux-conventions.disabled-control-reason`), by reusing
the shared `DisabledControlReason` wrapper from
`metadata-admin/inspectors/_shared.tsx` unchanged: a focusable wrapper
opens a tooltip with the reason, and the wrapper and the button both
point `aria-describedby` at an `sr-only` copy of it. Each button keeps
its own name.
- Reason: one new string, `engine.studio.access.explain.needObject`
("Choose an object first" / "请先选择对象"), in the Studio namespace
catalogues of `@object-ui/i18n`. Both buttons wait on the same
condition, so they share it.
- Explain while a run is in flight gives no reason: its label already
says "Explaining…".
- Pick's redundant `title` (equal to its visible label) is dropped, so a
native tooltip no longer competes with the reason.
- The disabled predicates are unchanged (`!objectName.trim()`, and `busy
||` for Explain).
- Root changeset: `patch` on `@object-ui/app-shell` and
`@object-ui/i18n`, as the prior fix of this class shipped.
## Tests
New top-level describe in the existing harness
`AccessExplainPanel.test.tsx`:
- No object: Pick and Explain are disabled and each is described by the
reason; Pick carries no `title`; Tab from the record-id input lands on
Pick's wrapper, then on Explain's wrapper, each described by the reason,
and the tooltip shows it.
- CONTROL: an object typed in, both are plain enabled buttons, with no
`aria-describedby`, no `data-disabled-reason` and no `tabindex` on the
wrapper.
## Acceptance notes
- File surface: the dispatch fenced `AccessExplainPanel.tsx`, its tests
and the root changeset. The reason string has to live in the Studio
namespace catalogue, so `ui/packages/i18n/src/namespaces/studio/en.ts`
and `zh.ts` each gain one line, the same place the prior fix of this
class put its strings. The shared helper is reused, not edited.
## Verification
Local runs at the head this PR was opened on:
- `node scripts/pm/overlap-check.mjs`: `VERDICT clean exit 0` before
each push.
- Derived local gate subset, each exit 0: `check-adr-0087-registration
--base origin/main`, `check-changeset-no-major --base origin/main`,
`check-empty-changeset --base origin/main`, `check-sdui-manifest`,
`check:nul-bytes`, `check:published-files`,
`check:cross-package-test-inputs`, `check:test-source-alias`,
`check:undeclared-dep-imports`, `check:closed-ceremony-text`,
`check:type-check-coverage`.
- NOT MEASURED locally: the app-shell vitest file and the UI type-check.
Reason: the shared verify lock was held for the whole session by another
run of the full app-shell suite, and five timed attempts did not acquire
it. This is a declared narrowing; `Test UI` and `Type Check UI` on this
PR are the evidence, and the dev report records the outcome.
---
_Generated by [Claude
Code](https://claude.ai/code/session_01Utp6CbSphdunq2aJq7ktuY)_
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01Utp6CbSphdunq2aJq7ktuY
<!-- signed: repo:objectstack#5 · os-bill ·
session_01Utp6CbSphdunq2aJq7ktuY -->
---------
Co-authored-by: Claude <noreply@anthropic.com>
fix(app-shell): Studio's "Explain access" says why Explain and Pick are disabled, on hover, on keyboard focus and to assistive technology
7
+
8
+
Clause-②: no
9
+
Metadata-protocol: none
10
+
11
+
With no object chosen, the Explain button and the record Pick button were bare disabled buttons: no tooltip on hover, skipped by Tab, and nothing in the accessibility tree (Pick's only title was its own label, "Pick"). Both now sit in the shared `DisabledControlReason` wrapper the Studio form designer, create dialog and metadata Save already use: a focusable wrapper that opens a tooltip with the reason "Choose an object first", and both the wrapper and the button point `aria-describedby` at it. Each button keeps its own name; once an object is chosen both are plain enabled buttons, and a running Explain gives no reason because its label already says "Explaining…". The new string is in the Studio namespace catalogues (`en`, `zh`) of `@object-ui/i18n`.
0 commit comments