Skip to content

feat(frontend): lead the repository landing view with an outcome-first summary#199

Merged
parthrohit22 merged 1 commit into
Second-Origin:devfrom
parthrohit22:feat/176-outcome-first-home
Jul 26, 2026
Merged

feat(frontend): lead the repository landing view with an outcome-first summary#199
parthrohit22 merged 1 commit into
Second-Origin:devfrom
parthrohit22:feat/176-outcome-first-home

Conversation

@parthrohit22

Copy link
Copy Markdown
Collaborator

Summary

The product led with feature/provenance chrome instead of outcome: the repository primary view had no summary at all (just repo.meta stats), and Dependency Graph / Engineering Review both opened with a "Snapshot ID / Manifest Digest / Canonical Graph Hash" identity grid in mono caps before any actual content. Navigation gave all ~10 destinations equal visual weight. This adds a concise, evidence-backed landing summary and moves snapshot identity one click away, everywhere it was previously front-and-center.

Linked issue

Closes #176.

What changed

Frontend only.

  • New useRepositoryOutcomeSummary hook (features/repositories/hooks/): composes a landing summary purely from the existing Architecture, Review, Dependencies and Insights read APIs (backendService.fetchArchitecture/fetchReview/fetchDependencyGraph/fetchInsights) — no new backend endpoint, no LLM involvement, no client-side scoring. Each of the 5 sections (stack, structure, dependency count, headline finding, extractor/language coverage) is fetched independently and falls back to an explicit not_assessed state if that snapshot data isn't available, rather than ever showing a placeholder or fabricated number.
  • New RepositoryOutcomeSummary component (features/repositories/components/): renders that summary — stack (language/framework/pattern), structure (modules/components), dependency count, and a headline derived from Review's real findingsBySeverity counts (worst non-zero severity wins; an honest "No evidence-backed findings were surfaced" when all are zero, never a synthesized "all clear" score). A "Verify" button reveals the snapshot/manifest identity on demand.
  • RepositoryDetailPage.tsx: now leads with RepositoryOutcomeSummary, above the Overview/Explorer tabs, for any completed repository.
  • DependenciesPage.tsx / EngineeringReviewPage.tsx: the always-visible "Snapshot identity" / "Review identity" grid is gone. Both now reuse the existing RevisionManifestPanel (already used on Architecture, already collapsed-by-default with a "Details" toggle) instead of inventing a second provenance UI.
  • productSurfaces.tsx / Sidebar.tsx: added a navGroup: 'flagship' | 'secondary' field. Sidebar now renders Dashboard/Repositories/Upload/Architecture as the flagship group, and the rest (Dependency Graph, Engineering Review, Insights, Documentation, AI Workspace, Settings) under a lighter-weight "More" heading — smaller icon, regular instead of medium font weight. All ten destinations are still real links with the same hrefs; nothing is hidden, collapsed-behind-a-click, or removed.

Acceptance criteria completed

  • A repository's primary view leads with understanding + decisions, evidence-backed — RepositoryOutcomeSummary on RepositoryDetailPage.
  • Snapshot identity is reachable via a "Verify" control, not shown front-and-center by default — on the landing summary (new Verify toggle) and on Dependency Graph / Engineering Review (reused RevisionManifestPanel, collapsed by default).
  • Navigation distinguishes the flagship workflow from secondary surfaces — Sidebar "More" grouping; existing "Upcoming"/Preview labelling (AI Workspace) untouched.
  • Authentic-data rule preserved — every summary value traces to a real Architecture/Review/Dependencies/Insights API response; unavailable sections render Not assessed, never a placeholder.
  • Frontend tests for the landing layout and provenance toggle — see below.

Testing performed

npm --prefix apps/frontend run test
 Test Files  33 passed (33)
      Tests  176 passed (176)

npm run lint:frontend
 (clean, no output)

npm run build:frontend
 tsc -b && vite build — succeeded

