diff --git a/backend/collaboration/src/service/get/collab-get-service.ts b/backend/collaboration/src/service/get/collab-get-service.ts index c6cb3db465..657b11211d 100644 --- a/backend/collaboration/src/service/get/collab-get-service.ts +++ b/backend/collaboration/src/service/get/collab-get-service.ts @@ -18,7 +18,8 @@ export async function getCollabRoomService( }; } - const combinedString = `uid1=${userid1}|uid2=${userid2}|qid=${questionid}`; + const randomString = crypto.randomBytes(4).toString('hex'); + const combinedString = `uid1=${userid1}|uid2=${userid2}|qid=${questionid}|rand=${randomString}`; const hash = crypto.createHash('sha256'); const uniqueRoomName = hash.update(combinedString).digest('hex'); return { diff --git a/frontend/src/components/blocks/interview/ai-chat.tsx b/frontend/src/components/blocks/interview/ai-chat.tsx index fbcf946e97..d909d89c02 100644 --- a/frontend/src/components/blocks/interview/ai-chat.tsx +++ b/frontend/src/components/blocks/interview/ai-chat.tsx @@ -19,7 +19,7 @@ interface AIChatProps { } interface StoredChat { - messages: ChatMessageType[]; + messages: Array; questionDetails: string; } @@ -35,7 +35,7 @@ export const AIChat: React.FC = ({ language = 'python', questionDetails = '', }) => { - const [messages, setMessages] = useState([]); + const [messages, setMessages] = useState>([]); const [isLoading, setIsLoading] = useState(false); const [error, setError] = useState(null); const streamingTextRef = useRef(''); @@ -179,7 +179,7 @@ export const AIChat: React.FC = ({ title='AI Assistant' onClearHistory={handleClearHistory} CustomPlaceHolderElem={({ onSend }) => ( -
+

No messages yet. Start a conversation, or use one of these prompts:

@@ -188,7 +188,7 @@ export const AIChat: React.FC = ({ key={index} variant='outline' size='sm' - className='rounded-xl' + className='max-w-full whitespace-normal break-words rounded-xl ' onClick={() => onSend(value)} > {value} diff --git a/frontend/src/components/blocks/interview/chat/chat-message.tsx b/frontend/src/components/blocks/interview/chat/chat-message.tsx index 63c7a797ac..f50eeb0364 100644 --- a/frontend/src/components/blocks/interview/chat/chat-message.tsx +++ b/frontend/src/components/blocks/interview/chat/chat-message.tsx @@ -26,7 +26,8 @@ export const ChatMessage: React.FC = ({ message }) => { className={cn( 'prose prose-neutral text-sm text-primary', 'prose-a:text-blue-500 prose-code:text-secondary-foreground prose-pre:ml-2 prose-pre:bg-transparent prose-pre:p-0', - 'prose-headings:text-primary prose-strong:text-primary prose-p:text-primary' + 'prose-headings:text-primary prose-strong:text-primary prose-p:text-primary', + 'break-words' )} > {message.text} diff --git a/frontend/src/components/blocks/interview/editor.tsx b/frontend/src/components/blocks/interview/editor.tsx index 0d9724fd29..664ab34613 100644 --- a/frontend/src/components/blocks/interview/editor.tsx +++ b/frontend/src/components/blocks/interview/editor.tsx @@ -22,7 +22,7 @@ import { CompleteDialog } from './room/complete-dialog'; import { OtherUserCompletingDialog } from './room/other-user-completing-dialog'; const EXTENSION_HEIGHT = 250; -const MIN_EDITOR_HEIGHT = 350; +const MIN_EDITOR_HEIGHT = 150; type EditorProps = { questionId: number; diff --git a/frontend/src/components/blocks/interview/question-attempts/table.tsx b/frontend/src/components/blocks/interview/question-attempts/table.tsx index db2cf889f9..893dce4f54 100644 --- a/frontend/src/components/blocks/interview/question-attempts/table.tsx +++ b/frontend/src/components/blocks/interview/question-attempts/table.tsx @@ -171,7 +171,8 @@ export function QuestionAttemptsTable({ - {table.getState().pagination.pageIndex + 1} of {table.getPageCount()} + {table.getState().pagination.pageIndex + 1} of{' '} + {Math.max(1, table.getPageCount())}