Skip to content

refactor(ui): move ProcessHubCurrentStatePanel to @variscout/ui#97

Merged
jukka-matti merged 1 commit into
mainfrom
phase-2/pr-2-pwa-current-state-panel
Apr 27, 2026
Merged

refactor(ui): move ProcessHubCurrentStatePanel to @variscout/ui#97
jukka-matti merged 1 commit into
mainfrom
phase-2/pr-2-pwa-current-state-panel

Conversation

@jukka-matti
Copy link
Copy Markdown
Owner

Summary

  • Phase 2 PR chore(deps): bump actions/upload-artifact from 4.6.2 to 7.0.0 #2: lifts ProcessHubCurrentStatePanel from apps/azure/src/components/ into packages/ui/src/components/ProcessHubCurrentStatePanel/ so Phase 2's snapshot-mode work in LayeredProcessView can compose with it from a shared home.
  • Pure refactor — no behavior change. The component is fully props-based: state: CurrentProcessState in, JSX out. Zero Azure-specific dependencies (no Blob Storage, no EasyAuth, no app stores).
  • Two formatter helpers previously imported from Azure's ProcessHubFormat (formatMetric, formatChangeSignals) are inlined, calling the canonical formatStatistic + formatPlural from @variscout/core/i18n.
  • 8 new unit tests covering severity badge, lens count cards, empty state, +N indicator, Cpk-vs-target detail, change-signal pluralization, detail fallback, and response-path label.

Why

PR #95 (V1) shipped ProcessHubCurrentStatePanel in the Azure app only. Phase 2 PR #3 adds snapshot-mode rendering to LayeredProcessView (which lives in @variscout/ui); to keep the panel and the snapshot-mode bands sharing types and helpers cleanly, the panel needs to live in the same package.

PWA does not receive this panel. Process Hub is an Azure-only product surface — it's a multi-investigation aggregation feature requiring persistence (ADR-072), and PWA is session-only by ADR-012. The "PWA parity" question was confirmed during planning: the panel moves for code-sharing hygiene only, not for PWA wiring.

Plan reference: ~/.claude/plans/lets-create-a-plan-proud-island.md (PR #2 section).

Changes

  • packages/ui/src/components/ProcessHubCurrentStatePanel/ProcessHubCurrentStatePanel.tsx (new): the moved panel with inlined formatters.
  • packages/ui/src/components/ProcessHubCurrentStatePanel/index.ts (new): barrel + type export.
  • packages/ui/src/components/ProcessHubCurrentStatePanel/__tests__/ProcessHubCurrentStatePanel.test.tsx (new): 8 tests.
  • packages/ui/src/index.ts: export ProcessHubCurrentStatePanel + ProcessHubCurrentStatePanelProps next to LayeredProcessView.
  • apps/azure/src/components/ProcessHubReviewPanel.tsx: import from @variscout/ui, drop the local default-import.
  • apps/azure/src/components/ProcessHubCurrentStatePanel.tsx: deleted.

Verification

  • pnpm --filter @variscout/ui exec vitest run src/components/ProcessHubCurrentStatePanel — 8/8 pass.
  • pnpm --filter @variscout/ui build — clean tsc + vite build (no cross-package type gaps).
  • pnpm --filter @variscout/azure-app exec vitest run — 64 files / 924 tests pass (Azure consumer untouched in behavior).
  • bash scripts/pr-ready-check.sh — all checks green.

Test plan

  • Heading and overall severity badge render with the expected severity label.
  • All 5 lens count cards render with the right counts.
  • Empty placeholder renders when items is empty.
  • Items cap at 6 with "+N more" indicator for the rest.
  • Cpk-vs-target detail formats correctly when both metric values are set.
  • Change-signal count uses singular vs plural correctly.
  • Falls back to item.detail when no metric formatter applies.
  • Response-path labels render per item.

Out of scope

  • Hardcoded English strings (LENS_LABELS, RESPONSE_LABELS, SEVERITY_LABELS, "Current Process State", placeholder copy). Existing Azure behavior preserved verbatim; i18n catalog work is a separate concern (ADR-025).
  • PWA wiring (PWA has no Process Hub feature — Azure-only product surface).

🤖 Generated with Claude Code

Lift the Azure-only ProcessHubCurrentStatePanel into @variscout/ui
so Phase 2 snapshot-mode work in LayeredProcessView can compose with
it from a shared home. Component is fully props-based — takes
CurrentProcessState in, renders JSX out — no Azure-specific deps
(Blob Storage, EasyAuth, app stores).

The two formatter dependencies (formatMetric, formatChangeSignals)
that previously lived in Azure's ProcessHubFormat helper are inlined
here using the canonical formatStatistic + formatPlural from
@variscout/core/i18n.

Adds 8 unit tests covering: heading + severity badge, lens count
cards, empty state, +N indicator at >6 items, Cpk-vs-target detail,
change-signal pluralization, detail fallback, response-path label.

PWA does not get this panel — Process Hub is an Azure-only feature
(multi-investigation aggregation requiring persistence per ADR-072);
PWA is session-only by ADR-012. Confirmed during planning.

Phase 2 PR #2 of N.

Co-Authored-By: ruflo <ruv@ruv.net>
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 27, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
mean-beoynd-lite-pwa Ready Ready Preview, Comment Apr 27, 2026 5:19pm
variscout_website Building Building Preview, Comment Apr 27, 2026 5:19pm

@jukka-matti jukka-matti merged commit e967499 into main Apr 27, 2026
2 of 3 checks passed
@jukka-matti jukka-matti deleted the phase-2/pr-2-pwa-current-state-panel branch April 27, 2026 17:20
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.

1 participant