Skip to content

Feat/credit summary - #33

Merged
aguilar1x merged 2 commits into
ACTA-Team:developfrom
Villarley:feat/credit-summary
Jun 29, 2026
Merged

aguilar1x merged 2 commits into
ACTA-Team:developfrom
Villarley:feat/credit-summary

Conversation

@Villarley

@Villarley Villarley commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

🚀 ACTA Pull Request

Mark with an x all the checkboxes that apply (like [x])

⚠️ Required: Fill in the issue number below. This is how
platforms tracks your contribution and releases your reward.

Closes #19

  • Added tests (if necessary)
  • Run tests
  • Run formatting
  • Evidence attached
  • Commented the code

📌 Type of Change

  • Documentation (updates to README, docs, or comments)
  • Bug fix (non-breaking change which fixes an issue)
  • [x ] Enhancement (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

📝 Changes Description


📸 Evidence

https://cap.so/s/frn896150c4nb7e

🌌 Comments


Thank you for contributing to ACTA! We hope you can continue contributing to this project.

Summary by CodeRabbit

  • New Features

    • Added a credit profile summary view showing total, valid, and revoked credential counts.
    • Added category breakdowns and a simple timeline for older credentials.
    • Introduced a reusable summary card with a clear disclaimer and localized labels.
  • Bug Fixes

    • Improved the empty-state rendering flow for loaded credentials without changing what users see.

Shared, i18n-agnostic credit profile summary card: counter stats,
per-category breakdown, and a simple history timeline. All copy is
passed via props; callers must supply an explicit disclaimer that this
is an informational overview, not a credit score or risk assessment.
Compute an aggregate CreditProfileSummary (totals per category,
valid/revoked/invalid counts, and oldest-credential history age) from
the loaded credential list and render it via the shared
ProfileSummaryCard above the list. Adds en/es i18n copy, including an
explicit disclaimer that this is an informational overview and not a
credit score or risk assessment.
@vercel

vercel Bot commented Jun 26, 2026

Copy link
Copy Markdown

@Villarley is attempting to deploy a commit to the ACTA Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai

coderabbitai Bot commented Jun 26, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The credit-history app now computes a profile summary from loaded credentials, renders a shared summary card with totals, category counts, and a timeline, and adds English and Spanish copy for the new summary section.

Changes

Credit profile summary

Layer / File(s) Summary
Profile summary computation
apps/credit-history/src/lib/profile-summary.ts
Computes per-category totals, valid/revoked/invalid counts, and the oldest issue date from credential data.
Shared summary card
packages/ui/src/components/profile-summary-card.tsx, packages/ui/src/index.ts
Defines the reusable summary card props and renders the disclaimer, stats grid, category rows, and optional timeline, then re-exports the component and its types.
Credentials view wiring and labels
apps/credit-history/src/components/credentials/credentials-view.tsx, apps/credit-history/src/i18n/messages/*.json
Computes the summary when credentials are ready, formats the oldest date for the timeline, and adds English/Spanish summary labels and captions.

Sequence Diagram(s)

sequenceDiagram
  participant CredentialsView
  participant computeProfileSummary
  participant useFormatter
  participant ProfileSummaryCard

  CredentialsView->>computeProfileSummary: derive totals, status counts, and oldestIssuedAt
  CredentialsView->>useFormatter: create dateTime formatter
  CredentialsView->>ProfileSummaryCard: pass stats, category counts, and timeline labels
  ProfileSummaryCard->>Card: render disclaimer, stats grid, categories, and timeline
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • ACTA-Team/products-acta#22: Introduced the credential domain types that the new profile summary aggregation and UI consume.
  • ACTA-Team/products-acta#29: Modified credentials-view.tsx’s ready-state rendering that this PR extends with the summary card.
  • ACTA-Team/products-acta#31: Touched the same disconnected-vs-connected branching in credentials-view.tsx that is reformatted alongside the new summary block.

Suggested reviewers

  • aguilar1x

Poem

I hopped through counts both neat and true,
With labels bright in red and blue. 🐇
A summary card now blooms in view,
With timeline dates and stats anew,
And carrots for the code review.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title is related to the change, but it's too generic to describe the feature clearly. Use a more specific title like "Add credit profile summary to credit history view".
✅ Passed checks (3 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The PR appears to implement the requested aggregate summary with category totals, credential counts, history age, disclaimer, and i18n.
Out of Scope Changes check ✅ Passed The changes stay within the credit summary feature and its shared UI/i18n support.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@apps/credit-history/src/components/credentials/credentials-view.tsx`:
- Around line 163-176: The stats rendered in credentials-view.tsx are missing
the invalid credential count, even though summary.counts.invalid is already
available. Update the stats array in the relevant summary section to include an
invalid entry alongside total, valid, and revoked, and wire it to a new
summary.stats.invalid translation key so the UI matches the acceptance criteria
and does not fold invalid credentials into the total.

In `@packages/ui/src/components/profile-summary-card.tsx`:
- Line 108: Update the timeline bar styling in profile-summary-card so the
Tailwind gradient utility uses the v4-compatible direction class instead of the
deprecated bg-gradient-to-r. Locate the className on the div in the profile
summary card component and replace the legacy gradient utility with the
corresponding bg-linear-to-r class while keeping the rest of the gradient colors
unchanged.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: fc3d3630-f404-4e17-a458-4b8ea582aa47

📥 Commits

Reviewing files that changed from the base of the PR and between 119630b and f2292d5.

📒 Files selected for processing (6)
  • apps/credit-history/src/components/credentials/credentials-view.tsx
  • apps/credit-history/src/i18n/messages/en.json
  • apps/credit-history/src/i18n/messages/es.json
  • apps/credit-history/src/lib/profile-summary.ts
  • packages/ui/src/components/profile-summary-card.tsx
  • packages/ui/src/index.ts

Comment on lines +163 to +176
stats={[
{ label: t('summary.stats.total'), value: String(state.credentials.length) },
{ label: t('summary.stats.valid'), value: String(summary.counts.valid) },
{ label: t('summary.stats.revoked'), value: String(summary.counts.revoked) },
{
label: t('summary.stats.historySince'),
value: summary.oldestIssuedAt
? format.dateTime(new Date(summary.oldestIssuedAt), {
year: 'numeric',
month: 'short',
})
: '—',
},
]}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Surface the invalid count to match the acceptance criteria.

The linked issue requires showing counts for valid vs revoked vs invalid credentials. summary.counts.invalid is computed but never rendered — the stats only expose total/valid/revoked, so invalid credentials are silently folded into the total. Consider adding an invalid stat.

🔧 Proposed addition (requires a `summary.stats.invalid` i18n key)
                   { label: t('summary.stats.valid'), value: String(summary.counts.valid) },
                   { label: t('summary.stats.revoked'), value: String(summary.counts.revoked) },
+                  { label: t('summary.stats.invalid'), value: String(summary.counts.invalid) },
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
stats={[
{ label: t('summary.stats.total'), value: String(state.credentials.length) },
{ label: t('summary.stats.valid'), value: String(summary.counts.valid) },
{ label: t('summary.stats.revoked'), value: String(summary.counts.revoked) },
{
label: t('summary.stats.historySince'),
value: summary.oldestIssuedAt
? format.dateTime(new Date(summary.oldestIssuedAt), {
year: 'numeric',
month: 'short',
})
: '—',
},
]}
stats={[
{ label: t('summary.stats.total'), value: String(state.credentials.length) },
{ label: t('summary.stats.valid'), value: String(summary.counts.valid) },
{ label: t('summary.stats.revoked'), value: String(summary.counts.revoked) },
{ label: t('summary.stats.invalid'), value: String(summary.counts.invalid) },
{
label: t('summary.stats.historySince'),
value: summary.oldestIssuedAt
? format.dateTime(new Date(summary.oldestIssuedAt), {
year: 'numeric',
month: 'short',
})
: '—',
},
]}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/credit-history/src/components/credentials/credentials-view.tsx` around
lines 163 - 176, The stats rendered in credentials-view.tsx are missing the
invalid credential count, even though summary.counts.invalid is already
available. Update the stats array in the relevant summary section to include an
invalid entry alongside total, valid, and revoked, and wire it to a new
summary.stats.invalid translation key so the UI matches the acceptance criteria
and does not fold invalid credentials into the total.

<span>{timeline.endLabel}</span>
</div>
<div className="relative">
<div className="h-0.5 w-full rounded-full bg-gradient-to-r from-primary/40 to-primary" />

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor

🧩 Analysis chain

🌐 Web query:

Was bg-gradient-to-r renamed to bg-linear-to-r in Tailwind CSS v4, and does bg-gradient-to-r still work in v4.0?

💡 Result:

In Tailwind CSS v4.0, the bg-gradient-to-* utility classes were renamed to bg-linear-to-* [1][2][3]. As a result, bg-gradient-to-r does not work in Tailwind CSS v4.0 and must be replaced with bg-linear-to-r [2][3]. The official Tailwind CSS upgrade tool is designed to automatically detect and migrate these class names in your codebase when you upgrade from v3 to v4 [1][2][4]. This change was made to better align Tailwind’s class naming convention with standard CSS functions (linear-gradient(), radial-gradient(), and conic-gradient()) and to accommodate an expanded set of gradient features in v4.0, including new radial and conic gradient utilities [2][3][5]. While the base utility names changed, the color stop utilities (from-*, via-*, and to-*) remain unchanged and function exactly as they did in v3 [2][3].

Citations:


Replace deprecated bg-gradient-to-r with bg-linear-to-r for Tailwind CSS v4

Tailwind CSS v4 renamed gradient direction utilities from bg-gradient-to-* to bg-linear-to-* to align with standard CSS convention. The legacy bg-gradient-to-r class will not generate any CSS in v4, causing this timeline bar to render without a gradient background.

♻️ Proposed change
-              <div className="h-0.5 w-full rounded-full bg-gradient-to-r from-primary/40 to-primary" />
+              <div className="h-0.5 w-full rounded-full bg-linear-to-r from-primary/40 to-primary" />
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<div className="h-0.5 w-full rounded-full bg-gradient-to-r from-primary/40 to-primary" />
<div className="h-0.5 w-full rounded-full bg-linear-to-r from-primary/40 to-primary" />
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/ui/src/components/profile-summary-card.tsx` at line 108, Update the
timeline bar styling in profile-summary-card so the Tailwind gradient utility
uses the v4-compatible direction class instead of the deprecated
bg-gradient-to-r. Locate the className on the div in the profile summary card
component and replace the legacy gradient utility with the corresponding
bg-linear-to-r class while keeping the rest of the gradient colors unchanged.

@aguilar1x aguilar1x left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@aguilar1x
aguilar1x merged commit 1b30c83 into ACTA-Team:develop Jun 29, 2026
3 of 4 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.

Credit profile summary (aggregate view)

2 participants