feat(drive-integration): display validationFindings in mapping-review UI [INTEG-4383]#11087
feat(drive-integration): display validationFindings in mapping-review UI [INTEG-4383]#11087david-shibley-contentful wants to merge 4 commits into
Conversation
… UI with block/warn badges [INTEG-4383] Consumes validationFindings from the PENDING_REVIEW suspend payload and surfaces them in the mapping-review overview panel. Block findings show a "Needs attention" badge per entry and gate the Create button behind an explicit acknowledgement checkbox; warn findings show a "Warning" badge without blocking. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
3526062 to
ea9efab
Compare
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
| referenceGraph: ReviewedReferenceGraph; | ||
| contentTypes: WorkflowContentType[]; | ||
| /** Present when the google-docs-agent-improvements flag is on; absent otherwise. */ | ||
| validationFindings?: ValidationFinding[]; |
There was a problem hiding this comment.
⛏️Nit: I would remove the comment
| } | ||
|
|
||
| /** Severity levels for validation findings produced by the validate-payload step. */ | ||
| export type ValidationFindingSeverity = 'block' | 'warn'; |
There was a problem hiding this comment.
⛏️ nit: this could be an enum, as we are using it in several places
Franco Banfi (FBanfi)
left a comment
There was a problem hiding this comment.
Lgtm! Just left two minor comments!
| return map; | ||
| }, [payload.validationFindings]); | ||
|
|
||
| const hasBlockFindings = (payload.validationFindings ?? []).some((f) => f.severity === 'block'); |
There was a problem hiding this comment.
We could reuse the one that is computed in the ReviewPage.tsx to avoid having this two times.
| {row.hasNoMappedContent && ( | ||
| <Badge variant="secondary" size="small" className={noMappedContentBadge}> | ||
| No mapped content | ||
| </Badge> | ||
| )} | ||
| {hasBlockFindings && ( | ||
| <Badge variant="negative" size="small" className={noMappedContentBadge}> | ||
| Needs attention | ||
| </Badge> | ||
| )} | ||
| {!hasBlockFindings && hasWarnFindings && ( | ||
| <Badge variant="warning" size="small" className={noMappedContentBadge}> | ||
| Warning | ||
| </Badge> | ||
| )} | ||
| </Paragraph> |
There was a problem hiding this comment.
"No mapped content" and "Needs attention"/"Warning" are rendered as sibling <Badge> elements in a <Paragraph>. If an entry simultaneously has no mapped content type AND a block finding, both badges appear.
Perhaps this is an expected behavior but since the PR didn't mention about this, just wanted to double check it with you!
There was a problem hiding this comment.
Good catch — this is intentional. An entry with no mapped content fields that also has a block finding (e.g. a required field is missing) would legitimately show both. The badges serve different purposes: "No mapped content" means none of the field mappings have any source refs, while "Needs attention" means the validate-payload step flagged a structural issue. They're not mutually exclusive so showing both makes sense here.
- Convert ValidationFindingSeverity from type alias to enum - Remove JSDoc comment from validationFindings field - Pass hasBlockFindings from ReviewPage to OverviewSection to avoid computing it twice - Update all severity comparisons and test fixtures to use enum values Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
INTEG-4383
Summary
ValidationFindinginterface andvalidationFindings?: ValidationFinding[]toMappingReviewSuspendPayloadso the UI can consume findings from the validate-payload stepnegative("Needs attention") forblockfindings,warning("Warning") forwarn-only entriesTest plan
google-docs-agent-improvementsflag on: import a document, verify entries with block findings show "Needs attention" badge, warn-only entries show "Warning" badge, and Create button is disabled until the acknowledgement checkbox is checkedvalidationFindingsin payload): no badges rendered, Create button enabled as beforenpm run test:cipasses (166 tests, 9 new)Generated with Claude Code