Skip to content

Conversation

@jfox-box
Copy link
Contributor

@jfox-box jfox-box commented Sep 4, 2025

Summary by CodeRabbit

  • Refactor
    • Simplified selection configuration in Content Explorer’s Metadata View to a single top-level selection option; selection behavior (including “Select all”) is preserved.
    • Side panel now closes automatically when selection is cleared for a cleaner workflow.
  • Chores
    • Bumped metadata view dependency to a newer patch release for improved stability.

@jfox-box jfox-box requested a review from a team as a code owner September 4, 2025 21:51
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 4, 2025

Walkthrough

I pity the fool — this PR flattens metadata view selection props (moves selection flags/handlers from metadataViewProps.tableProps to top-level metadataViewProps), wires top-level onSelectionChange/selectedKeys, updates tests/stories, and bumps @box/metadata-view to ^0.48.14.

Changes

Cohort / File(s) Summary
Dependency bump
package.json
Bump @box/metadata-view from ^0.48.6 to ^0.48.14 in dependencies/devDependencies/peerDependencies.
ContentExplorer selection wiring
src/elements/content-explorer/ContentExplorer.tsx
Flatten metadataViewProps: move selection props (formerly under tableProps) to top-level onSelectionChange/selectedKeys; update selectedItemIds handling and close side panel when selection becomes empty.
Unit test update
src/elements/content-explorer/__tests__/ContentExplorer.test.tsx
Replace metadataViewProps.tableProps.isSelectAllEnabled with metadataViewProps.isSelectionEnabled to match new prop shape.
Stories update
src/elements/content-explorer/stories/MetadataView.stories.tsx
Replace nested tableProps.isSelectAllEnabled with top-level isSelectionEnabled inside metadataViewProps.
Visual stories update
src/elements/content-explorer/stories/tests/MetadataView-visual.stories.tsx
Update four stories to use metadataViewProps.isSelectionEnabled instead of tableProps.isSelectAllEnabled; other story fields unchanged.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant U as User
  participant MV as MetadataView (V2)
  participant CE as ContentExplorer
  participant SP as Side Panel

  U->>MV: Select/Deselect items
  MV-->>CE: onSelectionChange(selectedKeys)
  CE->>CE: Update selectedItemIds
  alt selection empty
    CE->>SP: Close panel
  else selection not empty
    CE->>SP: Leave panel open
  end
  CE-->>MV: Provide updated selectedKeys
  CE-->>CE: Call external onSelectionChange if provided
  note right of CE: Selection props are now top-level on metadataViewProps
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested labels

ready-to-merge

Suggested reviewers

  • tjuanitas
  • jpan-box
  • greg-in-a-box

Poem

I pity the fool who nests props too deep,
We pulled ’em up top — no secrets to keep.
Click, select, side panel learns fast,
Tests and stories updated — ship it, at last.
Version bumped, clean and neat — victory complete! 💪


📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP (Model Context Protocol) integration is disabled
  • Jira integration is disabled
  • Linear integration is disabled

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 40e1704 and d42b978.

📒 Files selected for processing (1)
  • src/elements/content-explorer/ContentExplorer.tsx (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/elements/content-explorer/ContentExplorer.tsx
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: Analyze (javascript-typescript)
  • GitHub Check: lint_test_build
  • GitHub Check: Summary
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch selection-fixes

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore or @coderabbit ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
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: 0

🧹 Nitpick comments (1)
src/elements/content-explorer/stories/tests/MetadataView-visual.stories.tsx (1)

86-87: Visual stories migrated to isSelectionEnabled — consistent across cases.

Nice consistency. Consider a tiny helper to reduce repetition if more stories need selection enabled. I pity the fool who copies the same args four times!

Also applies to: 120-121, 188-189, 229-230

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP (Model Context Protocol) integration is disabled
  • Jira integration is disabled
  • Linear integration is disabled

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 1ba15df and 40e1704.

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (5)
  • package.json (2 hunks)
  • src/elements/content-explorer/ContentExplorer.tsx (1 hunks)
  • src/elements/content-explorer/__tests__/ContentExplorer.test.tsx (1 hunks)
  • src/elements/content-explorer/stories/MetadataView.stories.tsx (1 hunks)
  • src/elements/content-explorer/stories/tests/MetadataView-visual.stories.tsx (4 hunks)
🧰 Additional context used
🧠 Learnings (2)
📚 Learning: 2025-08-12T18:04:17.698Z
Learnt from: tjuanitas
PR: box/box-ui-elements#4224
File: package.json:296-297
Timestamp: 2025-08-12T18:04:17.698Z
Learning: In the box-ui-elements project, the team is comfortable with raising peerDependency minimum versions when upgrading blueprint-web packages, even if it's a breaking change for consumers.

Applied to files:

  • package.json
📚 Learning: 2025-08-25T16:19:22.007Z
Learnt from: greg-in-a-box
PR: box/box-ui-elements#4235
File: src/elements/content-explorer/MetadataQueryBuilder.ts:103-110
Timestamp: 2025-08-25T16:19:22.007Z
Learning: In src/elements/content-explorer/MetadataQueryBuilder.ts, the getSelectFilter function has a special case that maps 'mimetype-filter' to 'item.extension' because mimetype-filter is a multi-select field but the actual database field is 'item.extension'. This mapping is necessary and should not be removed.

Applied to files:

  • src/elements/content-explorer/ContentExplorer.tsx
  • src/elements/content-explorer/__tests__/ContentExplorer.test.tsx
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: Analyze (javascript-typescript)
  • GitHub Check: lint_test_build
  • GitHub Check: Summary
🔇 Additional comments (6)
package.json (2)

139-140: Version bump aligned across sections — nice and tight.

Good move bumping @box/metadata-view to ^0.48.14 in dev and peer deps. Keeps the prop flattening in sync. I pity the fool who ships mismatched versions!

Also applies to: 306-307


139-140: Summary mismatch: no plain "dependencies" change present.

AI summary says two bumps under dependencies, but this file only shows devDependencies and peerDependencies updated. Call it out to avoid confusion in release notes.

src/elements/content-explorer/ContentExplorer.tsx (2)

1617-1630: Flattened selection handling looks correct and fixes grid selection.

Forwarding selectedKeys and top-level onSelectionChange, guarding 'all', and auto-closing the side panel on empty selection is solid. I pity the fool who forgets to keep the side panel state in sync!


1617-1630: Clean sweep complete, fool! No references to tableProps.isSelectAllEnabled, onSelectionChange, or selectedKeys remain in the codebase.

src/elements/content-explorer/stories/MetadataView.stories.tsx (1)

66-69: Stories updated to top-level isSelectionEnabled — looks good.

Keeps Storybook aligned with the new API. I pity the fool who demos stale props!

src/elements/content-explorer/__tests__/ContentExplorer.test.tsx (1)

472-476: Tests now use isSelectionEnabled at the top level — on point.

This validates Select All behavior under the new prop. Tight.

@mergify mergify bot merged commit 4beb05d into master Sep 4, 2025
11 checks passed
@mergify mergify bot deleted the selection-fixes branch September 4, 2025 22:32
bfoxx1906 pushed a commit to bfoxx1906/box-ui-elements that referenced this pull request Sep 6, 2025
* fix(content-explorer): Bump metadata-view version to fix grid selection

* fix: remove external function name
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.

4 participants