feat(commerce): provisional-claim topbar on the report — click to verify - #5816
Open
viktormarinho wants to merge 1 commit into
Open
feat(commerce): provisional-claim topbar on the report — click to verify#5816viktormarinho wants to merge 1 commit into
viktormarinho wants to merge 1 commit into
Conversation
The reports worker now grades a claim instead of blocking it (decocms/reports#313): a store owner logging in with a gmail gets a PROVISIONAL claim — they see their report, but subscription/weekly runs need a VERIFIED one, and connecting the store own GA4/GSC verifies it automatically. This surfaces that state: a slim full-width yellow strip above the Commerce Discovery report tab while the claim is provisional. Clicking opens the connect-sources tab, where connecting a source resolves it. Fail-soft: no siteUrl, a failed status query, a worker without the claim field, or a verified claim all render nothing. Plumbing: connections/status now passes the claim state through (auth-client + COMMERCE_DISCOVERY_CONNECTION_STATUS output schema + tool-io), and useCommerceDiagnostic exposes the connection siteUrl.
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.
Summary
The reports worker now grades a claim instead of blocking it (decocms/reports#313): a store owner logging in with a gmail gets a provisional claim — they see their report normally, but subscription/weekly runs require a verified one, and connecting the store's own GA4/GSC verifies it automatically.
This PR surfaces that state in Studio:
claimfield, or a verified claim all render nothing — the report never breaks because of the strip.Plumbing
fetchCommerceDiscoveryConnectionStatus+COMMERCE_DISCOVERY_CONNECTION_STATUSpass the newclaim: { method, verified } | nullthrough (schema is optional-tolerant for older workers);tool-io.tsupdated to match (hand-edited — the local generator run produced an env-dependent subset, so only the changed entry was touched).useCommerceDiagnosticnow exposes the connection'ssiteUrl(the argument the reports tools expect).Testing
bun run --cwd=apps/web checkand--cwd=apps/api checkpass;bun run fmtclean.apps/apireports tests: 29 pass, incl. new cases — claim passthrough and absent-field tolerance.Depends on decocms/reports#313 being deployed for the field to be non-null (already merged; without it the banner simply never shows).
🤖 Generated with Claude Code
Summary by cubic
Adds a slim yellow topbar to the Commerce Discovery report when a store’s claim is provisional. Clicking the bar opens Connect Sources to verify ownership by linking GA4 or GSC. The UI fails soft and never blocks the report.
claim.verifiedis false; clicking opensconnect-sources.claimviafetchCommerceDiscoveryConnectionStatus;COMMERCE_DISCOVERY_CONNECTION_STATUSoutput andtool-ioupdated.use-commerce-diagnosticexposessiteUrlfor tool calls.siteUrl, loading/failed queries, older workers withoutclaim, or verified claim by rendering nothing.Written for commit 91d7ef6. Summary will update on new commits.