-
Notifications
You must be signed in to change notification settings - Fork 113
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
Conversation
const [isConversationShared, setIsConversationShared] = React.useState( | ||
feedback?.isConversationShared ?? false | ||
); | ||
// This is required to adjust the content of the popover even when feedback is null. |
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.
Not sure to understand this, do you mind to shed some lights?
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.
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; |
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
const isToRemove = feedback?.thumb === thumb; | |
const shouldRemoveExistingThumb = feedback?.thumb === thumb; |
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.
Agreed
[] | ||
); | ||
|
||
const closePopover = useCallback(() => { |
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.
No need to wrap setters for state
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 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)
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.
okok
/> | ||
<Page.P variant="secondary"> | ||
By clicking, you accept to share your full conversation |
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.
Not very convince by this copy. Shouldn't we surface who will be able to see it if shared?
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.
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.
* Feedback popover with checkbox for is conversationShared * Renamed isToRemove
* Feedback popover with checkbox for is conversationShared * Renamed isToRemove
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