New/changed test coverage:

  • useRepositoryOutcomeSummary.test.ts: composes real responses into the summary; picks the correct worst-severity headline; reports "No evidence-backed findings" honestly instead of a fabricated clean score; every section independently falls back to not_assessed (never a fabricated value) when its API 404s; does nothing while the repository hasn't completed analysis.
  • RepositoryOutcomeSummary.test.tsx: renders real facts from mocked backend responses (not fabricated); Verify reveals and re-hides the RevisionManifestPanel; renders Not assessed (never placeholder data) when every source 404s.
  • RepositoryDetailPage.test.tsx (new): the summary leads the completed-repository view, positioned before the tab bar; it does not render for a failed-analysis repository.
  • DependenciesPage.test.tsx / EngineeringReviewPage.test.tsx (new/updated): the snapshot identity grid is gone; the reused RevisionManifestPanel is collapsed by default (id/verification state visible, hashes hidden) and reveals hashes only after "Details" is clicked.
  • Sidebar.test.tsx: added a case asserting the flagship/secondary grouping, the "More" divider, that every secondary link is still a real reachable <a href> (reduced emphasis, not removal), and the font-weight difference between groups.

I could not exercise this in an actual browser in this environment (no backend running, no browser/screenshot tooling available) — verification is via the vitest suite above, which renders the real components against mocked API responses rather than mocking the summary/provenance logic away.

Screenshots

Not applicable — I have no browser/screenshot tooling in this environment. The new RepositoryOutcomeSummary reuses the app's existing card/tile visual language (same rounded-xl border border-border bg-card pattern as Stat/InfoCard elsewhere), and the "Verify" disclosure reuses the existing RevisionManifestPanel component, so no new visual design was introduced. Reviewer can verify with npm run dev against an analysed repository.

Security and data considerations

None. This is a read-only, client-side re-composition of data already served by existing, already-authorized endpoints (Architecture/Review/Dependencies/Insights) for the currently-viewed repository — no new backend surface, no new data access, no change to auth or owner-scoping. Provenance/hash data is still gated by the same "one click away" pattern already established by RevisionManifestPanel on Architecture; this PR only extends that pattern to two more pages instead of inventing a new one.

Dependencies and blocked work

None. (This was intentionally sequenced after PR #198 (#175/#179), since it touches RepositoryDetailPage.tsx / DependenciesPage.tsx / EngineeringReviewPage.tsx, which is now merged to dev.)

Scope changes or remaining work

None for the acceptance criteria above. Note: the flagship/secondary nav split is a judgment call (flagship = the upload → analyse → understand-structure loop: Dashboard, Repositories, Upload, Architecture) since the issue didn't specify an exact grouping — happy to adjust if a different split is preferred.

Contributor checklist

  • This PR targets dev
  • I claimed the issue and had it assigned or acknowledged before starting substantial work
  • The branch was created from an up-to-date upstream/dev
  • The branch is rebased on the latest upstream/dev
  • This PR addresses one clearly scoped issue
  • Every acceptance criterion I claim as complete is actually complete
  • Relevant tests pass
  • Documentation is updated for any user-visible change
  • No secrets, credentials, local env files, or generated artifacts are included
  • No unrelated files were changed
  • Closing syntax (Closes) is used only because the issue is fully resolved
  • Dependencies and follow-up work are linked

…t summary

The repository primary view, Dependency Graph, and Engineering Review all led
with feature/provenance chrome instead of the outcome a user actually needs:
~10 equally-weighted nav destinations, and Snapshot ID / Manifest Digest /
Canonical Graph Hash in large mono caps as the first thing on two pages.

Add RepositoryOutcomeSummary, a concise stack/structure/dependencies/headline
summary composed entirely from the existing Architecture, Review, Dependencies
and Insights read APIs (no LLM, no client-side scoring) with an explicit
"not assessed" state per section when its snapshot data isn't available. It
leads the repository detail page, ahead of the Overview/Explorer tabs.
Snapshot/manifest identity is reachable one click away via "Verify", which
reveals the existing RevisionManifestPanel -- the same collapsed-by-default
provenance panel Architecture already uses, now reused on Dependency Graph
and Engineering Review too instead of an always-visible identity grid.

Sidebar navigation now groups Dashboard/Repositories/Upload/Architecture as
the flagship workflow, with the remaining surfaces under a lighter-weight
"More" section -- all ten destinations stay fully reachable, just no longer
competing equally for attention.
@parthrohit22
parthrohit22 merged commit 79fc9f0 into Second-Origin:dev Jul 26, 2026
8 checks passed
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.

enhancement: make the flagship outcome the home experience; move snapshot hashes/provenance one click away

1 participant