-
Notifications
You must be signed in to change notification settings - Fork 344
feat(box-ai): Bump box-ai-content-answers version #4233
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
BREAKING CHANGE: isResetChatEnabled prop removed
WalkthroughThis change removes the isResetChatEnabled prop from Box AI components, adjusts rendering to always show the clear conversation button, updates related tests and stories, adds promptType to a test ask call, and bumps a devDependency version in package.json. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor User
participant Sidebar as BoxAISidebarContent
participant Modal as IntelligenceModal
participant Service as AskService
User->>Sidebar: Click "Ask" / submit question
Sidebar->>Modal: Open with prompt
Modal->>Service: ask({ text, promptType: 'user_input' })
Service-->>Modal: answer
Modal-->>Sidebar: result
Sidebar-->>User: display answer
rect rgba(230,240,255,0.4)
note over User,Sidebar: Clear is now always available
User->>Sidebar: Click "Clear conversation"
Sidebar->>Sidebar: Reset conversation state
end
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Suggested labels
Suggested reviewers
Poem
Tip 🔌 Remote MCP (Model Context Protocol) integration is now available!Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats. ✨ 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 (2)
package.json (1)
130-130: Bump devDependency to match PR titleDevDependency on “@box/box-ai-content-answers” is currently ^0.139.0—please update it to ^0.139.5 for clarity:
- "@box/box-ai-content-answers": "^0.139.0", + "@box/box-ai-content-answers": "^0.139.5",Peer dependency remains at ^0.124.1. No other references to this package version found.
src/elements/common/content-answers/__tests__/ContentAnswersModal.test.tsx (1)
145-151: Stabilize expectation with objectContaining to reduce brittlenessThe exact object match can become brittle if the upstream adds fields to the prompt object. Prefer a partial match focusing on the fields you care about.
Apply this diff:
- expect(mockApi.getIntelligenceAPI().ask).lastCalledWith( - { isCompleted: false, isLoading: true, prompt: 'Another question?', promptType: 'user_input' }, - [{ id: mockFile.id, type: 'file' }], - [{ answer: 'summarize answer', created_at: '', prompt: 'summarize another question' }], - { - include_citations: true, - }, - ); + expect(mockApi.getIntelligenceAPI().ask).lastCalledWith( + expect.objectContaining({ + isCompleted: false, + isLoading: true, + prompt: 'Another question?', + promptType: 'user_input', + }), + [{ id: mockFile.id, type: 'file' }], + [{ answer: 'summarize answer', created_at: '', prompt: 'summarize another question' }], + { + include_citations: true, + }, + );Also consider importing a prompt type enum (if exported) instead of a magic string 'user_input' to catch typos via types.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
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 (8)
package.json(1 hunks)src/elements/common/content-answers/ContentAnswersModal.tsx(0 hunks)src/elements/common/content-answers/__tests__/ContentAnswersModal.test.tsx(2 hunks)src/elements/content-sidebar/BoxAISidebar.tsx(0 hunks)src/elements/content-sidebar/BoxAISidebarContent.tsx(1 hunks)src/elements/content-sidebar/__tests__/BoxAISidebar.test.tsx(0 hunks)src/elements/content-sidebar/stories/BoxAISidebar.stories.tsx(0 hunks)src/elements/content-sidebar/stories/tests/BoxAISidebar-visual.stories.tsx(0 hunks)
💤 Files with no reviewable changes (5)
- src/elements/content-sidebar/BoxAISidebar.tsx
- src/elements/content-sidebar/stories/BoxAISidebar.stories.tsx
- src/elements/content-sidebar/tests/BoxAISidebar.test.tsx
- src/elements/content-sidebar/stories/tests/BoxAISidebar-visual.stories.tsx
- src/elements/common/content-answers/ContentAnswersModal.tsx
🧰 Additional context used
🧠 Learnings (1)
📚 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
⏰ 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). (1)
- GitHub Check: Summary
🔇 Additional comments (2)
src/elements/common/content-answers/__tests__/ContentAnswersModal.test.tsx (1)
19-24: Good addition: promptType included in mockQuestionIncluding promptType: 'user_input' brings the test data in line with the updated ask contract. LGTM.
src/elements/content-sidebar/BoxAISidebarContent.tsx (1)
193-193: ClearConversationButton renders unconditionally—confirm onClearAction injectionEnsure that
withApiWrapper’sApiWrapperWithInjectedPropsalways providesonClearAction(it’s declared as a required function). If there’s any scenario where it could beundefined, a small safeguard will prevent runtime errors:- <ClearConversationButton onClick={onClearAction} /> + <ClearConversationButton onClick={onClearAction ?? (() => {})} />• Verify that
ApiWrapperWithInjectedPropsmarksonClearActionas non-optional
• Confirm there are no remaining references to the removedisResetChatEnabledprop
box-catzhang
left a comment
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.
lgtm!
BREAKING CHANGE: isResetChatEnabled prop removed
Bumping
@box/box-ai-content-answerspackage to version0.139.5. This requires removing theisResetChatEnabledprop, which has been deprecated.Summary by CodeRabbit