Repository navigation
Commit 64e5efd
fix(ui): draw a refused list or related-list read as no-access, not a retryable failure (#27856)
<!-- claude-projects-attribution: {"github_login":"os-bill"} -->
_Requested by **Bill** · [project
thread](https://claude.ai/code/project/chan_016iMXWSZDzqWRWvWzdNo8wg?thread=cmsg_016iMXWSZDzqWRWvWzdNo8wgDFH4S5pR1C8YvYCWWsZfXx)_
## 维护者速读
-
改了什么:列表读取被拒(403)时不再显示「重试」按钮;记录页相关列表读取被拒时改画一行中性的「无权访问」提示,不再是红框加「你无权执行此操作」。
- 为什么改:成员只是没有读权限,重试不可能变好;红色的动作拒绝句让只来查看记录的人以为自己做错了事。
- 风险与回滚:只动两个组件的拒绝态分支,5xx、网络失败、api-disabled 的画法不变;回滚即还原本 PR 两个源文件。
- 先看:`ui/packages/plugin-detail/src/RelatedList.tsx` 的
`RelatedListLoadFailed`;`ui/packages/plugin-list/src/ListView.tsx` 的
`list-error-retry` 条件。
- 两分钟验证:`pnpm --dir ui exec vitest run
packages/plugin-list/src/__tests__/ListView.forbiddenNoRetry.test.tsx
packages/plugin-detail/src/__tests__/RelatedList.readFailed-26415.test.tsx`,预期全绿。
- 需要你做的:无,席位落地。
Fixes #27841
Clause-②: no
Metadata-protocol: none
## What changes
- **List view (`plugin-list` `ListView`).** The load-error panel no
longer draws the Retry button for the `forbidden` kind (a 403 /
`PERMISSION_DENIED` read), joining `api-disabled`. A refusal is a grant
only an administrator can give, so a retry re-reaches the same refusal.
`network` (network failures and 5xx), `unauthorized` and `rejected` keep
Retry.
- **Related list (`plugin-detail` `RelatedListLoadFailed`).** A
`forbidden` read is drawn as a neutral line: `role="status"` instead of
`alert`, `border-border bg-muted/40` and a muted icon instead of the
destructive tint, no Retry, and always the list's existing no-access
sentence (`list.loadErrorForbiddenTitle` /
`list.loadErrorForbiddenMessage`). A producer's `userMessage` on a 403
is no longer shown there: the server marks the generic action refusal
("You do not have permission to perform this action. Contact your
administrator if you need access.") on a refused read, which was the red
sentence the card saw. Every other kind is drawn exactly as before.
- No new i18n key; no copy changed.
## Tests
- New `plugin-list/src/__tests__/ListView.forbiddenNoRetry.test.tsx`: a
403 draws the no-access panel with no Retry; controls: a 500 and a
network failure still draw Retry.
- `plugin-detail/src/__tests__/RelatedList.readFailed-26415.test.tsx`
gains a describe: a 403 carrying the action-refusal `userMessage` draws
`role="status"`, no destructive class on the line or its icon, the
no-access title and sentence, no "perform this action", no Retry;
controls: a 5xx keeps `role="alert"`, the destructive styling and Retry;
a readable related list draws its rows.
- `ListView.errorStateComponent-7143.test.tsx`: the "retry button is
still rendered" arm now fails with a 500 instead of a 403, since a 403
no longer offers one.
## Acceptance notes
- **Repro on main = the ablation.** Both source files restored to the
base `38651598` (tests unchanged): the two new refusal tests fail
(ListView: Retry button present; RelatedList: `role="alert"` received
where `status` expected), and their 14 sibling tests, the controls
included, pass. Restored by `git checkout HEAD`, `git diff HEAD` empty,
blob hashes equal HEAD. The red action sentence on main is read from the
code (`declaredUserMessage` wins over the fixed copy) and is asserted
absent by the new test on the fixed tree; it was not measured on a live
stack.
- `unauthorized` (401, "Sign in required") still offers Retry in both
places. The card names 403 only; left as is.
- The ListView forbidden panel still uses its `text-destructive/60`
icon; the card asks only that it drop Retry.
- Seat 4's draft PR #27793 regions (`RelatedList.tsx` docblock near the
API-door note, `RecordDetailView.tsx` `apiHandler`) are not touched;
this diff edits only `RelatedListLoadFailed` and its docblock.
## Verification
All readings on head `fa457cd3` (branch merged with `origin/main`).
<details><summary>Tests and type-check</summary>
- `pnpm --dir ui exec vitest run --maxWorkers=2` on
`ListView.forbiddenNoRetry.test.tsx`,
`ListView.errorStateComponent-7143.test.tsx`,
`ListView.loadErrorKind.test.tsx`,
`RelatedList.readFailed-26415.test.tsx`: Test Files 4 passed (4), Tests
39 passed (39); os-verify-lock VERDICT command-exit 0.
- Ablation (base source, new tests): Tests 2 failed, 14 passed (16);
VERDICT command-exit 1; the two failures are the two refusal tests.
- `pnpm --filter @object-ui/plugin-list --filter
@object-ui/plugin-detail run type-check` (tsc --noEmit and
tsconfig.test.json): VERDICT command-exit 0, on the pre-merge head; the
merge brought nothing under these packages.
</details>
<details><summary>Gates</summary>
- `dispatch-gates --commands` derived 34 families; all 34 ran, exit 0.
`--ran` reconciliation: 34 derived, 34 run, 0 NOT-MEASURED, 0 UNRUN.
`node scripts/check-sdui-manifest.mjs` among them, exit 0.
- `pnpm check:new-line-citations` (ui): 0 new citation(s), exit 0.
- Repo-wide families and Test UI belong to CI; see this PR's check-runs.
</details>
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---
_Generated by [Claude
Code](https://claude.ai/code/session_01Utp6CXjatjJmMJkdAQoyqn)_
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent d07e8d1 commit 64e5efd
6 files changed
Lines changed: 163 additions & 12 deletions
File tree
- .changeset
- ui/packages
- plugin-detail/src
- __tests__
- plugin-list/src
- __tests__
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
577 | 577 | | |
578 | 578 | | |
579 | 579 | | |
580 | | - | |
581 | | - | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
582 | 588 | | |
583 | 589 | | |
584 | 590 | | |
585 | 591 | | |
586 | 592 | | |
| 593 | + | |
587 | 594 | | |
588 | | - | |
| 595 | + | |
589 | 596 | | |
590 | 597 | | |
591 | 598 | | |
592 | 599 | | |
593 | 600 | | |
594 | 601 | | |
595 | 602 | | |
596 | | - | |
| 603 | + | |
597 | 604 | | |
598 | 605 | | |
599 | | - | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
600 | 610 | | |
601 | | - | |
| 611 | + | |
602 | 612 | | |
603 | 613 | | |
604 | | - | |
| 614 | + | |
605 | 615 | | |
606 | 616 | | |
607 | 617 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
281 | 281 | | |
282 | 282 | | |
283 | 283 | | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6431 | 6431 | | |
6432 | 6432 | | |
6433 | 6433 | | |
6434 | | - | |
6435 | | - | |
6436 | | - | |
6437 | | - | |
| 6434 | + | |
| 6435 | + | |
| 6436 | + | |
| 6437 | + | |
| 6438 | + | |
| 6439 | + | |
6438 | 6440 | | |
| 6441 | + | |
6439 | 6442 | | |
6440 | 6443 | | |
6441 | 6444 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
107 | 107 | | |
108 | 108 | | |
109 | 109 | | |
110 | | - | |
| 110 | + | |
111 | 111 | | |
112 | 112 | | |
113 | 113 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
0 commit comments