Skip to content

feat(projects): PR-PT-4 Approach stage SuspectedCause hierarchy#175

Merged
jukka-matti merged 5 commits into
mainfrom
projects-tab-pt4
May 14, 2026
Merged

feat(projects): PR-PT-4 Approach stage SuspectedCause hierarchy#175
jukka-matti merged 5 commits into
mainfrom
projects-tab-pt4

Conversation

@jukka-matti
Copy link
Copy Markdown
Owner

Summary

Plan 1 PR-PT-4 of 5 — Approach stage of the IP detail page per spec D9 + §3.2.

Built in @variscout/ui:

  • projectCauses() pure function — per-SuspectedCause hierarchy projection (factorControl → Hypothesis → Idea → Action) with 9 tests
  • ApproachCauseCard primitive — per-cause card with status pill (PENDING / IN PROGRESS / RESOLVED / RULED OUT), selected idea, action progress, "Open in Improve workbench" CTA
  • ApproachOverview — KPI strip (Goal/Survey/Milestone) + per-cause cards + ruled-out collapse + jump-outs (Wall / Analyze / Process)
  • ApproachSections — same per-cause cards in workbench layout with "+ Add another suspected cause"
  • IPDetailPage extended: Approach stage now conditionally renders Overview/Sections; barrel re-exports CauseRow/CauseStatus/CauseProjectionInputs/projectCauses

Wired in apps:

  • PWA + Azure ProjectsTabView accepts approachInputs + onOpenCauseWorkbench props, forwards to IPDetailPage
  • PWA App.tsx: sources hypotheses from useInvestigationStore; flattens ideas from Question.ideas[] and actions from Finding.actions[]. onOpenCauseWorkbenchpanels.showImprovement() (legacy PDCA workbench; Plan 2 adds IP-context scoping)
  • Azure Editor.tsx mirror via usePanelsStore.getState()

Type discoveries (informed the implementation):

  • ImprovementIdea.text (not name); ActionItem.ideaId (not linkedIdeaId); ActionItemStatus = 'open' | 'in-progress' | 'done' (not pending)
  • ImprovementIdea.linkedHypothesisId does not exist on the type — projection iterates a flat ideas slice and picks the selected: true one. Tight per-cause linking would need a schema follow-up (logged for Plan 2).
  • Fixed transitive: @variscout/core/findings/types@variscout/core/findings (correct sub-path)

Test plan

  • pnpm --filter @variscout/ui test — IPDetail 31/31 across 8 files
  • pnpm --filter @variscout/pwa test — 344 passed
  • pnpm --filter @variscout/azure-app test — 1307 passed (pre-existing IndexedDB rejections unrelated)
  • pnpm --filter @variscout/pwa tsc --noEmit — clean
  • pnpm --filter @variscout/azure-app tsc --noEmit — clean
  • Manual chrome walk deferred until PR-PT-5

Spec coverage (Plan 1 / PR-PT-4)

  • ✅ D9 SuspectedCause-anchored Approach (per-cause hierarchy as visual unit)
  • ✅ §3.2 Approach Overview (KPI strip + per-cause cards + jump-outs)
  • ✅ §3.2 Approach Sections (workbench layout + "Open in Improve workbench" jump-out)
  • ✅ Lifecycle-aware collapse (ruled-out causes collapsed below "Show ruled out · N")
  • ⚠️ Idea→Hypothesis linkage missing from ImprovementIdea type (V1 acceptable; logged for Plan 2)

jukka-matti and others added 5 commits May 15, 2026 01:15
Pure projectCauses() function maps each ImprovementProjectFactorControl to
a CauseRow with resolved hypothesis, selected idea, linked actions (via
ActionItem.ideaId), and derived causeStatus (pending-idea / in-progress /
resolved / ruled-out). 9 tests covering all status branches.

Co-Authored-By: ruflo <ruv@ruv.net>
ApproachOverview (progress banner + goal/survey/milestone KPIs + cause cards + ruled-out collapse + Continue-in jump-outs) and ApproachSections (workbench layout) wired into IPDetailPage. Barrel re-exports CauseRow/CauseStatus/CauseProjectionInputs/projectCauses for app-level consumers.

Co-Authored-By: ruflo <ruv@ruv.net>
…ngs stores

Sources hypotheses from useInvestigationStore, ideas from questions[].ideas[],
and actions from findings[].actions[] in both PWA and Azure. Passes
approachInputs + onOpenCauseWorkbench through ProjectsTabView → IPDetailPage.
V1 workbench handler jumps to Improve tab; IP-context scoping deferred to Plan 2.

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

vercel Bot commented May 14, 2026

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

Project Deployment Actions Updated (UTC)
mean-beoynd-lite-pwa Building Building Preview, Comment May 14, 2026 10:30pm
variscout_website Building Building Preview, Comment May 14, 2026 10:30pm

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