-
Notifications
You must be signed in to change notification settings - Fork 313
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(boxai-sidebar): Add is feedback enabled prop to box ai sidebar #3867
feat(boxai-sidebar): Add is feedback enabled prop to box ai sidebar #3867
Conversation
8a3082a
to
75251df
Compare
cb69974
to
f32b658
Compare
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.
one comment but otherwise looks good
package.json
Outdated
@@ -307,7 +307,7 @@ | |||
"@box/blueprint-web": "^7.36.3", | |||
"@box/blueprint-web-assets": "^4.28.0", |
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.
does blueprint-web-assets peer dependency need to be updated?
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.
yes it should, thank for pointing that up!
@@ -16,8 +16,10 @@ export interface BoxAISidebarContextValues { | |||
cache: { encodedSession?: string | null; questions?: QuestionType[] }; | |||
contentName: string; | |||
elementId: string; | |||
isFeedbackEnabled: boolean; |
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.
what happens after the feedback buttons work? in terms making any api calls. i'm not seeing a changes in the apis, does that mean it was already implemented?
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.
When user clicks feedback buttons the resinAction
is being called, no API call are made.
We keep the feedback data in resin tracking.
can you update the PR title to follow conventional commit? |
This version contains Feedback Thumb Buttons
4e4eacd
to
af2a9c3
Compare
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.
Have one comment around memoization but lgtm
@@ -70,6 +74,35 @@ const BoxAISidebar = (props: BoxAISidebarProps) => { | |||
} = props; | |||
const { questions } = cache; | |||
const { formatMessage } = useIntl(); | |||
const contextValue = React.useMemo( |
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.
Are these worth memoizing? Generally useMemo should be used for expensive calculations or deeply nested objects etc.
We're reading
isFeedbackEnabled
from the host app, and pass it toBoxAiContentAnswers
.This is an optional prop that is
false
by default. Whentrue
it enables Thumb Feedback Buttons in every answer that record if user consider the answer helpful.