feat(content-preview): forward clientName prop to Preview options#4586
Conversation
WalkthroughThe PR adds an optional ChangesAdd clientName monitoring dimension to ContentPreview
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Adds an optional clientName prop on <ContentPreview> that's threaded into previewOptions so the underlying box-content-preview library can tag emitted events with the host application name. Lets monitoring dashboards split traffic by host (EUA vs preview-client). Mirrors the four monitoring-dimension props added in PR box#4542 (accessPattern, previewMode, sharedLinkAuth, preloadStatus). When omitted, the prop flows through as undefined — same no-op default behavior. Companion PRs: - box-content-preview: emit client_name on every event (PREVIEW-325) - EndUserApp: pass clientName='enduserapp' (PREVIEW-327) - preview-client: pass clientName='preview-client' (PREVIEW-328) - monitoring/analytics-schemas: declare client_name field (PREVIEW-324) - data-platform: extract client_name as Zephyr metric tag (PREVIEW-323) JIRA: PREVIEW-326 Umbrella: PREVIEW-322 Epic: WEBAPP-53337 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
7f14ada to
5d2a6ff
Compare
Merge Queue Status
This pull request spent 12 minutes 25 seconds in the queue, including 11 minutes 58 seconds running CI. Required conditions to merge
|
Summary
Accepts a new optional
clientNameprop on<ContentPreview>and threads it intopreviewOptionsso the underlyingbox-content-previewlibrary can tag emittedpreview_metric/preview_errorevents with the host application name. Lets monitoring dashboards split traffic by host (EUA vs preview-client).This is a Phase 2 follow-up to #4542 which added the four other monitoring-dimension props (
accessPattern,previewMode,sharedLinkAuth,preloadStatus). Same forwarding pattern, just one more prop.Why
EUA and preview-client both render
<ContentPreview>. WithoutclientName, the underlying preview library can't distinguish which app called it. This unblocks "EUA vs preview-client" panels in the Preview Performance Monitoring dashboardsImplementation
src/elements/content-preview/ContentPreview.js:clientName?: stringto thePropstypeclientNameinloadPreviewpreviewOptionsalongside the existing four monitoring dimensionssrc/elements/content-preview/__tests__/ContentPreview.test.js: extended the existing monitoring-dimensions tests to coverclientName(forwarded when supplied, undefined when omitted)Test plan
clientNameforwards topreview.show()options when supplied — passesundefinedwhen prop omitted — passes🤖 Generated with Claude Code
Summary by CodeRabbit
Release Notes
New Features
Tests