Repository navigation
Commit 601c773
fix(app-shell): draw the draft preview failure and empty panes with the shared view states (#26135)
<!-- claude-projects-attribution: {"github_login":"os-steve"} -->
_Requested by **Steve** · [project
thread](https://claude.ai/code/project/chan_01FdL1XeUyvVNxLreh3F4Qi9?thread=cmsg_01FdL1XeUyvVNxLreh3F4Qi97Yc9Hw7zbkBCZQmMnndL2D)_
Part of #25915
Clause-②: no (one surface swaps its own block for the shared components;
no exported type change. If the shared component needs a new prop, the
thread reports first and the seat amends this line)
Metadata-protocol: none
## What
Slice 1 of #25915: one surface moves onto the shared view states.
`ui/packages/app-shell/src/preview/PreviewDraftEmptyState.tsx` (the pane
a `?preview=draft` tree shows when it has nothing to draw) no longer
composes the bare `Empty` primitive:
- overlay read failed: `DataErrorState`, so it is `role="alert"`;
- app not in the draft yet, or nothing drafted: `DataEmptyState`, so it
is `role="status"`.
Text (same i18n keys and default values), the Retry control
(`preview-draft-retry`, glyph included) and the outer
`preview-draft-empty-state` wrapper are unchanged. The title and icon
take the shared components' sizes, which is the visual diff.
## Why this surface (measured on main 6d15aca)
app-shell defines six empty blocks of its own and imports
`DataEmptyState` / `DataErrorState` zero times. Importers per block:
`InspectorEmptyState` 7, `StudioEmptyState` 4, `PreviewEmptyState` 3,
`AppNoAccessEmptyState` 2, `agentEmptyState` 1, `PreviewDraftEmptyState`
1.
`PreviewDraftEmptyState` is the only one of the six that draws a load
**failure**, and it drew it as the same unlabelled node as its empty
case, so a failed draft-overlay read was announced as nothing. The
card's "route renderer catch paths to `DataErrorState`" lands exactly
here. It has one importer (`AppContent.tsx`, not edited), is outside
`ObjectView.tsx` and seat 2's packages, and no `claude/*` branch on
origin touches it (depth-1 blob compare of all 707 heads against main;
control file `DraftChangesPanel.tsx` differs on many). Non-`claude/*`
branches were not scanned.
app-shell is outside the sdui registry closure: `node
scripts/gen-sdui-manifest-node.mjs` re-recorded
`scripts/sdui-manifest.record.json` byte-identical (922 files in 27
packages), so the record is not in the diff.
## Tests
New
`ui/packages/app-shell/src/preview/__tests__/PreviewDraftEmptyState.sharedStates-25915.test.tsx`:
failure is `role="alert"` with `data-slot="data-error-state"` and no
status; not-yet-drafted and nothing-drafted are `role="status"` with
`data-slot="data-empty-state"` and no alert; one Retry control in each
pane calls `onRetry`.
- Run at 250585b: that file plus
`ui/packages/i18n/src/__tests__/draftBar-es-register-3844.test.ts`
(which names this component), `Test Files 2 passed (2)`, `Tests 15
passed (15)`.
- Ablation: with the fix committed, the source reverted to its main
version, the new file reads `Tests 3 failed | 2 passed (5)` (the three
role tests red, the two Retry tests green as expected); restored with
`git checkout HEAD --`, `git diff HEAD` empty and blob hash equal to
HEAD.
- `pnpm --filter @object-ui/app-shell type-check` (both `tsc --noEmit`
and `tsc -p tsconfig.test.json`), after building
`@object-ui/app-shell^...`: exit 0.
## Acceptance notes
- The rest of app-shell's blocks (`InspectorEmptyState`,
`StudioEmptyState`, `PreviewEmptyState`, `AppNoAccessEmptyState`,
`agentEmptyState`) stay for later slices; #25915 remains open.
- `DataErrorState`'s own `onRetry` button carries no glyph or test id,
so this surface passes its existing Retry button as children rather than
adding a prop to the shared component.
---
_Generated by [Claude
Code](https://claude.ai/code/session_01FdXMkfnYedDKghz7QLUkx8)_
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01FdXMkfnYedDKghz7QLUkx8
Co-authored-by: Claude <noreply@anthropic.com>1 parent a2dfaeb commit 601c773
3 files changed
Lines changed: 123 additions & 29 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
26 | 34 | | |
27 | 35 | | |
28 | 36 | | |
29 | | - | |
| 37 | + | |
30 | 38 | | |
31 | 39 | | |
32 | 40 | | |
| |||
40 | 48 | | |
41 | 49 | | |
42 | 50 | | |
43 | | - | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
44 | 60 | | |
45 | 61 | | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
54 | 77 | | |
55 | 78 | | |
56 | 79 | | |
57 | 80 | | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
77 | 90 | | |
78 | 91 | | |
79 | 92 | | |
| 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