Skip to content

feat(frontend): surface most recently analysed repository on the dashboard - #296

Closed
parthrohit22 wants to merge 1 commit into
Second-Origin:devfrom
parthrohit22:feat/dashboard-latest-analysis-summary
Closed

feat(frontend): surface most recently analysed repository on the dashboard#296
parthrohit22 wants to merge 1 commit into
Second-Origin:devfrom
parthrohit22:feat/dashboard-latest-analysis-summary

Conversation

@parthrohit22

Copy link
Copy Markdown
Collaborator

Summary

Adds a single summary line to the Dashboard, above the metric cards, surfacing which repository's analysis is most current and at what revision — sourced only from data this page already fetches (GET /repositories), with no new endpoint and no fabricated metric.

Linked issue

Closes #295

Roadmap alignment

  • Roadmap §23 workstream this advances: W4 / Workflows — turn graph facts into outcomes.
  • §28 market-fit criterion this moves toward: Repeat use — a returning user can see at a glance whether their last analysis is current without opening a repository.
  • Accepted evidence it is real: component tests asserting the line renders/omits correctly against real field shapes, plus a live browser screenshot against a genuinely completed analysis (below).

What changed

  • apps/frontend/src/app/pages/DashboardPage.tsx: derives mostRecentlyAnalysed via useMemo from repositories (already fetched by useRepositoryDashboard), filtering status === 'completed' with a non-null analysedAt, reducing to the latest. Renders one line: Most recently analysed: {name} — {date} at revision {short revision}. A shortRevisionLabel helper formats the existing Repository.revision field (git → 7-char SHA; upload → short content hash with the sha256: prefix stripped) — both values already present on the repository record (chore: persist commit SHA and content identity for every repository import #87 revision identity), nothing invented.
  • apps/frontend/src/app/pages/DashboardPage.test.tsx (new): 4 tests covering the happy path (latest of several picked correctly, by analysedAt), upload-revision formatting, omission when nothing is analysed yet, and the existing empty-state path when there are no repositories at all.

Acceptance criteria completed

From #295, all complete:

  • Line renders only when at least one repository has a completed analysis.
  • Shows real analysedAt and real revision identity already on the repository record.
  • No new backend endpoint or contract change.
  • Frontend tests, lint, and build pass.

Testing performed

npm --prefix apps/frontend run test
  Test Files  42 passed (42)
  Tests       226 passed (226)

npm run lint:frontend
  eslint . — no errors

npm run build:frontend
  vite build — built in 513ms, no errors

Live verification: ran the real backend + frontend locally, logged into an
account with six genuinely completed analyses (via the repo's own
`npm run fixtures:prototype` seed flow, which registers a user and drives
real upload -> analyse -> completed through the actual API), and confirmed
the Dashboard renders:
"Most recently analysed: disconnected-unresolved — 8/10/2026, 10:13:52 PM
at revision upload dc95c07"
matching the real GET /repositories response for that account.

Not run: npm run test:prototype (Playwright acceptance) — no backend/contract surface changed, and the live manual verification above already exercised the real authenticated app end to end.

Screenshots

Live screenshot captured during manual verification (see Testing performed) showing the rendered line against six real completed repositories on the Dashboard. Available on request — not yet attached to this PR (no CLI path to upload a binary image to a GitHub comment; happy to walk through attaching it).

Security and data considerations

None. No auth, owner-scoping, secrets, logging, or migration changes. Purely a derived read from data already returned to the authenticated, owner-scoped GET /repositories response.

Dependencies and blocked work

None.

Scope changes or remaining work

"Review findings by state" (from the original ask this issue was scoped from) is explicitly not included: it requires GET /analysis/{id}/review (engineering-review.v2), which this page does not fetch. Adding it would mean either a new fetch on a page that currently has none, or fabricating the count — both out of scope here. Flagged in #295's non-goals and left for a separate, explicitly-scoped follow-up if wanted.

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
  • This PR advances a §23 workstream toward a §28 market-fit criterion (Roadmap alignment filled)
  • Every acceptance criterion I claim as complete is actually complete
  • Relevant tests pass
  • Documentation is updated for any user-visible change (N/A — no docs reference dashboard content)
  • 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

…board

Adds a single summary line above the metric cards showing which
repository's analysis is most current and at what revision, derived
only from fields the repository list already fetches for this page
(status, analysedAt, revision) -- no new endpoint, no fabricated data.

A "review findings by state" fact was considered but not added: that
data lives behind GET /analysis/{id}/review (engineering-review.v2),
which this page does not fetch, and inventing it here would violate
the authentic-data-only rule rather than extend it.
parthrohit22 added a commit that referenced this pull request Aug 11, 2026
…40qz6

fix(frontend): land #294 + #296 with review fixes — AI Workspace retention copy, Settings landmark, revision labels
@parthrohit22

Copy link
Copy Markdown
Collaborator Author

closed as superseded

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.

feat(frontend): surface most recently analysed repository on the dashboard

1 participant