Skip to content

Commit

Permalink
enh(preview drawer): hide emojis (#4178)
Browse files Browse the repository at this point in the history
Co-authored-by: Henry Fontanier <[email protected]>
  • Loading branch information
fontanierh and Henry Fontanier authored Mar 6, 2024
1 parent cf8b340 commit ffa1198
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 3 deletions.
3 changes: 2 additions & 1 deletion front/components/assistant/TryAssistant.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ export function TryAssistant({
<GenerationContextProvider>
{conversation && (
<div
className="max-h-[100%] overflow-y-auto "
className="max-h-[100%] overflow-y-auto overflow-x-hidden"
id={CONVERSATION_PARENT_SCROLL_DIV_ID.modal}
>
<Conversation
Expand All @@ -144,6 +144,7 @@ export function TryAssistant({
conversationId={conversation.sId}
onStickyMentionsChange={setStickyMentions}
isInModal
hideReactions
/>
</div>
)}
Expand Down
4 changes: 3 additions & 1 deletion front/components/assistant/conversation/AgentMessage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,15 @@ export function AgentMessage({
conversationId,
reactions,
isInModal,
hideReactions,
}: {
message: AgentMessageType;
owner: WorkspaceType;
user: UserType;
conversationId: string;
reactions: MessageReactionType[];
isInModal?: boolean;
hideReactions?: boolean;
}) {
const [streamedAgentMessage, setStreamedAgentMessage] =
useState<AgentMessageType>(message);
Expand Down Expand Up @@ -353,7 +355,7 @@ export function AgentMessage({
buttons={buttons}
avatarBusy={agentMessageToRender.status === "created"}
reactions={reactions}
enableEmojis={true}
enableEmojis={!hideReactions}
renderName={() => {
return (
<div className="flex flex-row gap-2">
Expand Down
4 changes: 4 additions & 0 deletions front/components/assistant/conversation/Conversation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,14 @@ export default function Conversation({
conversationId,
onStickyMentionsChange,
isInModal,
hideReactions,
}: {
owner: WorkspaceType;
user: UserType;
conversationId: string;
onStickyMentionsChange?: (mentions: AgentMention[]) => void;
isInModal?: boolean;
hideReactions?: boolean;
}) {
const {
conversation,
Expand Down Expand Up @@ -202,6 +204,7 @@ export default function Conversation({
owner={owner}
user={user}
reactions={messageReactions}
hideReactions={hideReactions}
/>
</div>
</div>
Expand All @@ -217,6 +220,7 @@ export default function Conversation({
conversationId={conversationId}
reactions={messageReactions}
isInModal={isInModal}
hideReactions={hideReactions}
/>
</div>
</div>
Expand Down
4 changes: 3 additions & 1 deletion front/components/assistant/conversation/UserMessage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,14 @@ export function UserMessage({
owner,
user,
reactions,
hideReactions,
}: {
message: UserMessageType;
conversation: ConversationType;
owner: WorkspaceType;
user: UserType;
reactions: MessageReactionType[];
hideReactions?: boolean;
}) {
const { agentConfigurations } = useAgentConfigurations({
workspaceId: owner.sId,
Expand All @@ -37,7 +39,7 @@ export function UserMessage({
pictureUrl={message.user?.image || message.context.profilePictureUrl}
name={message.context.fullName}
reactions={reactions}
enableEmojis={true}
enableEmojis={!hideReactions}
renderName={(name) => <div className="text-base font-medium">{name}</div>}
>
<div className="flex flex-col gap-4">
Expand Down

0 comments on commit ffa1198

Please sign in to comment.