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

Feedback popover with checkbox for is conversationShared #9670

Merged
merged 2 commits into from
Jan 2, 2025

Conversation

overmode
Copy link
Contributor

@overmode overmode commented Dec 31, 2024

Screen.Recording.2024-12-31.at.13.56.09.mov

Description

Add a checkbox to Feedback Selector: input for sharing conversation

Risk

Breaks feedback

Deploy Plan

Deploy Sparkle.
Do not deploy Front yet, because this is not backward compatible

const [isConversationShared, setIsConversationShared] = React.useState(
feedback?.isConversationShared ?? false
);
// This is required to adjust the content of the popover even when feedback is null.
Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure to understand this, do you mind to shed some lights?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Feedback is populated when a feedback already exists for the message.
In the current prod version, when you click a thumb, we save a feedback and then open the popover.
--> Which explains why we rely on a value from feedback.
This new version does not save the thumb down when clicked, until you properly submit a written feedback.

const selectThumb = useCallback(
async (thumb: ThumbReaction) => {
// Whether to remove the thumb reaction
const isToRemove = feedback?.thumb === thumb;
Copy link
Contributor

Choose a reason for hiding this comment

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

nit

Suggested change
const isToRemove = feedback?.thumb === thumb;
const shouldRemoveExistingThumb = feedback?.thumb === thumb;

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agreed

[]
);

const closePopover = useCallback(() => {
Copy link
Contributor

Choose a reason for hiding this comment

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

No need to wrap setters for state

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is true if we pass the set function as is, but to my understanding here we lso inject 'false', so it would trigger a rerender (because we'd pass a arrow function and not he function name)

Copy link
Contributor

Choose a reason for hiding this comment

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

okok

/>
<Page.P variant="secondary">
By clicking, you accept to share your full conversation
Copy link
Contributor

Choose a reason for hiding this comment

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

Not very convince by this copy. Shouldn't we surface who will be able to see it if shared?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah, this one is tricky.
Basically, in the upcoming implementation, (almost) anyone can edit the assistant and see your feedback + the link that opens your conversation.
So We are being broad on purpose. We do display the name of the current builder (last author) in the PopoverContent though.

@overmode overmode merged commit ecb4aee into main Jan 2, 2025
4 checks passed
@overmode overmode deleted the lucas/feedbacks-sparkle branch January 2, 2025 13:16
overmode added a commit that referenced this pull request Jan 3, 2025
* Feedback popover with checkbox for is conversationShared

* Renamed isToRemove
overmode added a commit that referenced this pull request Jan 6, 2025
* Feedback popover with checkbox for is conversationShared

* Renamed isToRemove
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants