Skip to content

feat(drive-integration): display validationFindings in mapping-review UI [INTEG-4383]#11087

Open
david-shibley-contentful wants to merge 4 commits into
masterfrom
feat/drive-integration-integ-4383
Open

feat(drive-integration): display validationFindings in mapping-review UI [INTEG-4383]#11087
david-shibley-contentful wants to merge 4 commits into
masterfrom
feat/drive-integration-integ-4383

Conversation

@david-shibley-contentful

@david-shibley-contentful david-shibley-contentful commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

INTEG-4383

Summary

  • Adds ValidationFinding interface and validationFindings?: ValidationFinding[] to MappingReviewSuspendPayload so the UI can consume findings from the validate-payload step
  • Renders per-entry badges in the overview list: negative ("Needs attention") for block findings, warning ("Warning") for warn-only entries
  • Gates the "Create selected entries" button behind an explicit acknowledgement checkbox when block findings are present; warn findings annotate without blocking
Screenshot 2026-07-15 at 12 13 29 PM

Test plan

  • With google-docs-agent-improvements flag 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 checked
  • With flag off (no validationFindings in payload): no badges rendered, Create button enabled as before
  • Deselect all entries → Create button still disabled (existing behaviour preserved)
  • npm run test:ci passes (166 tests, 9 new)

Generated with Claude Code

@david-shibley-contentful
david-shibley-contentful requested review from a team as code owners July 15, 2026 16:51
… 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>
@david-shibley-contentful
david-shibley-contentful force-pushed the feat/drive-integration-integ-4383 branch from 3526062 to ea9efab Compare July 15, 2026 16:54
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

@JuliRossi JuliRossi left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

referenceGraph: ReviewedReferenceGraph;
contentTypes: WorkflowContentType[];
/** Present when the google-docs-agent-improvements flag is on; absent otherwise. */
validationFindings?: ValidationFinding[];

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

⛏️Nit: I would remove the comment

}

/** Severity levels for validation findings produced by the validate-payload step. */
export type ValidationFindingSeverity = 'block' | 'warn';

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

⛏️ nit: this could be an enum, as we are using it in several places

@FBanfi Franco Banfi (FBanfi) left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Lgtm! Just left two minor comments!

return map;
}, [payload.validationFindings]);

const hasBlockFindings = (payload.validationFindings ?? []).some((f) => f.severity === 'block');

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

We could reuse the one that is computed in the ReviewPage.tsx to avoid having this two times.

Comment on lines 101 to 116
{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>

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

"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!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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.

david-shibley-contentful and others added 2 commits July 15, 2026 13:01
- 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>
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.

4 participants