Skip to content

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

Open
ahorowitz123 wants to merge 3 commits into
box:masterfrom
ahorowitz123:PREVIEW-225
Open

feat(content-preview): forward monitoring dimensions [PREVIEW-225]#4542
ahorowitz123 wants to merge 3 commits into
box: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
    • Content preview accepts three new optional settings: access pattern, preview mode, and shared-link authentication to refine preview behavior.
  • Tests
    • Added tests ensuring these preview options are forwarded to the preview engine when provided and omitted when not.

Review Change Stack

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

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: 7a37c7be-b1f5-4a86-b32d-802118bcc215

📥 Commits

Reviewing files that changed from the base of the PR and between 47c4e39 and 2c24d63.

📒 Files selected for processing (2)
  • src/elements/content-preview/ContentPreview.js
  • src/elements/content-preview/__tests__/ContentPreview.test.js
✅ Files skipped from review due to trivial changes (1)
  • src/elements/content-preview/tests/ContentPreview.test.js

Walkthrough

ContentPreview Props gain three optional monitoring fields (accessPattern, previewMode, sharedLinkAuth); loadPreview destructures and forwards them into the options passed to preview.show. Tests assert the fields are present when provided and undefined when omitted.

Changes

Preview Monitoring Dimensions

Layer / File(s) Summary
Props Type Definition
src/elements/content-preview/ContentPreview.js
Adds three optional string-literal properties: accessPattern, 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
Adds tests asserting the monitoring dimensions are forwarded into preview.show options when provided and are undefined when omitted; removes a malformed trailing gap in prior tests.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested labels

ready-to-merge

Suggested reviewers

  • shahzadaziz
  • jfox-box
  • jackiejou

Poem

🐰 I nudged three props into preview's song,
Softly forwarded where options belong.
Tests hopped in, checked both yes and none,
Metrics now ready — the work is done. 🥕

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main change: forwarding three monitoring dimensions (accessPattern, previewMode, sharedLinkAuth) to the Preview library's options.
Description check ✅ Passed The description provides all key information: what changed (three new optional props), why (monitoring dashboard rollout), relevant tickets (PREVIEW-225, WEBAPP-53337), and a detailed test plan with checkboxes.
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.

ahorowitz123 and others added 2 commits May 8, 2026 16:37
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>
box-content-preview now derives both signals internally. The wrapper
no longer accepts these props.

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