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

feat(boxai-sidebar): Add is feedback enabled prop to box ai sidebar #3867

Conversation

jankowiakdawid
Copy link
Contributor

@jankowiakdawid jankowiakdawid commented Jan 24, 2025

We're reading isFeedbackEnabled from the host app, and pass it to BoxAiContentAnswers.

This is an optional prop that is false by default. When true it enables Thumb Feedback Buttons in every answer that record if user consider the answer helpful.

Screenshot 2025-02-03 at 18 22 47

@jankowiakdawid jankowiakdawid force-pushed the add-is-feedback-enabled-prop-to-box-ai-sidebar branch from 8a3082a to 75251df Compare January 24, 2025 17:13
@CLAassistant
Copy link

CLAassistant commented Jan 28, 2025

CLA assistant check
All committers have signed the CLA.

@jankowiakdawid jankowiakdawid force-pushed the add-is-feedback-enabled-prop-to-box-ai-sidebar branch from cb69974 to f32b658 Compare February 3, 2025 17:21
@jankowiakdawid jankowiakdawid marked this pull request as ready for review February 3, 2025 21:00
@jankowiakdawid jankowiakdawid requested review from a team as code owners February 3, 2025 21:00
Copy link
Contributor

@tjuanitas tjuanitas left a 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",
Copy link
Contributor

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?

Copy link
Contributor Author

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;
Copy link
Contributor

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?

Copy link
Contributor Author

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.

@tjuanitas
Copy link
Contributor

can you update the PR title to follow conventional commit?

@jankowiakdawid jankowiakdawid changed the title Add is feedback enabled prop to box ai sidebar feat(boxai-sidebar): Add is feedback enabled prop to box ai sidebar Feb 4, 2025
@jankowiakdawid jankowiakdawid force-pushed the add-is-feedback-enabled-prop-to-box-ai-sidebar branch from 4e4eacd to af2a9c3 Compare February 4, 2025 17:03
Copy link
Contributor

@JChan106 JChan106 left a 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(
Copy link
Contributor

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.

@mergify mergify bot merged commit 9d4cc8c into box:master Feb 4, 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.

4 participants