Skip to content
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

fix(ai-sidebar): Pass additional props to BoxAISidebarContent #3820

Merged
merged 2 commits into from
Jan 9, 2025

Conversation

karolinaru
Copy link
Contributor

Description

Pass isOpen and getSuggestedQuestions to BoxAISidebarContent allowing suggested questions to load correctly for xlsx files.

  • isOpen indicates whether the AI Sidebar is open or closed.
  • getSuggestedQuestions It either returns a function to fetch suggested questions under certain conditions or null when no questions are available.

Both props are utilized by BoxAISidebarContent when wrapped in withApiWrapper, to handle the logic for fetching and displaying suggested questions based on the file type and Sidebar state.

Suggested question for xlsx file:

Screenshot 2025-01-02 at 09 51 30

@karolinaru karolinaru requested a review from a team as a code owner January 2, 2025 11:54
@@ -80,6 +81,7 @@ const BoxAISidebar = (props: BoxAISidebarProps) => {
fileID,
getSuggestedQuestions,
isIntelligentQueryMode,
isOpen,
Copy link
Contributor

Choose a reason for hiding this comment

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

When looking at the corresponding EUA change, I've come to a conclusion, that I've approved this prematurely :)
Do we need to get this prop from outside? I believe we could pass it to toBoxAISidebarContent always as true, because if the sidebar is closed, BoxAISidebarContent component will never be rendered.

Copy link
Contributor

Choose a reason for hiding this comment

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

I agree, let's remove it from props here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated

@@ -116,6 +118,8 @@ const BoxAISidebar = (props: BoxAISidebarProps) => {
value={{ cache, contentName, elementId, isStopResponseEnabled, setCacheValue, recordAction, userInfo }}
>
<BoxAISidebarContent
getSuggestedQuestions={getSuggestedQuestions}
isOpen={isOpen}
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
isOpen={isOpen}
isOpen

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated

@karolinaru karolinaru force-pushed the ai-sidebar-suggested-questions branch from ed885fa to 88d0131 Compare January 9, 2025 12:57
@mergify mergify bot merged commit 6b26c64 into box:master Jan 9, 2025
6 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