ENG-2878: Refine tag display in QuestionCard to show source or status#7570
ENG-2878: Refine tag display in QuestionCard to show source or status#7570
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughQuestionCard tag display updated: COMPLETE answers now show a single source tag (sandstone, sparkle for AI), incomplete answers show status tag; removed Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Greptile SummaryThis PR refines the tag display in Key points:
Confidence Score: 3/5
Important Files Changed
Last reviewed commit: ccd5dfc |
clients/admin-ui/src/features/privacy-assessments/AnswerStatusTags.tsx
Outdated
Show resolved
Hide resolved
clients/admin-ui/src/features/privacy-assessments/QuestionCard.tsx
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@clients/admin-ui/src/features/privacy-assessments/AnswerStatusTags.tsx`:
- Line 24: The sparkle condition is always true because it uses the constant
coercion (!!AnswerSource.AI_ANALYSIS); update the check in AnswerStatusTags to
compare the answer's source to the enum: replace
hasSparkle={!!AnswerSource.AI_ANALYSIS} with a comparison like
hasSparkle={answer.source === AnswerSource.AI_ANALYSIS} (or use the same
variable/name pattern used in QuestionCard.tsx) so the sparkle only shows when
the answer's source equals AnswerSource.AI_ANALYSIS.
In `@clients/admin-ui/src/features/privacy-assessments/QuestionCard.tsx`:
- Around line 50-61: QuestionCard currently renders the non-COMPLETE Tag
directly and misses the PARTIAL tooltip logic implemented in AnswerStatusTags;
update the else branch in the QuestionCard render (the Tag using
ANSWER_STATUS_TAG_COLORS and ANSWER_STATUS_LABELS) to detect when
question.answer_status === AnswerStatus.PARTIAL and wrap the Tag with a Tooltip
whose title mirrors AnswerStatusTags (use question.missing_data to build "This
answer can be automatically derived if you populate: ..." when present,
otherwise the fallback message), leaving behavior unchanged for other
non-COMPLETE statuses.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 41cad904-04a9-448b-b012-798e18bb7de2
📒 Files selected for processing (4)
changelog/2878-tag-refinements.yamlclients/admin-ui/src/features/privacy-assessments/AnswerStatusTags.tsxclients/admin-ui/src/features/privacy-assessments/QuestionCard.tsxclients/admin-ui/src/features/privacy-assessments/constants.ts
clients/admin-ui/src/features/privacy-assessments/AnswerStatusTags.tsx
Outdated
Show resolved
Hide resolved
clients/admin-ui/src/features/privacy-assessments/QuestionCard.tsx
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@clients/admin-ui/src/features/privacy-assessments/QuestionCard.tsx`:
- Line 62: The tooltip string in the QuestionCard component contains a
product-specific term ("Fides data"); open the QuestionCard.tsx component and
replace that literal with neutral wording (e.g., "This answer can be derived
from the system data if the relevant field is populated" or similar) so no
internal system names are referenced; update the JSX string used for the tooltip
in the QuestionCard component to the new generic copy.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: cecc60c0-3787-40fa-acfa-7b2f7cb1120b
📒 Files selected for processing (2)
clients/admin-ui/src/features/privacy-assessments/AnswerStatusTags.tsxclients/admin-ui/src/features/privacy-assessments/QuestionCard.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
- clients/admin-ui/src/features/privacy-assessments/AnswerStatusTags.tsx
clients/admin-ui/src/features/privacy-assessments/QuestionCard.tsx
Outdated
Show resolved
Hide resolved
clients/admin-ui/src/features/privacy-assessments/QuestionCard.tsx
Outdated
Show resolved
Hide resolved
lucanovera
left a comment
There was a problem hiding this comment.
Nice UI improvements. The tags are looking better, that sparkle icon brings consistency with other AI features in the product.
Left a couple of comments about the code.
- Update AnswerStatusTags to show source tag only when complete (drop redundant "Complete" status tag), reuse from QuestionCard - Fix "Fides data" -> "system data" in tooltip copy - Remove ANSWER_SOURCE_TAG_COLORS const (all values were SANDSTONE) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@clients/admin-ui/src/features/privacy-assessments/constants.ts`:
- Around line 28-33: The frontend AnswerSource enum member SLACK mismatches the
backend (backend uses team_input), so rename the frontend enum member SLACK to
TEAM_INPUT (ensure its value is "team_input"), update all references/usages to
AnswerSource.SLACK to AnswerSource.TEAM_INPUT, and change the
ANSWER_SOURCE_LABELS mapping key from [AnswerSource.SLACK] to
[AnswerSource.TEAM_INPUT] (keep the label "Team input"); also search and update
any other code that relied on the old SLACK identifier.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 2293ac68-bbd0-45d2-b8bd-2a12029a5cf0
📒 Files selected for processing (3)
clients/admin-ui/src/features/privacy-assessments/AnswerStatusTags.tsxclients/admin-ui/src/features/privacy-assessments/QuestionCard.tsxclients/admin-ui/src/features/privacy-assessments/constants.ts
Frontend had SLACK = "slack" but backend sends team_input = "team_input". Rename enum member and update ANSWER_SOURCE_LABELS accordingly. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…#7570) Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Ticket ENG-2878
Description Of Changes
Updated the card tags so now when an answer is complete it shows Agent (with a sparkle indicator for AI), "Team input", "System derived". When an answer is not complete it show "needs input" or "system derivable"
Code Changes
clients/admin-ui/src/features/privacy-assessments/QuestionCard.tsx- ReplaceAnswerStatusTagswith inline conditionalTagrendering based on answer statusSteps to Confirm
AnswerStatusTagsstill renders correctly in the request input modalPre-Merge Checklist
CHANGELOG.mdupdatedSummary by CodeRabbit
Bug Fixes
Style