fix(app): service card counts only added evidence tasks (matches detail)#3007
Merged
Conversation
The service card in a cloud integration's grid showed an evidence-task count = total mapped templates, while the service detail page now shows only tasks added to the org. That mismatch (card "2 evidence tasks" vs detail "1") confuses users. Thread the org's task templates through ProviderDetailView → ServicesGrid → ServiceCard and count only mapped tasks that have a live task in the org, so the card matches the detail. The count badge hides entirely when none are added (taskCount > 0 guard). Falls back to total mapped tasks when no templates are provided. Tests for ServiceCard cover added-only count, the fallback, and the hidden-count case. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
There was a problem hiding this comment.
1 issue found across 4 files
Confidence score: 3/5
- There is a concrete regression risk in
apps/app/src/app/(app)/[orgId]/integrations/[slug]/components/services-grid.tsx: when templates are missing, the empty default foraddedTemplateIdsblocks the fallback path and shows 0 tasks instead of mapped task totals. - Because this affects visible task counts (user-facing behavior) with high confidence, the merge risk is moderate even though severity is not high.
- Pay close attention to
apps/app/src/app/(app)/[orgId]/integrations/[slug]/components/services-grid.tsx- ensureaddedTemplateIdsstays undefined when templates are not provided so fallback counting still works.
Reply with feedback, questions, or to request a fix.
Fix all with cubic | Re-trigger cubic
Addresses the cubic review of #3007. The `taskTemplates = []` default made addedTemplateIds always a Set, so ServiceCard's fallback-to-total branch was dead code: a caller that omits taskTemplates got an empty Set → count 0 instead of the total mapped tasks. Drop the default and compute undefined when taskTemplates isn't provided so the fallback works; an explicit empty array still means "none added" (count 0), matching the detail page for an org with no live tasks. Add a ServicesGrid regression test (omitted → total, provided → added-only). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…t' into tofik/service-card-evidence-count
Contributor
Author
|
@cubic-dev-ai review it |
Contributor
@tofikwest I have started the AI code review. It will take a few minutes to complete. |
Contributor
|
🎉 This PR is included in version 3.68.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The service card in a cloud integration's grid shows an evidence-task count = total mapped templates, while the service detail page (PR #3006) shows only tasks added to the org. So a card can read "2 evidence tasks" while the detail shows "1" — a mismatch that confuses users.
Fix
Thread the org's task templates through
ProviderDetailView → ServicesGrid → ServiceCardand count only mapped tasks that have a live task in the org, so the card matches the detail.taskCount > 0guard).Tests
ServiceCard.test.tsx(3 tests): added-only count (1 evidence tasknot2), fallback to total whenaddedTemplateIdsabsent, and the hidden-count case when none are added. All pass.App typecheck: my files are clean (pre-existing
.test/auth-clienterrors onmainare unrelated, not in this diff).Related
🤖 Generated with Claude Code
Summary by cubic
Fixes the service card evidence-task count to show only tasks added to the org, matching the service detail page. Also fixes the fallback so cards show total mapped tasks when templates aren’t provided.
Written for commit e47a500. Summary will update on new commits.