Skip to content

Commit

Permalink
fix: wrong highlight
Browse files Browse the repository at this point in the history
  • Loading branch information
HollaG committed Nov 13, 2024
1 parent 7fef99a commit ffa0803
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,6 @@
cursor: pointer;

.textBox {
overflow: hidden;
display: flex;
flex-direction: column;
padding-top: 0.5rem;
Expand Down
36 changes: 20 additions & 16 deletions peer-prep/src/components/Communication/Text/TextChatWidget.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -613,9 +613,7 @@ ${responseText}`;
setIsAiChat(false);
setAiButtonType(AiAssistButtonType.GEN_HINTS);

onBeforeSendMessage();

simulateClick();
// onBeforeSendMessage();
}

function handleGenerateSolution() {
Expand All @@ -627,7 +625,7 @@ ${responseText}`;
setDraftMessage(prompt);
setIsAiChat(false);
setAiButtonType(AiAssistButtonType.GEN_SOLUTION);
onBeforeSendMessage();
// onBeforeSendMessage();
}

function handleExplainCode() {
Expand All @@ -640,7 +638,7 @@ ${responseText}`;
setDraftMessage(prompt);
setIsAiChat(false);
setAiButtonType(AiAssistButtonType.CODE_EXPLANATION);
onBeforeSendMessage();
// onBeforeSendMessage();
}

function handleExplainQuestion() {
Expand All @@ -651,7 +649,7 @@ ${responseText}`;
setDraftMessage(prompt);
setIsAiChat(false);
setAiButtonType(AiAssistButtonType.QUESTION_EXPLANATION);
onBeforeSendMessage();
// onBeforeSendMessage();
}

const [isChatFullscreen, setIsChatFullscreen] = useState(false);
Expand Down Expand Up @@ -881,8 +879,9 @@ ${responseText}`;
gradient={{ from: "violet", to: "blue", deg: 135 }}
onClick={handleGenerateHints}
loading={
messageState === MessageState.SENDING &&
aiButtonType === AiAssistButtonType.GEN_HINTS
messageState === MessageState.SENDING
// &&
// aiButtonType === AiAssistButtonType.GEN_HINTS
}
disabled={
messageState === MessageState.SENDING &&
Expand All @@ -909,8 +908,9 @@ ${responseText}`;
gradient={{ from: "violet", to: "blue", deg: 135 }}
onClick={handleGenerateSolution}
loading={
messageState === MessageState.SENDING &&
aiButtonType === AiAssistButtonType.GEN_SOLUTION
messageState === MessageState.SENDING
// &&
// aiButtonType === AiAssistButtonType.GEN_SOLUTION
}
disabled={
messageState === MessageState.SENDING &&
Expand All @@ -936,8 +936,9 @@ ${responseText}`;
gradient={{ from: "violet", to: "blue", deg: 135 }}
onClick={handleExplainCode}
loading={
messageState === MessageState.SENDING &&
aiButtonType === AiAssistButtonType.CODE_EXPLANATION
messageState === MessageState.SENDING
// &&
// aiButtonType === AiAssistButtonType.CODE_EXPLANATION
}
disabled={
messageState === MessageState.SENDING &&
Expand All @@ -963,8 +964,9 @@ ${responseText}`;
gradient={{ from: "violet", to: "blue", deg: 135 }}
onClick={handleExplainQuestion}
loading={
messageState === MessageState.SENDING &&
aiButtonType === AiAssistButtonType.QUESTION_EXPLANATION
messageState === MessageState.SENDING
// &&
// aiButtonType === AiAssistButtonType.QUESTION_EXPLANATION
}
disabled={
messageState === MessageState.SENDING &&
Expand Down Expand Up @@ -1423,7 +1425,7 @@ function TextMessage({
{getAvatar(msg.integration)}
<Box className={`${classes.textBox}`}>
{" "}
{textObjects}
<Box style={{ overflow: "hidden" }}>{textObjects}</Box>
<span className={`${classes.timestamp}`}>
{formatTime(new Date(msg.timestamp))}{" "}
</span>{" "}
Expand Down Expand Up @@ -1485,7 +1487,9 @@ function TextMessage({
)}
<Box className={`${classes.entry} ${classes.send}`}>
{/* <Text className={`${classes.textBox}`}> {msg.content} </Text> */}
<Box className={classes.textBox}>{textObjects}</Box>
<Box className={classes.textBox}>
<Box style={{ overflow: "hidden" }}>{textObjects}</Box>
</Box>
<Text
className={`${classes.timestamp}`}
onClick={() => console.log(msg)}
Expand Down

0 comments on commit ffa0803

Please sign in to comment.