Skip to content

Commit 6b097ac

Browse files
cliffhallclaude
andcommitted
review: align error-panel docs with behavior + gate data-app-error on running (PR #1660)
Address the claude[bot] review: - #1 (applied, docs): the error panel renders BELOW the (blank) frame, not in place of it — the renderer stays mounted so a factory error still shows the reason alongside the iframe (gating the frame off on error would drop the auto-launched iframe an integration test relies on). Reworded the README row and the test comment to say "below the frame"; added a code comment. - #2 (applied): gate data-app-error on `running` (like data-app-status) so the two attributes can't desync if a future path sets an error without running. - #3 (no change): resource-read failures staying at data-app-status="loading" (toast only) is intentional and documented. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01BrihGWcrM9JGRyu41nzZYw
1 parent 4ccfc3c commit 6b097ac

3 files changed

Lines changed: 8 additions & 3 deletions

File tree

‎clients/web/README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ The Apps screen exposes a small, stable set of `data-testid` / `data-*` attribut
6363
| `data-testid="apps-form"` | Apps content card | The container that carries the status/error attributes below. |
6464
| `data-app-status` | on `apps-form` | Renderer lifecycle: `idle` (nothing running) → `loading` (bridge building / `ui/initialize` in flight) → `ready` (view fired `notifications/initialized`) → `error` (bridge factory threw/rejected). Poll for `ready`. |
6565
| `data-app-error` | on `apps-form` | The failure reason string when `data-app-status="error"` (e.g. no connected client); absent otherwise. |
66-
| `data-testid="apps-error"` | error panel | Rendered in place of the blank frame when the app fails to load; shows the reason. |
66+
| `data-testid="apps-error"` | error panel | Rendered below the frame when the app fails to load (factory throw/reject); shows the reason so the failure isn't a silent blank frame. |
6767
| `data-testid="open-app"` | Open App button | Launches the selected app. |
6868
| `data-testid="apps-stage"` | Stage-partial button | Snapshots the current form values for progressive-render testing. |
6969
| `data-testid="apps-messages"` | messages panel | `ui/message` submissions from the running view. |

‎clients/web/src/components/screens/AppsScreen/AppsScreen.test.tsx‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -709,7 +709,8 @@ describe("AppsScreen", () => {
709709
expect(getStatus()).toBe("error");
710710
const form = screen.getByTestId("apps-form");
711711
expect(form.getAttribute("data-app-error")).toBe("connect refused");
712-
// The error panel replaces the silent blank frame with the reason.
712+
// The error panel is shown below the frame with the reason, so the
713+
// failure isn't a silent blank frame.
713714
expect(screen.getByTestId("apps-error")).toBeInTheDocument();
714715
expect(screen.getByText("App failed to load")).toBeInTheDocument();
715716
expect(screen.getByText("connect refused")).toBeInTheDocument();

‎clients/web/src/components/screens/AppsScreen/AppsScreen.tsx‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -553,7 +553,7 @@ export function AppsScreen({
553553
h="100%"
554554
data-testid="apps-form"
555555
data-app-status={running ? appStatus : "idle"}
556-
data-app-error={appError?.message}
556+
data-app-error={running ? appError?.message : undefined}
557557
>
558558
{selectedTool ? (
559559
<ContentStack>
@@ -633,6 +633,10 @@ export function AppsScreen({
633633
ref={rendererRef}
634634
/>
635635
</RendererFrame>
636+
{/* Shown BELOW the frame on a factory throw/reject so the reason
637+
is visible alongside the (blank) iframe rather than leaving a
638+
silent blank frame. The renderer stays mounted so an in-place
639+
retry path remains possible. */}
636640
{appError && (
637641
<AppErrorPanel data-testid="apps-error">
638642
<AppErrorTitle>App failed to load</AppErrorTitle>

0 commit comments

Comments
 (0)