Skip to content

feat(metadata): pass trackEvent callback to metadata components#4538

Merged
mergify[bot] merged 6 commits into
box:masterfrom
olehrybak:metadata-track-event-callback
May 7, 2026
Merged

feat(metadata): pass trackEvent callback to metadata components#4538
mergify[bot] merged 6 commits into
box:masterfrom
olehrybak:metadata-track-event-callback

Conversation

@olehrybak
Copy link
Copy Markdown
Contributor

@olehrybak olehrybak commented May 6, 2026

Changes

  • Bumped @box/metadata-editor dependency to version 1.69.6
  • Passed trackEvent callback to the metadata editor components via Sidebar

Summary by CodeRabbit

  • New Features

    • Added optional event-tracking callback support to metadata sidebar and editors.
  • Chores

    • Bumped metadata-editor dependency to ^1.69.6.
  • Tests

    • Improved reliability of visual tests for asynchronously rendered elements in the metadata sidebar.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 6, 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: 5d7d80e7-297b-42c0-b497-830ac93b154c

📥 Commits

Reviewing files that changed from the base of the PR and between 1424b77 and a3a2b1c.

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (1)
  • package.json
✅ Files skipped from review due to trivial changes (1)
  • package.json

Walkthrough

This PR adds an optional trackEvent callback prop across metadata sidebar types and components, forwards the prop through MetadataSidebarRedesign → MetadataInstanceEditor → MetadataInstanceForm and MetadataInstanceList, updates a visual test to wait for async buttons, and bumps @box/metadata-editor in package.json.

Changes

Event Tracking Prop Implementation

Layer / File(s) Summary
Dependency Upgrade
package.json
@box/metadata-editor updated from ^1.61.5 to ^1.69.6 in devDependencies and peerDependencies.
Type Definitions
src/elements/content-sidebar/MetadataSidebar.js, src/elements/content-sidebar/MetadataInstanceEditor.tsx, src/elements/content-sidebar/MetadataSidebarRedesign.tsx
Optional trackEvent callback prop added to ExternalProps, MetadataInstanceEditorProps, and MetadataSidebarRedesignProps with signature (eventName: string, data?: Record<string, unknown>) => void.
Component Plumbing
src/elements/content-sidebar/MetadataInstanceEditor.tsx, src/elements/content-sidebar/MetadataSidebarRedesign.tsx
trackEvent destructured from component props and passed to child components (MetadataInstanceForm, MetadataInstanceEditor, MetadataInstanceList).
Test / Visual Regression
src/elements/content-sidebar/stories/tests/MetadataSidebarRedesign-visual.stories.tsx
AcceptAllDismissesReviewNotice story updated to re-query acceptButtons inside a waitFor loop to handle async rendering before clicking.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested labels

ready-to-merge

Suggested reviewers

  • tjuanitas
  • jfox-box
  • Lindar90

Poem

🐰 A callback springs to life, so bright,
Through sidebar layers, prop takes flight,
I wait for buttons, then I click,
Events now travel, soft and quick,
Hooray — metadata tracking feels right!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: adding a trackEvent callback prop to metadata components and passing it through the sidebar.
Description check ✅ Passed The description covers the key changes (dependency bump and trackEvent callback plumbing) but lacks technical details about implementation, component hierarchy, or testing changes.
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.

@olehrybak olehrybak marked this pull request as ready for review May 6, 2026 13:55
@olehrybak olehrybak requested review from a team as code owners May 6, 2026 13:55
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/elements/content-sidebar/MetadataSidebar.js`:
- Line 51: ExternalProps declares trackEvent (exported via MetadataSidebarProps)
but MetadataSidebar never consumes or forwards it; either (A) destructure
trackEvent in MetadataSidebar (in render and relevant class methods) and pass it
into child components that can use it (e.g., Instances, TemplateDropdown or any
telemetry-capable child) so callers' handlers are invoked, referencing the
symbol names trackEvent, MetadataSidebar, Instances, TemplateDropdown, render;
or (B) if ignoring tracking is intentional, add a clear inline comment on the
MetadataSidebar component and in the ExternalProps/MetadataSidebarProps
declaration noting that trackEvent is intentionally a no-op for the legacy
sidebar to prevent confusion.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 7a6d08cb-5cca-485e-8219-069ed444b28d

📥 Commits

Reviewing files that changed from the base of the PR and between 17f8107 and 8282093.

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (5)
  • package.json
  • src/elements/content-sidebar/MetadataInstanceEditor.tsx
  • src/elements/content-sidebar/MetadataSidebar.js
  • src/elements/content-sidebar/MetadataSidebarRedesign.tsx
  • src/elements/content-sidebar/stories/tests/MetadataSidebarRedesign-visual.stories.tsx

Comment thread src/elements/content-sidebar/MetadataSidebar.js
Comment thread src/elements/content-sidebar/MetadataSidebar.js
@mergify
Copy link
Copy Markdown
Contributor

mergify Bot commented May 7, 2026

Merge Queue Status

  • Entered queue2026-05-07 17:09 UTC · Rule: Automatic strict merge
  • Checks passed · in-place
  • Merged2026-05-07 17:24 UTC · at a3a2b1c1b9b7e2a9aba893ab96461f3fcd044baf · squash

This pull request spent 14 minutes 49 seconds in the queue, including 14 minutes 28 seconds running CI.

Required conditions to merge

@mergify mergify Bot merged commit 4c8cf11 into box:master May 7, 2026
8 of 9 checks passed
@mergify mergify Bot removed the queued label May 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants