Skip to content

feat(content-preview): forward monitoring dimensions [PREVIEW-225]#4542

Open
ahorowitz123 wants to merge 2 commits intobox:masterfrom
ahorowitz123:PREVIEW-225
Open

feat(content-preview): forward monitoring dimensions [PREVIEW-225]#4542
ahorowitz123 wants to merge 2 commits intobox:masterfrom
ahorowitz123:PREVIEW-225

Conversation

@ahorowitz123
Copy link
Copy Markdown
Contributor

@ahorowitz123 ahorowitz123 commented May 7, 2026

Summary

Accepts three new optional props on <ContentPreview>accessPattern, previewMode, sharedLinkAuth — and threads them into previewOptions so the underlying Preview library can tag emitted preview_metric / preview_error events for the monitoring dashboard.

Why

Part of the Preview Performance Monitoring dashboard rollout under WEBAPP-53337. The dashboard needs to slice TTPL by access pattern, preview mode, and shared-link auth. Companion box-content-preview work (accepting + emitting these dimensions) landed in PREVIEW-224; host app call sites land in PREVIEW-226 and PREVIEW-227.

Ticket

PREVIEW-225

Test plan

  • Unit test: props forward to preview.show() options when supplied
  • Unit test: options are undefined when props omitted
  • Full ContentPreview test suite passes (147 tests)
  • ESLint clean
  • Manual verification: host app sets the props and confirms payloads carry the dimensions (tracked by PREVIEW-226/227)

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Enhanced content preview with new optional configuration settings for access patterns, prefetch/preload status, preview modes, and shared-link authentication for finer preview behavior control.
  • Tests
    • Added coverage verifying these host-supplied preview options are forwarded when present and omitted when not.

Accept accessPattern, previewMode, sharedLinkAuth as props on
ContentPreview and pass them through to the underlying Preview library
so emitted metric/error events are tagged for the monitoring dashboard.

PREVIEW-225

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@ahorowitz123 ahorowitz123 requested review from a team as code owners May 7, 2026 18:38
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 7, 2026

Review Change Stack
No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 0634bb6e-f87b-40c2-b1a8-266fb45a8468

📥 Commits

Reviewing files that changed from the base of the PR and between 06b6bd4 and 47c4e39.

📒 Files selected for processing (2)
  • src/elements/content-preview/ContentPreview.js
  • src/elements/content-preview/__tests__/ContentPreview.test.js
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/elements/content-preview/tests/ContentPreview.test.js

Walkthrough

ContentPreview Props gain five optional monitoring fields (accessPattern, prefetchStatus, preloadStatus, previewMode, sharedLinkAuth); loadPreview destructures these props and includes them in the options passed to preview.show. Tests assert the fields are forwarded when provided and undefined when omitted.

Changes

Preview Monitoring Dimensions

Layer / File(s) Summary
Props Type Definition
src/elements/content-preview/ContentPreview.js
Adds five optional string-literal properties: accessPattern, prefetchStatus, preloadStatus, previewMode, and sharedLinkAuth.
Implementation: loadPreview
src/elements/content-preview/ContentPreview.js
loadPreview destructures the new props from this.props and includes them in the previewOptions object passed to preview.show.
Tests
src/elements/content-preview/__tests__/ContentPreview.test.js
Removes a malformed trailing gap and adds tests that verify the monitoring dimensions are present in preview.show options when provided and undefined when omitted.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested labels

ready-to-merge

Suggested reviewers

  • jfox-box
  • shahzadaziz
  • tjuanitas

Poem

🐰 I hopped through props both five and bright,
Forwarded them gently into preview's light.
Tests gave a nod, no gaps in sight,
Now metrics can dance in morning's light. 🥕

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically summarizes the main change: adding monitoring dimensions to the ContentPreview component.
Description check ✅ Passed The description is well-structured with clear Summary, Why, Ticket, and Test plan sections covering the change objectives, business context, and verification steps.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Accepts two new optional props on ContentPreview — prefetchStatus
and preloadStatus — and threads them into previewOptions so
box-content-preview can tag emitted load/error/outcome events.

PREVIEW-225

Co-Authored-By: Claude Opus 4.7 (1M context) <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.

1 participant