Skip to content

web: app lifecycle status + machine-readable data attributes on the Apps screen#1660

Open
cliffhall wants to merge 1 commit into
v2/1571-stage-partial-inputfrom
v2/1572-app-status
Open

web: app lifecycle status + machine-readable data attributes on the Apps screen#1660
cliffhall wants to merge 1 commit into
v2/1571-stage-partial-inputfrom
v2/1572-app-status

Conversation

@cliffhall

Copy link
Copy Markdown
Member

Closes #1572

Exposes the app-renderer lifecycle machine-readably so automated drivers can waitForSelector instead of sleeping (re-implementation of the relevant slice of PR #1510).

Changes

AppRenderer

  • New AppRendererStatus (loading | ready | error) + onAppStatusChange callback. Fires loading at the start of every (re)build, ready on the view's initialized signal, error on a factory throw/rejection.

AppsScreen

  • appStatus/appError state; handleAppError captures the reason locally and forwards to the parent onError. resetAppChannels clears both.
  • Surfaces the contract as data-testid="apps-form" carrying data-app-status + data-app-error, renders an error panel (data-testid="apps-error") in place of the blank frame, and tags the stage button data-testid="apps-stage".
  • AppDetailPanel's Open App button gains data-testid="open-app".

App.tsx

  • Wires the bridge factory's onResourceError to a red toast so a malformed/404 UI resource is no longer console-only (the renderer separately drives data-app-status, so a driver times out on never-reaching-ready and reads the toast).

Docs

  • Documents the data-testid/data-* automation contract in clients/web/README.md.

Tests

  • AppRenderer: loading→ready transition, error on sync throw and async reject.
  • AppsScreen: idle/loading/ready status, error status + data-app-error + error panel + parent onError forward + clear-on-close.
  • Per-file coverage ≥90 on all four dimensions; full npm run ci passes locally.

Stacking

Final PR in the Wave 2 Apps-host stack. Stacked on #1571 (v2/1571-stage-partial-input). Merge order: #1565#1566#1567#1568#1569#1570#1571 → this.

🤖 Generated with Claude Code

https://claude.ai/code/session_01BrihGWcrM9JGRyu41nzZYw

…pps screen

AppRenderer:
- New AppRendererStatus ("loading" | "ready" | "error") + onAppStatusChange
  callback. Fires "loading" at the start of every (re)build, "ready" on the
  view's initialized signal, and "error" on a factory throw/rejection.

AppsScreen:
- appStatus/appError state; handleAppError captures the reason locally and
  forwards to the parent onError. resetAppChannels clears both.
- Surfaces the contract as data-testid="apps-form" carrying data-app-status and
  data-app-error, renders an error panel (data-testid="apps-error") in place of
  the blank frame, and tags the stage button data-testid="apps-stage".
- AppDetailPanel's Open App button gains data-testid="open-app".

App.tsx:
- Wires the bridge factory's onResourceError to a red toast so a malformed/404
  UI resource is no longer console-only (the renderer separately drives
  data-app-status, so a driver times out on never-reaching-ready and reads it).

Documents the data-testid/data-* automation contract in clients/web/README.md.
Adds AppRenderer status-transition tests and AppsScreen status/error-panel
tests.

Closes #1572

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BrihGWcrM9JGRyu41nzZYw
@cliffhall cliffhall added the v2 Issues and PRs for v2 label Jul 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

v2 Issues and PRs for v2

Projects

None yet

Development

Successfully merging this pull request may close these issues.

web: app lifecycle status + machine-readable data attributes on the Apps screen

1 participant