Skip to content

Render dashboard release health summary in UI#32

Merged
ProfRandom92 merged 1 commit into
mainfrom
codex/render-dashboard-release-health-summary
May 11, 2026
Merged

Render dashboard release health summary in UI#32
ProfRandom92 merged 1 commit into
mainfrom
codex/render-dashboard-release-health-summary

Conversation

@ProfRandom92

Copy link
Copy Markdown
Owner

Motivation

  • Surface the generated docs/reports/dashboard-health-summary.json in the existing dashboard UI so release-readiness information is visible without a live external service or Daimler data.
  • Provide a safe, small-footprint UI integration that tolerates missing artifacts and uses synthetic fallback data when the summary cannot be loaded.

Description

  • Added typed release-health domain types in dashboard/app/src/types/domain.ts and introduced a release health normalization/fetch helper at dashboard/app/src/lib/releaseHealth.ts that returns a ReleaseHealthState with a robust fallback.
  • Added a synthetic fallback summary at dashboard/app/src/mocks/releaseHealthSummary.ts and exposed the fetch via the client API as api.releaseHealth in dashboard/app/src/lib/api.ts.
  • Rendered a new ReleaseHealthSummaryCard inside the overview page at dashboard/app/src/features/overview/OverviewPage.tsx that displays overall_status, contract/API/project check badges, missing_artifacts, next_recommended_actions, and safety_notes using existing badge styles and responsive layout.
  • Made the generator artifact available to the frontend by copying docs/reports/ into the Vite public bundle via dashboard/app/vite.config.ts and added a stdlib backend route for /dashboard-health-summary.json in dashboard/industrial_dashboard.py.
  • Added minimal styles in dashboard/app/src/styles/app.css and updated docs/API_SURFACE.md to document the new route and UI behavior.

Testing

  • Ran TypeScript checks and build: npm run typecheck and npm run build (both succeeded).
  • Ran repository validation and report generators: python scripts/run_checks.py && python scripts/validate_contracts.py && python scripts/generate_contract_fixtures.py && python scripts/validate_api_exports.py && python scripts/generate_dashboard_health_summary.py (succeeded and wrote docs/reports/dashboard-health-summary.json).
  • Validated stdlib backend route and payload: python -m py_compile dashboard/industrial_dashboard.py (compile ok) and a runtime fetch of http://127.0.0.1:8765/dashboard-health-summary.json returned expected keys (verified overall_status and checks values).

Closes #31.


Codex Task

@ProfRandom92 ProfRandom92 merged commit 98ac7e3 into main May 11, 2026
1 of 2 checks passed

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a release health summary feature to the dashboard, providing visibility into release-readiness artifacts, validation checks, and recommended actions. Changes include the new ReleaseHealthSummaryCard component, API integration for fetching health data, and backend support for serving the summary JSON. A review comment identifies a UI issue where an 'unavailable' warning flashes during the loading state and recommends adding a guard clause to handle undefined state and removing a redundant check.

Comment on lines +35 to +55
function ReleaseHealthSummaryCard({ state }: { state?: ReleaseHealthState }) {
const summary = state?.summary;
const missingRequired = summary?.missing_artifacts?.required_local ?? [];
const missingOptional = summary?.missing_artifacts?.optional_cross_repo ?? [];
const missingArtifacts = [...missingRequired, ...missingOptional];
const contractStatus = checkStatus(summary?.checks?.contract_validation_report);
const apiStatus = checkStatus(summary?.checks?.api_export_validation_report);
const projectStatus = checkStatus(summary?.checks?.project_health_report);
const overall = summary?.overall_status ?? 'unknown';

return (
<article className="card release-health-card">
<div className="card-header">
<div>
<h3>Release health summary</h3>
<p>Static release-readiness artifact for sanitized dashboard review.</p>
</div>
<span className={`badge ${healthTone(overall)}`}>{statusLabel(overall)}</span>
</div>
{state?.unavailable ? <div className="notice warning"><FileWarning size={16} /><span>{state.message ?? `Health summary unavailable. Expected ${RELEASE_HEALTH_SUMMARY_PATH}.`}</span></div> : null}
{!summary ? <div className="notice warning"><FileWarning size={16} /><span>Health summary unavailable. Expected {RELEASE_HEALTH_SUMMARY_PATH}.</span></div> : null}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

The ReleaseHealthSummaryCard component currently displays a 'Health summary unavailable' warning while the data is still being fetched. This occurs because state is undefined during the loading phase, causing summary to be undefined and triggering the condition on line 55.

Furthermore, line 55 is redundant because the fetchReleaseHealthSummary helper is designed to always return a valid ReleaseHealthState object (using a fallback summary on error), so summary will only be falsy when the query is still loading.

I recommend adding a guard clause to return null if state is undefined to prevent the loading flash, and removing the redundant check on line 55.

function ReleaseHealthSummaryCard({ state }: { state?: ReleaseHealthState }) {
  if (!state) return null;
  const summary = state.summary;
  const missingRequired = summary?.missing_artifacts?.required_local ?? [];
  const missingOptional = summary?.missing_artifacts?.optional_cross_repo ?? [];
  const missingArtifacts = [...missingRequired, ...missingOptional];
  const contractStatus = checkStatus(summary?.checks?.contract_validation_report);
  const apiStatus = checkStatus(summary?.checks?.api_export_validation_report);
  const projectStatus = checkStatus(summary?.checks?.project_health_report);
  const overall = summary?.overall_status ?? 'unknown';

  return (
    <article className="card release-health-card">
      <div className="card-header">
        <div>
          <h3>Release health summary</h3>
          <p>Static release-readiness artifact for sanitized dashboard review.</p>
        </div>
        <span className={`badge ${healthTone(overall)}`}>{statusLabel(overall)}</span>
      </div>
      {state.unavailable ? <div className="notice warning"><FileWarning size={16} /><span>{state.message ?? `Health summary unavailable. Expected ${RELEASE_HEALTH_SUMMARY_PATH}.`}</span></div> : null}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Render dashboard release health summary in UI

1 participant