Skip to content

Conversation

@jpfranco
Copy link
Contributor

@jpfranco jpfranco commented Aug 19, 2025

BREAKING CHANGE: isResetChatEnabled prop removed

Bumping @box/box-ai-content-answers package to version 0.139.5. This requires removing the isResetChatEnabled prop, which has been deprecated.

Summary by CodeRabbit

  • New Features
    • “Clear conversation” is now always available in the Box AI sidebar and Content Answers modal, removing the need for any configuration toggle.
  • Tests
    • Updated unit and visual tests/stories to reflect the always-on Clear action and new prompt metadata.
  • Chores
    • Bumped the AI content answers development dependency to a newer version for improved compatibility and tooling.

BREAKING CHANGE: isResetChatEnabled prop removed
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Aug 19, 2025

Walkthrough

This 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

Cohort / File(s) Summary of changes
Dependency update
package.json
Bumped devDependency @box/box-ai-content-answers from ^0.124.1 to ^0.139.0.
Content Answers Modal & tests
src/elements/common/content-answers/ContentAnswersModal.tsx, src/elements/common/content-answers/__tests__/ContentAnswersModal.test.tsx
Removed isResetChatEnabled from public props and stopped passing it to IntelligenceModal. Test updated to include promptType: 'user_input' in ask call.
BoxAI Sidebar components & tests
src/elements/content-sidebar/BoxAISidebar.tsx, src/elements/content-sidebar/BoxAISidebarContent.tsx, src/elements/content-sidebar/__tests__/BoxAISidebar.test.tsx
Removed isResetChatEnabled prop from public interfaces and usage. ClearConversationButton now rendered unconditionally. Tests updated to remove the prop and a test tied to the conditional clear button.
Storybook stories
src/elements/content-sidebar/stories/BoxAISidebar.stories.tsx, src/elements/content-sidebar/stories/tests/BoxAISidebar-visual.stories.tsx
Removed isResetChatEnabled from story args.

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
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested labels

ready-to-merge

Suggested reviewers

  • marcoartaviaq
  • greg-in-a-box
  • tjuanitas

Poem

I nudge the chat, then hop back clear,
A button bright, forever near.
No toggles now, just ask and see—
With prompts that whisper “user_input,” whee!
Dependencies fresh, my whiskers cheer,
Thump-thump, approved—let’s ship it, dear. 🐇✨

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 Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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 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.

@jpfranco jpfranco marked this pull request as ready for review August 19, 2025 16:58
@jpfranco jpfranco requested review from a team as code owners August 19, 2025 16:58
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 (2)
package.json (1)

130-130: Bump devDependency to match PR title

DevDependency 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 brittleness

The 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.

📥 Commits

Reviewing files that changed from the base of the PR and between 4f89946 and 417d780.

⛔ Files ignored due to path filters (1)
  • yarn.lock is 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 mockQuestion

Including 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 injection

Ensure that withApiWrapper’s ApiWrapperWithInjectedProps always provides onClearAction (it’s declared as a required function). If there’s any scenario where it could be undefined, a small safeguard will prevent runtime errors:

-            <ClearConversationButton onClick={onClearAction} />
+            <ClearConversationButton onClick={onClearAction ?? (() => {})} />

• Verify that ApiWrapperWithInjectedProps marks onClearAction as non-optional
• Confirm there are no remaining references to the removed isResetChatEnabled prop

@greg-in-a-box greg-in-a-box changed the title feat(BoxAI): Bump box-ai-content-answers version feat(box-ai): Bump box-ai-content-answers version Aug 19, 2025
Copy link
Collaborator

@box-catzhang box-catzhang left a comment

Choose a reason for hiding this comment

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

lgtm!

@mergify mergify bot merged commit 47cea9f into box:master Aug 20, 2025
9 checks passed
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