Repository navigation
Commit c4c515a
fix(app-shell): announce the route object-read and page record-load failures (#27366)
<!-- claude-projects-attribution: {"github_login":"os-warren"} -->
_Requested by **Warren** · [project
thread](https://claude.ai/code/project/chan_01U5RdnAAmkSQmZbqh6FtqZ8?thread=cmsg_01U5RdnAAmkSQmZbqh6FtqZ8MCjwDfBRBbh1qJBm2tbXAr)_
Part of #25915 (slice 3 of ruling B; slice 4, the retirement of
`ViewSkeleton` / `ShimmerSkeleton`, is the PR that closes the card).
Clause-②: no
Metadata-protocol: none
## 维护者速读
- 改了什么:控制台里两处"加载失败"画面(路由对象读取失败、自定义页面记录读取失败)改用共享的 `DataErrorState` 组件绘制。
- 为什么改:原来这两处用无 `role` 的 `Empty` 手绘,读屏软件在读取失败时什么都听不到;共享组件天生
`role="alert"`,失败会被播报,也与"空"区分开。
- 风险与回滚:只换呈现组件,文案、i18n 键、测试 id、重试按钮都不变;视觉上多一个红色小图标方块。回滚即还原这两个文件。
- 先看:`ui/packages/app-shell/src/views/PageView.tsx`
的失败分支;`ui/packages/app-shell/src/console/AppContent.tsx` 的
`RouteObjectReadFailed`。
- 两分钟验证:`pnpm --dir ui exec vitest run
packages/app-shell/src/views/__tests__/PageView.appPageRecord-12931.test.tsx`,预期全部通过,含新增的
`#25915` 用例。
- 需要你做的:无,席位落地。
## What changes
- `RouteObjectReadFailed`
(`ui/packages/app-shell/src/console/AppContent.tsx`) and the page
record-scope load failure
(`ui/packages/app-shell/src/views/PageView.tsx`) render `DataErrorState`
from `@object-ui/components` instead of a hand-drawn `Empty`. The
failure node is now `role="alert"` by construction.
- Kept unchanged: the i18n keys and defaults (`list.loadErrorTitle` /
`list.loadErrorMessage`, `empty.recordLoadFailed` /
`empty.recordLoadFailedDescription`, `common.retry`), the test ids
(`route-object-read-failed`, `page-record-load-failed` and their
`-retry` buttons) and both Retry handlers.
- No new prop on the shared component: the test id spreads onto the root
through `...props`, and Retry is passed as `children` (the component's
documented slot for a call site's own control) rather than `onRetry`, so
it keeps its own test id and, on the page, its icon. The shared default
icon (destructive `AlertCircle` square) replaces the page block's muted
`AlertTriangle`; `AlertTriangle` drops from the page's imports.
- Changeset: `@object-ui/app-shell` is `private: true`, but its code
ships inside the published `@object-ui/console` SPA, so the changeset
bumps both as `patch` (the same pair recent app-shell fixes carry).
## Tests
- New pin in `AppContent.disabledPackageDeepLink-13052.test.tsx`: on a
5xx read the `route-object-read-failed` node has `role="alert"` and
contains its Retry; Retry asks once more and the served object renders
with no alert. The existing served-object CONTROL also asserts no alert.
- New pin in `PageView.appPageRecord-12931.test.tsx`: the failed read's
node has `role="alert"` and contains Retry; Retry re-reads, the loaded
row renders, and no alert remains.
## Acceptance notes
Other app-shell blocks that draw a load failure by hand (listed for the
card; not moved here, per the order):
`views/metadata-admin/AuditPanel.tsx` (`audit-error-state`, an `Empty`),
`views/metadata-admin/ResourceEditPage.tsx` (`refs-error`, an `Empty`),
`views/metadata-admin/DirectoryPage.tsx` (the
`engine.directory.loadFailed` line, a bare `text-destructive` div), and
`chrome/ErrorBoundary.tsx` (the boundary fallback, an `Empty`).
`objectViewHeaderChrome.tsx` also has one but is under the `ObjectView*`
exclusion.
## Verification
All readings at head `72976b7a` (base `eef83734`).
<details><summary>Tests and ablation</summary>
- The two touched files, under `os-verify-lock`: `pnpm --dir ui exec
vitest run --maxWorkers=2` on both. VERDICT command-exit 0, Test Files 2
passed (2), Tests 23 passed (23).
- Ablation, with the fix committed: both source files reverted to
`origin/main` (the `Empty` blocks: a `grep -c` for the `DataErrorState`
JSX opener reads 0 in each file, and for the old `Empty` opener carrying
the test id reads 1 in each). VERDICT command-exit 1, Tests 2 failed |
21 passed (23). The two `#25915` pins went red on
`toHaveAttribute('role', 'alert')`, and every other test stayed green.
Restored with `git checkout HEAD --`: both blob hashes equal `HEAD`,
`git diff HEAD` empty.
- Every app-shell test file that imports `AppContent` or `PageView` (56
files), under the lock: VERDICT command-exit 0, Test Files 56 passed
(56), Tests 358 passed (358).
- `pnpm --filter @object-ui/app-shell type-check` (`tsc --noEmit` + `tsc
-p tsconfig.test.json`), after building `@object-ui/app-shell^...`:
VERDICT command-exit 0, 0 `error TS`.
</details>
<details><summary>Gates</summary>
- `dispatch-gates --commands --repo objectstack-ai/objectstack` derived
34 families. All 34 ran, each with its exit code captured before any
pipe, and all 34 exited 0 (`pnpm --dir ui exec vitest run scripts/` ran
under the lock: 174 files passed, 2 skipped). `--ran` reconciliation: 34
derived, 34 run, 0 NOT-MEASURED.
- `dispatch-gates --tier`: no path-derived mandate.
- `pnpm --dir ui run check:new-line-citations`: 0 new citations, exit 0.
- Changed lines: 129 (+89 / -40), under the 3000 human-merge threshold.
</details>
---
_Generated by [Claude
Code](https://claude.ai/code/session_01JQwxbZK9w6fe2Y6mGQjj6L)_
Co-authored-by: Claude <noreply@anthropic.com>1 parent 7587fd4 commit c4c515a
5 files changed
Lines changed: 89 additions & 40 deletions
File tree
- .changeset
- ui/packages/app-shell/src
- console
- __tests__
- views
- __tests__
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| |||
1868 | 1868 | | |
1869 | 1869 | | |
1870 | 1870 | | |
| 1871 | + | |
| 1872 | + | |
| 1873 | + | |
1871 | 1874 | | |
1872 | 1875 | | |
1873 | | - | |
1874 | | - | |
1875 | | - | |
1876 | | - | |
1877 | | - | |
1878 | | - | |
1879 | | - | |
1880 | | - | |
1881 | | - | |
1882 | | - | |
1883 | | - | |
1884 | | - | |
1885 | | - | |
| 1876 | + | |
| 1877 | + | |
| 1878 | + | |
| 1879 | + | |
| 1880 | + | |
| 1881 | + | |
| 1882 | + | |
| 1883 | + | |
| 1884 | + | |
| 1885 | + | |
| 1886 | + | |
1886 | 1887 | | |
1887 | 1888 | | |
1888 | 1889 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
272 | 272 | | |
273 | 273 | | |
274 | 274 | | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
275 | 293 | | |
276 | 294 | | |
277 | 295 | | |
| |||
286 | 304 | | |
287 | 305 | | |
288 | 306 | | |
| 307 | + | |
289 | 308 | | |
290 | 309 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
33 | | - | |
| 32 | + | |
| 33 | + | |
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| |||
268 | 268 | | |
269 | 269 | | |
270 | 270 | | |
271 | | - | |
272 | | - | |
273 | | - | |
274 | | - | |
275 | | - | |
276 | | - | |
277 | | - | |
278 | | - | |
279 | | - | |
280 | | - | |
281 | | - | |
282 | | - | |
283 | | - | |
284 | | - | |
285 | | - | |
286 | | - | |
287 | | - | |
288 | | - | |
289 | | - | |
290 | | - | |
291 | | - | |
292 | | - | |
293 | | - | |
294 | | - | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
295 | 290 | | |
296 | 291 | | |
297 | 292 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
337 | 337 | | |
338 | 338 | | |
339 | 339 | | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
340 | 361 | | |
0 commit comments