• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

stacklok / codegate-ui / 12791977239

15 Jan 2025 03:48PM UTC coverage: 69.536%. Remained the same
12791977239

Pull #50

github

web-flow
Merge bb214a870 into 989f4bc41
Pull Request #50: Bump @tailwindcss/typography from 0.5.15 to 0.5.16

209 of 380 branches covered (55.0%)

Branch coverage included in aggregate %.

421 of 526 relevant lines covered (80.04%)

32.42 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

70.59
/src/components/Chat.tsx
1
import {
2
  ChatBubble,
3
  ChatBubbleAvatar,
4
  ChatBubbleMessage,
5
} from "./ui/chat/chat-bubble";
6
import { ChatMessageList } from "./ui/chat/chat-message-list";
7
import { useParams } from "react-router-dom";
8
import { usePromptsStore } from "@/hooks/usePromptsStore";
9
import { Markdown } from "./Markdown";
10
import { useEffect } from "react";
11
import { sanitizeQuestionPrompt } from "@/lib/utils";
12

13
export function Chat() {
14
  const { id } = useParams();
1✔
15
  const { prompts, setCurrentPromptId } = usePromptsStore();
1✔
16
  const chat = prompts.find((prompt) => prompt.chat_id === id);
1✔
17

18
  useEffect(() => {
1✔
19
    if (id) {
1!
20
      setCurrentPromptId(id);
1✔
21
    }
22

23
    return () => setCurrentPromptId("");
1✔
24
  }, [prompts, id, setCurrentPromptId]);
25

26
  return (
27
    <div className="w-[calc(100vw-18rem)]">
28
      <ChatMessageList>
29
        {(chat?.question_answers ?? []).map(({ question, answer }, index) => (
1!
30
          <div key={index} className="flex flex-col w-full h-full gap-6">
31
            <ChatBubble variant="sent">
32
              <ChatBubbleAvatar fallback="User" className="w-14" />
33
              <ChatBubbleMessage variant="sent" className="bg-zinc-700">
34
                <Markdown isInverted>
35
                  {sanitizeQuestionPrompt({
36
                    question: question?.message ?? "",
1!
37
                    answer: answer?.message ?? "",
1!
38
                  })}
39
                </Markdown>
40
              </ChatBubbleMessage>
41
            </ChatBubble>
42
            <ChatBubble variant="received">
43
              <ChatBubbleAvatar fallback="AI" />
44
              <ChatBubbleMessage variant="received">
45
                <Markdown>{answer?.message ?? ""}</Markdown>
1!
46
              </ChatBubbleMessage>
47
            </ChatBubble>
48
          </div>
49
        ))}
50
      </ChatMessageList>
51
    </div>
52
  );
53
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc