Skip to content

fix(dashboard): roll home overview stats into Guard stats card#687

Closed
kantorcodes wants to merge 2 commits into
mainfrom
fix/home-stats-card-rollup
Closed

fix(dashboard): roll home overview stats into Guard stats card#687
kantorcodes wants to merge 2 commits into
mainfrom
fix/home-stats-card-rollup

Conversation

@kantorcodes
Copy link
Copy Markdown
Member

Summary

  • Move Pending, Apps, and History into the Your Guard stats card on Home.
  • Remove the standalone proof strip so the homepage reads as one calm summary block.

Testing

  • cd dashboard && node node_modules/tsx/dist/cli.mjs src/evidence/evidence-insights-home-preview.test.ts
  • cd dashboard && npm run build

Move Pending, Apps, and History out of the floating proof strip and into
the Your Guard stats card so the homepage reads as one calm summary block.

Signed-off-by: Michael Kantor <6068672+kantorcodes@users.noreply.github.com>
@gemini-code-assist
Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@chatgpt-codex-connector
Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented Jun 7, 2026

Greptile Summary

This PR consolidates the home page overview stats (Pending, Apps, History) and the Guard analytics card into a single EvidenceInsightsHomePreview component, replacing the now-removed ProofStrip. The EvidenceInsightsHomePreview interface is broadened to accept nullable analytics and a new overview prop, so the card renders unconditionally instead of returning null when no analytics history exists.

  • EvidenceInsightsHomePreview now always renders the stats section and conditionally renders the bento and "See all insights" link only when analytics are loaded and non-empty; TypeScript narrowing is done inline (analytics !== null && analytics.total > 0) rather than through an intermediate boolean, which resolves the narrowing issue noted in the prior review.
  • The test file validates the consolidation via source-text pattern matching, confirming ProofStrip is gone and overview={{ is present in home-dashboard.tsx.

Confidence Score: 5/5

Safe to merge — the change is a straightforward UI consolidation with no data-layer or auth modifications.

The refactoring is limited to the home dashboard view layer: overview stats are moved from a now-deleted ProofStrip into the existing card, the previously flagged TypeScript narrowing issue is resolved with inline guards, and the stats card now renders unconditionally so no data is hidden. No logic paths, API calls, or permissions are affected.

No files require special attention.

Important Files Changed

Filename Overview
dashboard/src/evidence/evidence-insights-home-preview.tsx Refactored to accept nullable analytics and a new overview prop; inline null/total guards replace the previous intermediate-boolean pattern, fixing the prior TypeScript narrowing concern.
dashboard/src/home-dashboard.tsx Removes ProofStrip and the conditional EvidenceInsightsHomePreview render; passes overview counts directly into the unified stats card. snapshot.receipt_count is used without the now-unnecessary ?? 0 fallback.
dashboard/src/evidence/evidence-insights-home-preview.test.ts New source-text-matching test asserting ProofStrip removal and that overview stats are wired into the card; straightforward and covers the structural intent of the PR.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    HW[HomeWorkspace] -->|overview, analytics, insightsLoading, runtime| EIHP[EvidenceInsightsHomePreview]
    EIHP --> Header["Header: Your Guard stats"]
    EIHP --> OVR[HomeGuardOverviewRow\nPending / Apps / History]
    EIHP --> insCheck{insightsLoading?}
    insCheck -->|yes| Skeleton[Skeleton placeholder]
    insCheck -->|no| analCheck{analytics ≠ null\n&& total > 0?}
    analCheck -->|yes| Bento[EvidenceInsightsHeadlineBento\nvariant=compact]
    analCheck -->|no| Hidden[nothing rendered]
    EIHP --> footCheck{analytics ≠ null\n&& total > 0\n&& onOpenInsights?}
    footCheck -->|yes| SeeAll[See all insights →]
    footCheck -->|no| NoFooter[nothing rendered]
Loading

Reviews (2): Last reviewed commit: "fix(dashboard): narrow analytics type fo..." | Re-trigger Greptile

Comment thread dashboard/src/evidence/evidence-insights-home-preview.tsx
Comment thread dashboard/src/home-dashboard.tsx Outdated
Signed-off-by: Michael Kantor <6068672+kantorcodes@users.noreply.github.com>
@kantorcodes
Copy link
Copy Markdown
Member Author

Closing: equivalent home stats rollup already landed on main (overviewStats in EvidenceInsightsHomePreview). Branch rebases with extensive static-asset conflicts and no net UX delta.

@kantorcodes kantorcodes closed this Jun 8, 2026
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