-
Notifications
You must be signed in to change notification settings - Fork 344
fix(content-explorer): Fix grid selection #4267
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughI pity the fool — this PR flattens metadata view selection props (moves selection flags/handlers from Changes
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
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 💡 Knowledge Base configuration:
You can enable these sources in your CodeRabbit configuration. 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ 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)
✨ Finishing Touches
🧪 Generate unit tests
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this 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.
⛔ Files ignored due to path filters (1)
yarn.lockis 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.tsxsrc/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 totableProps.isSelectAllEnabled,onSelectionChange, orselectedKeysremain 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.
* fix(content-explorer): Bump metadata-view version to fix grid selection * fix: remove external function name
Summary by CodeRabbit