Skip to content

Surface entity lifecycle status control (apps + components)#87

Open
bburda wants to merge 11 commits into
mainfrom
feat/entity-lifecycle-status
Open

Surface entity lifecycle status control (apps + components)#87
bburda wants to merge 11 commits into
mainfrom
feat/entity-lifecycle-status

Conversation

@bburda

@bburda bburda commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Summary

Add an EntityStatusControl to the Apps and Components entity detail, consuming the gateway 0.6.0 lifecycle status API. It shows the live readiness status (ready / notReady) and offers the transition actions (start / restart / force-restart / shutdown / force-shutdown) via the typed client. The 501 "no lifecycle provider configured" case is surfaced as a disabled not-available state. Lifecycle status exists only for apps and components (not areas/functions).


Issue


Type

  • Bug fix
  • New feature
  • Breaking change
  • Documentation only

Testing

In a worktree branched from origin/main (post-0.6.0-migration):

  • npm run lint (eslint) - clean
  • npm run typecheck (tsc --noEmit) - clean
  • npm test -- --run (vitest) - 421 passed (18 files, incl. 7 new EntityStatusControl tests)
  • npm run build - succeeds

Checklist

  • Breaking changes are clearly described (none - additive feature)
  • Linting passes (npm run lint)
  • Build succeeds (npm run build)
  • Docs were updated if behavior or public API changed (README feature list)

Add EntityStatusControl consuming the gateway 0.6.0 lifecycle API
(GET/PUT /{apps,components}/{id}/status). Renders current readiness as
a badge and exposes the five lifecycle transitions (start, restart,
force-restart, shutdown, force-shutdown) as action buttons. A 501 from
the gateway (no lifecycle provider configured) is surfaced as a disabled
"not available" state instead of an error.

Add getStatus/setStatus dispatch helpers in api-dispatch.ts (narrowed to
the apps/components entity types that expose the lifecycle collection)
plus LifecycleAction/LifecycleStatus types. Mount the control on the app
header (AppsPanel) and the component header (EntityDetailPanel).
Copilot AI review requested due to automatic review settings June 25, 2026 08:13

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new UI control to surface gateway 0.6.0 lifecycle status/transition actions for apps and components, wiring it into the existing entity detail views via the typed OpenAPI client dispatch layer.

Changes:

  • Added lifecycle status/action type definitions and API dispatch helpers (getStatus / setStatus) for apps/components.
  • Introduced EntityStatusControl UI component + Vitest coverage for status rendering and action handling (incl. 501 “not available”).
  • Integrated the control into Apps and Component detail UIs and documented the feature in the README.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
src/lib/types.ts Adds lifecycle action/status union types for gateway 0.6.0 lifecycle API.
src/lib/api-dispatch.ts Adds app/component-only lifecycle status GET and transition PUT dispatch helpers.
src/components/EntityStatusControl.tsx New UI control showing readiness badge + lifecycle transition buttons with 501 handling.
src/components/EntityStatusControl.test.tsx New tests validating rendering, action calls, refresh behavior, and 501 handling.
src/components/EntityDetailPanel.tsx Renders lifecycle control for components in the detail header.
src/components/AppsPanel.tsx Renders lifecycle control for apps in the app header area.
README.md Documents the new lifecycle status control feature.

Comment thread src/components/EntityStatusControl.tsx Outdated
Comment on lines +65 to +69
const [currentStatus, setCurrentStatus] = useState<LifecycleStatus | null>(toLifecycleStatus(status));
const [pendingAction, setPendingAction] = useState<LifecycleAction | null>(null);
const [notAvailable, setNotAvailable] = useState(false);
const [error, setError] = useState<string | null>(null);

Comment on lines +141 to +144
{/* Lifecycle status control (gateway 0.6.0 lifecycle API) */}
<div className="mt-4">
<EntityStatusControl entityType="apps" entityId={appId} />
</div>
Comment thread src/lib/types.ts
Comment on lines +81 to +85
/**
* Lifecycle readiness value reported by GET /{entity}/{id}/status and carried
* on AppDetail/ComponentDetail.
*/
export type LifecycleStatus = 'ready' | 'notReady';
Comment thread src/components/EntityStatusControl.tsx Outdated
Comment on lines +76 to +83
if (result.response.status === 501) {
setNotAvailable(true);
return;
}
if (result.data && typeof result.data.status === 'string') {
const next = toLifecycleStatus(result.data.status);
if (next) setCurrentStatus(next);
}
{/* Lifecycle status control (gateway 0.6.0 lifecycle API) */}
{isComponent && (
<div className="mt-4">
<EntityStatusControl entityType="components" entityId={entityId} />
@bburda bburda force-pushed the feat/entity-lifecycle-status branch from 2f5f6eb to 35c2b5d Compare June 25, 2026 12:19
…tus prop

The EntityStatusControl reads readiness from the shared store keyed by
entity, so the declared status prop was dead. Remove it and clarify the
status doc comment to reference the GET /apps/{id} and GET /components/{id}
responses. Also clear the local error on entity change so a failed
transition on one entity cannot linger after the selection switches.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Surface entity lifecycle status control (apps + components)

2 participants