-
Notifications
You must be signed in to change notification settings - Fork 317
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
feat(content-sidebar): added onUserInteraction prop to BoxAISidebar #4027
feat(content-sidebar): added onUserInteraction prop to BoxAISidebar #4027
Conversation
@@ -14,7 +14,6 @@ import { | |||
ClearConversationButton, | |||
IntelligenceModal, | |||
withApiWrapper, | |||
// @ts-expect-error - TS2305 - Module '"@box/box-ai-content-answers"' has no exported member 'ApiWrapperWithInjectedProps'. |
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.
🙌
@@ -83,11 +83,14 @@ function BoxAISidebarContent(props: ApiWrapperWithInjectedProps) { | |||
setCacheValue('agents', { agents, requestState, selectedAgent }); | |||
} | |||
|
|||
const handleUserIntentToUseAI = () => { | |||
const handleUserIntentToUseAI = (userHasInteracted: boolean = false) => { |
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.
[nit] I think hasUserInteracted
would be more proper form
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.
That might be true, however I've named it the same way in content-answers, so for consistency I'd leave it like that.
ad4aaf4
to
3566980
Compare
@@ -423,4 +424,14 @@ describe('elements/content-sidebar/BoxAISidebar', () => { | |||
expect(mockSendQuestion).not.toHaveBeenCalled(); | |||
}, | |||
); | |||
|
|||
test('should call onUserInteraction when user takes action', async () => { |
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.
Should we cover when userHasInteracted
? Or is this covered in box-ai-content-answers
?
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.
This test already covers that. onUserIntentToUseAI
is called with userHasInteracted = true
when user types in prompt. The logic of setting this param is inside content-answers
.
3566980
to
5255c71
Compare
Description
Added
onUserInteraction
prop to BoxAISidebar to notify parent when user interacts with Box AI.