diff --git a/www/public/mockServiceWorker.js b/www/public/mockServiceWorker.js
index 76bfad7..e781514 100644
--- a/www/public/mockServiceWorker.js
+++ b/www/public/mockServiceWorker.js
@@ -8,128 +8,128 @@
* - Please do NOT serve this file on production.
*/
-const PACKAGE_VERSION = "2.3.5";
-const INTEGRITY_CHECKSUM = "26357c79639bfa20d64c0efca2a87423";
-const IS_MOCKED_RESPONSE = Symbol("isMockedResponse");
-const activeClientIds = new Set();
+const PACKAGE_VERSION = '2.4.1'
+const INTEGRITY_CHECKSUM = '26357c79639bfa20d64c0efca2a87423'
+const IS_MOCKED_RESPONSE = Symbol('isMockedResponse')
+const activeClientIds = new Set()
-self.addEventListener("install", () => {
- self.skipWaiting();
-});
+self.addEventListener('install', function () {
+ self.skipWaiting()
+})
-self.addEventListener("activate", (event) => {
- event.waitUntil(self.clients.claim());
-});
+self.addEventListener('activate', function (event) {
+ event.waitUntil(self.clients.claim())
+})
-self.addEventListener("message", async (event) => {
- const clientId = event.source.id;
+self.addEventListener('message', async function (event) {
+ const clientId = event.source.id
if (!clientId || !self.clients) {
- return;
+ return
}
- const client = await self.clients.get(clientId);
+ const client = await self.clients.get(clientId)
if (!client) {
- return;
+ return
}
const allClients = await self.clients.matchAll({
- type: "window",
- });
+ type: 'window',
+ })
switch (event.data) {
- case "KEEPALIVE_REQUEST": {
+ case 'KEEPALIVE_REQUEST': {
sendToClient(client, {
- type: "KEEPALIVE_RESPONSE",
- });
- break;
+ type: 'KEEPALIVE_RESPONSE',
+ })
+ break
}
- case "INTEGRITY_CHECK_REQUEST": {
+ case 'INTEGRITY_CHECK_REQUEST': {
sendToClient(client, {
- type: "INTEGRITY_CHECK_RESPONSE",
+ type: 'INTEGRITY_CHECK_RESPONSE',
payload: {
packageVersion: PACKAGE_VERSION,
checksum: INTEGRITY_CHECKSUM,
},
- });
- break;
+ })
+ break
}
- case "MOCK_ACTIVATE": {
- activeClientIds.add(clientId);
+ case 'MOCK_ACTIVATE': {
+ activeClientIds.add(clientId)
sendToClient(client, {
- type: "MOCKING_ENABLED",
+ type: 'MOCKING_ENABLED',
payload: true,
- });
- break;
+ })
+ break
}
- case "MOCK_DEACTIVATE": {
- activeClientIds.delete(clientId);
- break;
+ case 'MOCK_DEACTIVATE': {
+ activeClientIds.delete(clientId)
+ break
}
- case "CLIENT_CLOSED": {
- activeClientIds.delete(clientId);
+ case 'CLIENT_CLOSED': {
+ activeClientIds.delete(clientId)
const remainingClients = allClients.filter((client) => {
- return client.id !== clientId;
- });
+ return client.id !== clientId
+ })
// Unregister itself when there are no more clients
if (remainingClients.length === 0) {
- self.registration.unregister();
+ self.registration.unregister()
}
- break;
+ break
}
}
-});
+})
-self.addEventListener("fetch", (event) => {
- const { request } = event;
+self.addEventListener('fetch', function (event) {
+ const { request } = event
// Bypass navigation requests.
- if (request.mode === "navigate") {
- return;
+ if (request.mode === 'navigate') {
+ return
}
// Opening the DevTools triggers the "only-if-cached" request
// that cannot be handled by the worker. Bypass such requests.
- if (request.cache === "only-if-cached" && request.mode !== "same-origin") {
- return;
+ if (request.cache === 'only-if-cached' && request.mode !== 'same-origin') {
+ return
}
// Bypass all requests when there are no active clients.
// Prevents the self-unregistered worked from handling requests
// after it's been deleted (still remains active until the next reload).
if (activeClientIds.size === 0) {
- return;
+ return
}
// Generate unique request ID.
- const requestId = crypto.randomUUID();
- event.respondWith(handleRequest(event, requestId));
-});
+ const requestId = crypto.randomUUID()
+ event.respondWith(handleRequest(event, requestId))
+})
async function handleRequest(event, requestId) {
- const client = await resolveMainClient(event);
- const response = await getResponse(event, client, requestId);
+ const client = await resolveMainClient(event)
+ const response = await getResponse(event, client, requestId)
// Send back the response clone for the "response:*" life-cycle events.
// Ensure MSW is active and ready to handle the message, otherwise
// this message will pend indefinitely.
if (client && activeClientIds.has(client.id)) {
- (async () => {
- const responseClone = response.clone();
+ ;(async function () {
+ const responseClone = response.clone()
sendToClient(
client,
{
- type: "RESPONSE",
+ type: 'RESPONSE',
payload: {
requestId,
isMockedResponse: IS_MOCKED_RESPONSE in response,
@@ -141,11 +141,11 @@ async function handleRequest(event, requestId) {
},
},
[responseClone.body],
- );
- })();
+ )
+ })()
}
- return response;
+ return response
}
// Resolve the main client for the given event.
@@ -153,49 +153,49 @@ async function handleRequest(event, requestId) {
// that registered the worker. It's with the latter the worker should
// communicate with during the response resolving phase.
async function resolveMainClient(event) {
- const client = await self.clients.get(event.clientId);
+ const client = await self.clients.get(event.clientId)
- if (client?.frameType === "top-level") {
- return client;
+ if (client?.frameType === 'top-level') {
+ return client
}
const allClients = await self.clients.matchAll({
- type: "window",
- });
+ type: 'window',
+ })
return allClients
.filter((client) => {
// Get only those clients that are currently visible.
- return client.visibilityState === "visible";
+ return client.visibilityState === 'visible'
})
.find((client) => {
// Find the client ID that's recorded in the
// set of clients that have registered the worker.
- return activeClientIds.has(client.id);
- });
+ return activeClientIds.has(client.id)
+ })
}
async function getResponse(event, client, requestId) {
- const { request } = event;
+ const { request } = event
// Clone the request because it might've been already used
// (i.e. its body has been read and sent to the client).
- const requestClone = request.clone();
+ const requestClone = request.clone()
function passthrough() {
- const headers = Object.fromEntries(requestClone.headers.entries());
+ const headers = Object.fromEntries(requestClone.headers.entries())
// Remove internal MSW request header so the passthrough request
// complies with any potential CORS preflight checks on the server.
// Some servers forbid unknown request headers.
- headers["x-msw-intention"] = undefined;
+ delete headers['x-msw-intention']
- return fetch(requestClone, { headers });
+ return fetch(requestClone, { headers })
}
// Bypass mocking when the client is not active.
if (!client) {
- return passthrough();
+ return passthrough()
}
// Bypass initial page load requests (i.e. static assets).
@@ -203,15 +203,15 @@ async function getResponse(event, client, requestId) {
// means that MSW hasn't dispatched the "MOCK_ACTIVATE" event yet
// and is not ready to handle requests.
if (!activeClientIds.has(client.id)) {
- return passthrough();
+ return passthrough()
}
// Notify the client that a request has been intercepted.
- const requestBuffer = await request.arrayBuffer();
+ const requestBuffer = await request.arrayBuffer()
const clientMessage = await sendToClient(
client,
{
- type: "REQUEST",
+ type: 'REQUEST',
payload: {
id: requestId,
url: request.url,
@@ -230,38 +230,38 @@ async function getResponse(event, client, requestId) {
},
},
[requestBuffer],
- );
+ )
switch (clientMessage.type) {
- case "MOCK_RESPONSE": {
- return respondWithMock(clientMessage.data);
+ case 'MOCK_RESPONSE': {
+ return respondWithMock(clientMessage.data)
}
- case "PASSTHROUGH": {
- return passthrough();
+ case 'PASSTHROUGH': {
+ return passthrough()
}
}
- return passthrough();
+ return passthrough()
}
function sendToClient(client, message, transferrables = []) {
return new Promise((resolve, reject) => {
- const channel = new MessageChannel();
+ const channel = new MessageChannel()
channel.port1.onmessage = (event) => {
- if (event.data?.error) {
- return reject(event.data.error);
+ if (event.data && event.data.error) {
+ return reject(event.data.error)
}
- resolve(event.data);
- };
+ resolve(event.data)
+ }
client.postMessage(
message,
[channel.port2].concat(transferrables.filter(Boolean)),
- );
- });
+ )
+ })
}
async function respondWithMock(response) {
@@ -270,15 +270,15 @@ async function respondWithMock(response) {
// instance will have status code set to 0. Since it's not possible to create
// a Response instance with status code 0, handle that use-case separately.
if (response.status === 0) {
- return Response.error();
+ return Response.error()
}
- const mockedResponse = new Response(response.body, response);
+ const mockedResponse = new Response(response.body, response)
Reflect.defineProperty(mockedResponse, IS_MOCKED_RESPONSE, {
value: true,
enumerable: true,
- });
+ })
- return mockedResponse;
+ return mockedResponse
}
diff --git a/www/src/app/chat/layout.tsx b/www/src/app/chat/layout.tsx
new file mode 100644
index 0000000..217cfdc
--- /dev/null
+++ b/www/src/app/chat/layout.tsx
@@ -0,0 +1,24 @@
+"use client";
+
+import { ChatHeader } from "@/components/chat/chat-header";
+import ChatSidebar from "@/components/chat/chat-sidebar";
+import type React from "react";
+
+export default function ChatLayout({
+ children,
+}: {
+ children: React.ReactNode;
+}) {
+ return (
+
+ );
+}
diff --git a/www/src/app/chat/page.tsx b/www/src/app/chat/page.tsx
new file mode 100644
index 0000000..434bf06
--- /dev/null
+++ b/www/src/app/chat/page.tsx
@@ -0,0 +1,17 @@
+"use client";
+
+import ChatBottombar from "@/components/chat/chat-bottombar";
+import { ChatList } from "@/components/chat/chat-list";
+import React from "react";
+
+export default function Chat() {
+
+ return (
+
+ );
+}
diff --git a/www/src/app/data.tsx b/www/src/app/data.tsx
index ca40c60..9908aac 100644
--- a/www/src/app/data.tsx
+++ b/www/src/app/data.tsx
@@ -1,26 +1,11 @@
-export interface BaseMessage {
+export interface Data {
+ answer: string;
+ url_supporting: string[];
+}
+export interface Message {
id: string;
name: string;
+ data: Data;
timestamp: number;
isLoading?: boolean;
}
-
-export interface TextMessage extends BaseMessage {
- message: string;
-}
-
-export interface StructuredMessage extends BaseMessage {
- message: {
- answer: string;
- url_supporting: string[];
- };
-}
-
-export type Message = TextMessage | StructuredMessage;
-
-// Type guard to check if a message is a StructuredMessage
-export function isStructuredMessage(
- message: Message,
-): message is StructuredMessage {
- return typeof message.message === "object" && "answer" in message.message;
-}
diff --git a/www/src/app/forum/layout.tsx b/www/src/app/forum/layout.tsx
index 6b6fc79..8530ab9 100644
--- a/www/src/app/forum/layout.tsx
+++ b/www/src/app/forum/layout.tsx
@@ -1,17 +1,17 @@
-import { Header } from "@/components/forum/Header";
+import { Header } from "@/components/Header";
import { DesktopSidebar } from "@/components/forum/Sidebar";
import type { PropsWithChildren } from "react";
export default function Layout({ children }: PropsWithChildren<{}>) {
return (
-
+
-
+
{children}
diff --git a/www/src/app/forum/topic/[topicId]/page.tsx b/www/src/app/forum/topic/[topicId]/page.tsx
index 76e54ca..b06e64e 100644
--- a/www/src/app/forum/topic/[topicId]/page.tsx
+++ b/www/src/app/forum/topic/[topicId]/page.tsx
@@ -2,7 +2,6 @@
import prisma from "@/lib/prisma";
import type { Prisma } from "@prisma/client";
import { TopicPage } from "./(components)/topic-page";
-import { useUserAccessedTopicPosthogTracker } from "./(components)/useUserAccessedTopicPosthogTracker";
export type TopicPageProps = {
topic: Prisma.TopicGetPayload<{
diff --git a/www/src/app/layout.tsx b/www/src/app/layout.tsx
index 120f8d4..d64464d 100644
--- a/www/src/app/layout.tsx
+++ b/www/src/app/layout.tsx
@@ -1,13 +1,21 @@
-import { GeistSans } from "geist/font/sans";
import type { Metadata } from "next";
import "./globals.css";
+import { Header } from "@/components/Header";
import { CSPostHogProvider } from "@/components/posthog";
import { Toaster } from "@/components/ui/toaster";
+import { cn } from "@/lib/utils";
import dynamic from "next/dynamic";
+import { Roboto_Flex } from "next/font/google";
const PostHogPageView = dynamic(() => import("@/components/posthog-pageview"), {
ssr: false,
});
+
+const robotoFlex = Roboto_Flex({
+ subsets: ["latin"],
+ display: "swap",
+});
+
export const metadata: Metadata = {
title: "Optimism GovGPT",
description: "Ask me anything about Optimism Governance!",
@@ -30,16 +38,17 @@ export default function RootLayout({
children: React.ReactNode;
}>) {
return (
-
+
{/* TODO OP-67: fix - this is requesting the route for a logo
*/}
-
-
-
-
- {children}
+
+
diff --git a/www/src/app/page.tsx b/www/src/app/page.tsx
index b96a071..0dd7680 100644
--- a/www/src/app/page.tsx
+++ b/www/src/app/page.tsx
@@ -1,36 +1,5 @@
-import { ChatLayout } from "@/components/chat/chat-layout";
-import { buttonVariants } from "@/components/ui/button";
-import { cn } from "@/lib/utils";
-import { GitHubLogoIcon } from "@radix-ui/react-icons";
-import { cookies } from "next/headers";
-import Link from "next/link";
+import { redirect } from "next/navigation";
export default function Home() {
- return (
-
-
-
- Optimism GovGPT
-
-
-
-
-
-
-
-
-
-
-
-
- );
+ return redirect("/chat");
}
diff --git a/www/src/components/forum/Header.tsx b/www/src/components/Header.tsx
similarity index 53%
rename from www/src/components/forum/Header.tsx
rename to www/src/components/Header.tsx
index 81a9125..30cf1d4 100644
--- a/www/src/components/forum/Header.tsx
+++ b/www/src/components/Header.tsx
@@ -1,9 +1,8 @@
-import { Search } from "lucide-react";
+"use client";
-import { Input } from "@/components/ui/input";
import Image from "next/image";
import Link from "next/link";
-import { MobileSidebar } from "./Sidebar";
+import { MobileSidebar } from "./forum/Sidebar";
export function Header() {
return (
@@ -23,17 +22,8 @@ export function Header() {
height={100}
className="w-[100px] md:w-[150px]"
/>
-
GovSummarizer
+
GovSummarizer
- {/*
*/}
);
diff --git a/www/src/components/chat/chat-bottombar.tsx b/www/src/components/chat/chat-bottombar.tsx
index b4b61aa..a8d4ff5 100644
--- a/www/src/components/chat/chat-bottombar.tsx
+++ b/www/src/components/chat/chat-bottombar.tsx
@@ -1,18 +1,14 @@
import { generateMessageParams } from "@/lib/chat-utils";
import { cn } from "@/lib/utils";
+import { getCurrentChat, useChatStore } from "@/states/use-chat-state";
import { SendHorizontal } from "lucide-react";
import Link from "next/link";
import type React from "react";
import { useEffect, useRef } from "react";
import { buttonVariants } from "../ui/button";
import { Textarea } from "../ui/textarea";
-import { getCurrentChat, useChatStore } from "./use-chat-state";
-interface ChatBottombarProps {
- isMobile: boolean;
-}
-
-export default function ChatBottombar({ isMobile }: ChatBottombarProps) {
+export default function ChatBottombar() {
const inputMessage = useChatStore.use.inputMessage();
const setInputMessage = useChatStore.use.setInputMessage();
const isStreaming = useChatStore.use.isStreaming();
@@ -34,7 +30,7 @@ export default function ChatBottombar({ isMobile }: ChatBottombarProps) {
if (inputMessage.trim() && !isStreaming && currentChat) {
const newMessage = generateMessageParams(
currentChat.id,
- inputMessage.trim(),
+ { answer: inputMessage.trim(), url_supporting: [] },
"anonymous",
);
@@ -60,8 +56,8 @@ export default function ChatBottombar({ isMobile }: ChatBottombarProps) {
};
return (
-
-
+
);
}
diff --git a/www/src/components/chat/chat-empty-state.tsx b/www/src/components/chat/chat-empty-state.tsx
index f3caf21..74d82d8 100644
--- a/www/src/components/chat/chat-empty-state.tsx
+++ b/www/src/components/chat/chat-empty-state.tsx
@@ -1,5 +1,7 @@
-import { InfoCircledIcon } from "@radix-ui/react-icons";
+import Image from "next/image";
import type React from "react";
+
+import useMobileStore from "@/states/use-mobile-state";
import { Button } from "../ui/button";
import { suggestions } from "./chat-suggestions";
@@ -11,9 +13,15 @@ export function ChatEmptyState({
return (
-
+
-
+
How can I help you today?
diff --git a/www/src/components/chat/chat-header.tsx b/www/src/components/chat/chat-header.tsx
new file mode 100644
index 0000000..25db563
--- /dev/null
+++ b/www/src/components/chat/chat-header.tsx
@@ -0,0 +1,40 @@
+"use client";
+
+import { useChatStore } from "@/states/use-chat-state";
+import { FilePlusIcon } from "lucide-react";
+import Image from "next/image";
+import { Button } from "../ui/button";
+import { ChatMobileSidebar } from "./chat-mobile-sidebar";
+
+export function ChatHeader() {
+ const { addChat } = useChatStore();
+
+ return (
+
+ );
+}
diff --git a/www/src/components/chat/chat-layout.tsx b/www/src/components/chat/chat-layout.tsx
index 43442e0..4ca4324 100644
--- a/www/src/components/chat/chat-layout.tsx
+++ b/www/src/components/chat/chat-layout.tsx
@@ -6,10 +6,10 @@ import {
ResizablePanelGroup,
} from "@/components/ui/resizable";
import { cn } from "@/lib/utils";
+import { useChatStore } from "@/states/use-chat-state";
import React, { useEffect, useState, useCallback } from "react";
import { Sidebar } from "../sidebar";
import { Chat } from "./chat";
-import { useChatStore } from "./use-chat-state";
interface ChatLayoutProps {
defaultLayout?: number[] | undefined;
diff --git a/www/src/components/chat/chat-list.tsx b/www/src/components/chat/chat-list.tsx
index 75d53af..711031e 100644
--- a/www/src/components/chat/chat-list.tsx
+++ b/www/src/components/chat/chat-list.tsx
@@ -1,54 +1,21 @@
-import { type Message, isStructuredMessage } from "@/app/data";
-import { formatAnswerWithReferences } from "@/lib/chat-utils";
-import { cn } from "@/lib/utils";
-import { Clipboard, Pencil, ThumbsDown } from "lucide-react";
-import { usePostHog } from "posthog-js/react";
-import React, {
- useCallback,
- useEffect,
- useRef,
- useState,
- useMemo,
-} from "react";
-import { Avatar, AvatarImage, BoringAvatar } from "../ui/avatar";
-import { Button } from "../ui/button";
-import {
- Dialog,
- DialogClose,
- DialogContent,
- DialogHeader,
- DialogTitle,
- DialogTrigger,
-} from "../ui/dialog";
-import { FormattedMessage } from "../ui/formatted-message";
-import { useToast } from "../ui/hooks/use-toast";
-import { Label } from "../ui/label";
-import { RadioGroup, RadioGroupItem } from "../ui/radio-group";
-import { ScrollArea } from "../ui/scroll-area";
-import { Textarea } from "../ui/textarea";
-import { getCurrentChat, useChatStore } from "./use-chat-state";
+import React, { useEffect, useRef } from "react";
+
+import { getCurrentChat, useChatStore } from "@/states/use-chat-state";
+import { LoadingIndicator } from "../ui/loading-indicator";
+import { ChatEmptyState } from "./chat-empty-state";
+import { Message } from "./message/message";
export const ChatList: React.FC = React.memo(() => {
const messagesEndRef = useRef
(null);
- const [feedbackMessage, setFeedbackMessage] = useState(null);
- const [feedbackReason, setFeedbackReason] = useState("");
- const [feedbackDetails, setFeedbackDetails] = useState("");
- const [isEditable, setIsEditable] = useState("");
- const [editMessageContent, setEditMessageContent] = useState("");
-
- const isStreaming = useChatStore.use.isStreaming();
- const loadingMessageId = useChatStore.use.loadingMessageId();
- const sendMessage = useChatStore.use.sendMessage();
- const selectedChatId = useChatStore.use.selectedChatId();
+ const currentChat = getCurrentChat();
+ const currentMessages = currentChat?.messages || [];
+ const setInputMessage = useChatStore.use.setInputMessage();
- const { toast } = useToast();
- const posthog = usePostHog();
+ const { addChat } = useChatStore();
- const currentChat = getCurrentChat();
- const currentMessages = useMemo(
- () => currentChat?.messages || [],
- [currentChat]
- );
+ const handleSuggestionClick = (suggestion: string) => {
+ setInputMessage(suggestion);
+ };
useEffect(() => {
const timer = setTimeout(() => {
@@ -61,261 +28,33 @@ export const ChatList: React.FC = React.memo(() => {
return () => clearTimeout(timer);
}, [currentMessages]);
- const handleNegativeReaction = useCallback(
- (message: Message) => {
- posthog.capture("USER_REACTED_NEGATIVELY_TO_MESSAGE", {
- messageId: message.id,
- currentMessages,
- });
- setFeedbackMessage(message);
- },
- [posthog, currentMessages]
- );
-
- const handleFeedbackSubmit = useCallback(() => {
- posthog.capture("USER_SENT_FEEDBACK", {
- messageId: feedbackMessage?.id,
- currentMessages,
- reason: feedbackReason,
- details: feedbackDetails,
- });
- setFeedbackMessage(null);
- setFeedbackReason("");
- setFeedbackDetails("");
- }, [
- posthog,
- feedbackMessage,
- currentMessages,
- feedbackReason,
- feedbackDetails,
- ]);
-
- const handleCopyMessage = useCallback(
- (message: Message) => {
- const textToCopy = isStructuredMessage(message)
- ? message.message.answer
- : message.message;
- navigator.clipboard.writeText(textToCopy).then(() => {
- toast({
- title: "Copied to clipboard",
- description: "The message has been copied to your clipboard.",
- });
- });
- },
- [toast]
- );
-
- const handleOnClickEditMessage = useCallback((message: Message) => {
- setEditMessageContent(
- isStructuredMessage(message) ? message.message.answer : message.message
+ useEffect(() => {
+ if (currentChat) return;
+ addChat();
+ }, [addChat, currentChat]);
+
+ if (currentChat === null) {
+ return (
+
+
+
);
- setIsEditable(message.id);
- }, []);
-
- const messageContent = useCallback((message: Message) => {
- if (!isStructuredMessage(message)) return message.message;
- if (isStructuredMessage(message) && !message.message.url_supporting.length) return message.message.answer;
-
-
- const formattedMessage = formatAnswerWithReferences(message);
- return formattedMessage.replace(/\n/g, "
");
- }, []);
+ }
- const handleOnEditMessage = useCallback(
- (messageId: string, newContent: string) => {
- if (!selectedChatId) {
- console.error("No current chat selected");
- return;
- }
- const messageToEdit = currentMessages.find((m) => m.id === messageId);
- if (messageToEdit) {
- const editedMessage: Message = {
- ...messageToEdit,
- message: newContent,
- };
- sendMessage(editedMessage);
- }
- },
- [selectedChatId, sendMessage, currentMessages]
- );
+ if (currentMessages.length === 0 && currentChat !== null) {
+ return (
+
+
+
+ );
+ }
- const handleOnSendEditMessage = useCallback(
- (messageId: string) => {
- if (!selectedChatId) {
- console.error("No current chat selected");
- return;
- }
- handleOnEditMessage(messageId, editMessageContent.trim());
- setEditMessageContent("");
- setIsEditable("");
- },
- [selectedChatId, editMessageContent, handleOnEditMessage]
- );
return (
-
+
{currentMessages.map((message) => (
-
-
- {message.name === "Optimism GovGPT" && (
-
-
-
- )}
-
- {message.name !== "Optimism GovGPT" &&
- isEditable !== message.id && (
-
- )}
-
-
- {loadingMessageId === message.id ? (
-
- ) : (
- <>
- {isEditable === message.id &&
- message.name !== "Optimism GovGPT" ? (
-
- ) : (
-
- )}
- {!isStreaming && message.name === "Optimism GovGPT" && (
-
-
-
-
- )}
- >
- )}
-
- {message.name !== "Optimism GovGPT" && (
-
-
-
- )}
-
-
+
))}
-
+
);
});
diff --git a/www/src/components/chat/chat-mobile-sidebar.tsx b/www/src/components/chat/chat-mobile-sidebar.tsx
new file mode 100644
index 0000000..85436e7
--- /dev/null
+++ b/www/src/components/chat/chat-mobile-sidebar.tsx
@@ -0,0 +1,24 @@
+import { Sheet, SheetContent, SheetTrigger } from "@/components/ui/sheet";
+import { Menu } from "lucide-react";
+import type React from "react";
+import { useState } from "react";
+import { Button } from "../ui/button";
+import ChatSidebar from "./chat-sidebar";
+
+export const ChatMobileSidebar: React.FC = () => {
+ const [open, setOpen] = useState(false);
+
+ return (
+
+
+
+
+
+
+
+
+ );
+};
diff --git a/www/src/components/chat/chat-sidebar.tsx b/www/src/components/chat/chat-sidebar.tsx
new file mode 100644
index 0000000..1fe445b
--- /dev/null
+++ b/www/src/components/chat/chat-sidebar.tsx
@@ -0,0 +1,92 @@
+"use client";
+
+import { cn } from "@/lib/utils";
+import { useChatStore } from "@/states/use-chat-state";
+import { FilePlusIcon, TrashIcon } from "@radix-ui/react-icons";
+import { ExternalLink } from "lucide-react";
+import Link from "next/link";
+import type React from "react";
+import { Button } from "../ui/button";
+
+export default function ChatSidebar() {
+ const { chats, selectedChatId, setSelectedChatId, addChat, removeChat } =
+ useChatStore();
+
+ const handleRemoveChat = (
+ e: React.MouseEvent,
+ id: string,
+ ) => {
+ e.stopPropagation();
+ removeChat(id);
+ };
+
+ return (
+
+ );
+}
diff --git a/www/src/components/chat/chat.tsx b/www/src/components/chat/chat.tsx
index 3c53727..a1032f6 100644
--- a/www/src/components/chat/chat.tsx
+++ b/www/src/components/chat/chat.tsx
@@ -1,9 +1,9 @@
+import { getCurrentChat, useChatStore } from "@/states/use-chat-state";
import React from "react";
import ChatBottombar from "./chat-bottombar";
import { ChatEmptyState } from "./chat-empty-state";
import { ChatList } from "./chat-list";
import ChatTopbar from "./chat-topbar";
-import { getCurrentChat, useChatStore } from "./use-chat-state";
interface ChatProps {
isMobile: boolean;
@@ -35,7 +35,7 @@ export function Chat({ isMobile, onToggleSidebar }: ChatProps) {
)}
-
+
);
}
diff --git a/www/src/components/chat/message/editable-message.tsx b/www/src/components/chat/message/editable-message.tsx
new file mode 100644
index 0000000..f2bd2fb
--- /dev/null
+++ b/www/src/components/chat/message/editable-message.tsx
@@ -0,0 +1,69 @@
+import type React from "react";
+
+import { useEffect, useRef } from "react";
+import { Button } from "../../ui/button";
+import { Textarea } from "../../ui/textarea";
+
+export interface EditableMessageProps {
+ editMessageContent: string;
+ setEditMessageContent: (
+ content: string | ((prevMessage: string) => string),
+ ) => void;
+ handleOnSendEditMessage: () => void;
+ setIsEditable: (isEditable: boolean) => void;
+}
+
+export const EditableMessage: React.FC
= ({
+ editMessageContent,
+ setEditMessageContent,
+ handleOnSendEditMessage,
+ setIsEditable,
+}) => {
+ const inputRef = useRef(null);
+
+ const handleKeyPress = (event: React.KeyboardEvent) => {
+ if (event.key === "Enter" && !event.shiftKey) {
+ event.preventDefault();
+ handleOnSendEditMessage();
+ }
+
+ if (event.key === "Enter" && event.shiftKey) {
+ event.preventDefault();
+ setEditMessageContent((prev) => `${prev}\n`);
+ }
+ };
+
+ useEffect(() => {
+ if (inputRef.current) {
+ inputRef.current.select();
+ }
+ }, []);
+
+ return (
+
+ );
+};
diff --git a/www/src/components/chat/message/message-actions.tsx b/www/src/components/chat/message/message-actions.tsx
new file mode 100644
index 0000000..5548feb
--- /dev/null
+++ b/www/src/components/chat/message/message-actions.tsx
@@ -0,0 +1,48 @@
+import { Clipboard, ThumbsDown } from "lucide-react";
+import type React from "react";
+
+import type { Message } from "@/app/data";
+import { Button } from "@/components/ui/button";
+import { useCopyMessage } from "@/components/ui/hooks/use-copy-message";
+import { useFeedback } from "@/components/ui/hooks/use-feedback";
+import { useChatStore } from "@/states/use-chat-state";
+
+
+export interface MessageActionsProps {
+ message: Message;
+}
+
+export const MessageActions: React.FC = ({ message }) => {
+ const { handleNegativeReaction, FeedbackDialog } = useFeedback(message);
+ const { handleCopyMessage } = useCopyMessage();
+ const isStreaming = useChatStore.use.isStreaming();
+
+ if (isStreaming || message.name !== "Optimism GovGPT") {
+ return null;
+ }
+
+ return (
+
+
+ handleNegativeReaction()}
+ >
+
+
+ }
+ />
+
+ );
+};
diff --git a/www/src/components/chat/message/message-avatar.tsx b/www/src/components/chat/message/message-avatar.tsx
new file mode 100644
index 0000000..261ef84
--- /dev/null
+++ b/www/src/components/chat/message/message-avatar.tsx
@@ -0,0 +1,28 @@
+import type React from "react";
+
+import { Avatar, AvatarImage, BoringAvatar } from "@/components/ui/avatar";
+
+export interface MessageAvatarProps {
+ name: string;
+}
+
+export const MessageAvatar: React.FC = ({ name }) => {
+ if (name === "Optimism GovGPT") {
+ return (
+
+
+
+ );
+ }
+ return (
+
+
+
+ );
+};
diff --git a/www/src/components/chat/message/message-content.tsx b/www/src/components/chat/message/message-content.tsx
new file mode 100644
index 0000000..d15c6e2
--- /dev/null
+++ b/www/src/components/chat/message/message-content.tsx
@@ -0,0 +1,72 @@
+import type React from "react";
+import { useState } from "react";
+
+import type { Data, Message } from "@/app/data";
+import { FormattedMessage } from "@/components/ui/formatted-message";
+import { LoadingIndicator } from "@/components/ui/loading-indicator";
+import { formatAnswerWithReferences } from "@/lib/chat-utils";
+import { cn } from "@/lib/utils";
+
+import { useChatStore } from "@/states/use-chat-state";
+import { EditableMessage } from "./editable-message";
+import { MessageActions } from "./message-actions";
+
+export interface MessageContentProps {
+ message: Message;
+ isEditable: boolean;
+ setIsEditable: (isEditable: boolean) => void;
+}
+export const MessageContent: React.FC = ({
+ message,
+ isEditable,
+ setIsEditable,
+}) => {
+ const [editMessageContent, setEditMessageContent] = useState(
+ message.data.answer,
+ );
+ const sendMessage = useChatStore.use.sendMessage();
+ const loadingMessageId = useChatStore.use.loadingMessageId();
+
+ const handleOnSendEditMessage = () => {
+ const editedMessage: Message = {
+ ...message,
+ data: { ...message.data, answer: editMessageContent.trim() },
+ };
+ sendMessage(editedMessage);
+ setIsEditable(false);
+ };
+
+ const messageContent = (data: Data) => {
+ if (data.url_supporting.length === 0) return data.answer;
+ const formattedMessage = formatAnswerWithReferences(data);
+ return formattedMessage.replace(/\n/g, "
");
+ };
+
+ if (loadingMessageId === message.id) {
+ return ;
+ }
+
+ if (isEditable && message.name !== "Optimism GovGPT") {
+ return (
+
+ );
+ }
+
+ return (
+
+
+
+
+ );
+};
diff --git a/www/src/components/chat/message/message.tsx b/www/src/components/chat/message/message.tsx
new file mode 100644
index 0000000..4c04244
--- /dev/null
+++ b/www/src/components/chat/message/message.tsx
@@ -0,0 +1,56 @@
+import type React from "react";
+import { useState } from "react";
+
+import { CopyCheck, Pencil, ThumbsDown } from "lucide-react";
+
+import type { Message as MessageType } from "@/app/data";
+import { Button } from "@/components/ui/button";
+import { cn } from "@/lib/utils";
+import useMobileStore from "@/states/use-mobile-state";
+import { MessageAvatar } from "./message-avatar";
+import { MessageContent } from "./message-content";
+
+export interface MessageProps {
+ message: MessageType;
+}
+
+export const Message: React.FC = ({ message }) => {
+ const [isEditable, setIsEditable] = useState(false);
+ const [isHovered, setIsHovered] = useState(false);
+ const { isMobile } = useMobileStore();
+
+ const handleEditClick = () => {
+ setIsEditable(true);
+ };
+
+ const isAnswer = message.name === "Optimism GovGPT";
+
+ return (
+ setIsHovered(true)}
+ onMouseLeave={() => setIsHovered(false)}
+ >
+ {isAnswer &&
}
+
+ {!isAnswer && (isHovered || isMobile) && !isEditable && (
+
+ )}
+
+
+ );
+};
diff --git a/www/src/components/forum/Sidebar.tsx b/www/src/components/forum/Sidebar.tsx
index f0ebae6..8190c77 100644
--- a/www/src/components/forum/Sidebar.tsx
+++ b/www/src/components/forum/Sidebar.tsx
@@ -170,14 +170,7 @@ function NavContent({ isMobile, setSheetOpen = () => {} }: NavContentProps) {
))}
-
- Have any questions?
-
+
Have any questions?
Loading...>;
+ return (
+
+
+
+ );
}
return (
@@ -304,10 +309,7 @@ function ForumInfiniteScrollTable({
updatedAt={row.original.updatedAt}
status={row.original.status}
/>
-
+
diff --git a/www/src/components/forum/table/table-row.tsx b/www/src/components/forum/table/table-row.tsx
index fd4baf6..39dc0ba 100644
--- a/www/src/components/forum/table/table-row.tsx
+++ b/www/src/components/forum/table/table-row.tsx
@@ -31,7 +31,7 @@ export const SnapshotProposal = ({
}: Topic) => {
return (
-
+
= ({
content,
}) => {
- return (
-
- );
+ return ;
};
diff --git a/www/src/components/ui/hooks/use-copy-message.ts b/www/src/components/ui/hooks/use-copy-message.ts
new file mode 100644
index 0000000..ee47c3a
--- /dev/null
+++ b/www/src/components/ui/hooks/use-copy-message.ts
@@ -0,0 +1,31 @@
+import { useCallback } from "react";
+import { useToast } from "./use-toast";
+
+interface UseCopyMessageResult {
+ handleCopyMessage: (textToCopy: string) => Promise;
+}
+
+export const useCopyMessage = (): UseCopyMessageResult => {
+ const { toast } = useToast();
+
+ const handleCopyMessage = useCallback(
+ async (textToCopy: string): Promise => {
+ try {
+ await navigator.clipboard.writeText(textToCopy);
+ toast({
+ title: "Copied to clipboard",
+ description: "The message has been copied to your clipboard.",
+ });
+ } catch (error) {
+ toast({
+ title: "Copy failed",
+ description: "Failed to copy the message to clipboard.",
+ variant: "destructive",
+ });
+ }
+ },
+ [toast],
+ );
+
+ return { handleCopyMessage };
+};
diff --git a/www/src/components/ui/hooks/use-feedback.tsx b/www/src/components/ui/hooks/use-feedback.tsx
new file mode 100644
index 0000000..ab40f4e
--- /dev/null
+++ b/www/src/components/ui/hooks/use-feedback.tsx
@@ -0,0 +1,74 @@
+import type React from "react";
+
+import type { Message } from "@/app/data";
+import { usePostHog } from "posthog-js/react";
+import { useCallback, useState } from "react";
+import { Button } from "../button";
+import {
+ Dialog,
+ DialogClose,
+ DialogContent,
+ DialogHeader,
+ DialogTitle,
+ DialogTrigger,
+} from "../dialog";
+import { Label } from "../label";
+import { RadioGroup, RadioGroupItem } from "../radio-group";
+import { Textarea } from "../textarea";
+
+export const useFeedback = (message: Message) => {
+ const [feedbackReason, setFeedbackReason] = useState("");
+ const [feedbackDetails, setFeedbackDetails] = useState("");
+ const posthog = usePostHog();
+
+ const handleNegativeReaction = useCallback(() => {
+ posthog.capture("USER_REACTED_NEGATIVELY_TO_MESSAGE", {
+ messageId: message.id,
+ });
+ }, [posthog, message.id]);
+
+ const handleFeedbackSubmit = useCallback(() => {
+ posthog.capture("USER_SENT_FEEDBACK", {
+ messageId: message.id,
+ reason: feedbackReason,
+ details: feedbackDetails,
+ });
+ setFeedbackReason("");
+ setFeedbackDetails("");
+ }, [posthog, message.id, feedbackReason, feedbackDetails]);
+
+ const FeedbackDialog: React.FC<{ trigger: React.ReactNode }> = ({
+ trigger,
+ }) => (
+
+ );
+
+ return { handleNegativeReaction, FeedbackDialog };
+};
diff --git a/www/src/components/ui/loading-indicator.tsx b/www/src/components/ui/loading-indicator.tsx
new file mode 100644
index 0000000..6a39258
--- /dev/null
+++ b/www/src/components/ui/loading-indicator.tsx
@@ -0,0 +1,7 @@
+export const LoadingIndicator: React.FC = () => (
+
+);
diff --git a/www/src/lib/chat-utils.ts b/www/src/lib/chat-utils.ts
index d818565..ddf168d 100644
--- a/www/src/lib/chat-utils.ts
+++ b/www/src/lib/chat-utils.ts
@@ -1,4 +1,4 @@
-import { type Message, StructuredMessage, isStructuredMessage } from "@/app/data";
+import type { Data, Message } from "@/app/data";
import { format, isValid } from "date-fns";
@@ -10,13 +10,11 @@ export interface ChatData {
}
export const getChatName = (messages: Message[]): string => {
- const firstQuestion = messages.find((m) => m.name !== "Optimism GovGPT");
+ const firstQuestion = messages?.find((m) => m.name !== "Optimism GovGPT");
if (firstQuestion) {
- const messageContent = isStructuredMessage(firstQuestion)
- ? firstQuestion.message.answer
- : firstQuestion.message;
+ const messageContent = firstQuestion.data.answer;
return (
- messageContent.slice(0, 30) + (messageContent.length > 30 ? "..." : "")
+ messageContent?.slice(0, 30) + (messageContent?.length > 30 ? "..." : "")
);
}
return "New Chat";
@@ -31,10 +29,13 @@ export const getValidTimestamp = (timestamp: number | undefined): number => {
export const saveChatsToLocalStorage = (chats: ChatData[]): void => {
const nonEmptyChats = chats.filter((chat) => chat.messages.length > 0);
- const chatHistory = nonEmptyChats.reduce((acc, chat) => {
- acc[`chat-${chat.id}`] = chat.messages;
- return acc;
- }, {} as Record);
+ const chatHistory = nonEmptyChats.reduce(
+ (acc, chat) => {
+ acc[`chat-${chat.id}`] = chat.messages;
+ return acc;
+ },
+ {} as Record,
+ );
localStorage.setItem("chatHistory", JSON.stringify(chatHistory));
};
@@ -75,38 +76,25 @@ export function generateChatParams(prefix: string): ChatData {
}
export function generateMessageParams(
chatId: string,
- message: string | { answer: string; url_supporting: string[] },
- name = "anonymous"
+ data: { answer: string; url_supporting: string[] },
+ name = "anonymous",
): Message {
const now = Date.now();
- if (typeof message === "string") {
- return {
- id: `${chatId}-message-${name}-${now}`,
- name,
- message,
- timestamp: now,
- };
- }
return {
id: `${chatId}-message-${name}-${now}`,
name,
- message: {
- answer: message.answer,
- url_supporting: message.url_supporting,
- },
+ data,
timestamp: now,
};
}
export function generateMessagesMemory(
- messages: Message[]
+ messages: Message[],
): { name: string; message: string }[] {
return messages.map((message) => {
return {
name: message.name === "Optimism GovGPT" ? "chat" : "user",
- message: isStructuredMessage(message)
- ? message.message.answer
- : message.message,
+ message: message.data.answer,
};
});
}
@@ -124,14 +112,12 @@ export const formatDate = (timestamp: number) => {
return "Invalid date";
};
-export const formatAnswerWithReferences = (message: StructuredMessage): string => {
- const { answer, url_supporting } = message.message;
+export const formatAnswerWithReferences = (data: Data): string => {
+ const { answer, url_supporting } = data;
- // Create clickable references
const references = url_supporting
.map((url, index) => `[${index + 1}]`)
.join(" ");
- // Combine the answer with the references
return `${answer.trim()}\n\nReferences: ${references}`;
};
diff --git a/www/src/components/chat/use-chat-state.ts b/www/src/states/use-chat-state.ts
similarity index 72%
rename from www/src/components/chat/use-chat-state.ts
rename to www/src/states/use-chat-state.ts
index e7ccb56..48b6c1b 100644
--- a/www/src/components/chat/use-chat-state.ts
+++ b/www/src/states/use-chat-state.ts
@@ -1,12 +1,8 @@
-import {
- type Message,
- type StructuredMessage,
- isStructuredMessage,
-} from "@/app/data";
+import type { Message } from "@/app/data";
import type { StoreApi, UseBoundStore } from "zustand";
import { persist } from "zustand/middleware";
import { immer } from "zustand/middleware/immer";
-import { sendMessage as sendMessageApi } from "./send-message";
+import { sendMessage as sendMessageApi } from "../components/chat/send-message";
import {
type ChatData,
@@ -35,7 +31,7 @@ interface ChatStoreActions {
setIsTyping: (isTyping: boolean) => void;
setLoadingMessageId: (id: string | null) => void;
setInputMessage: (
- message: string | ((prevMessage: string) => string)
+ message: string | ((prevMessage: string) => string),
) => void;
sendMessage: (newMessage: Message) => Promise;
}
@@ -47,7 +43,7 @@ type WithSelectors = S extends { getState: () => infer T }
: never;
const createSelectors = >>(
- _store: S
+ _store: S,
) => {
const store = _store as WithSelectors;
store.use = {};
@@ -59,24 +55,49 @@ const createSelectors = >>(
};
const createAssistantMessage = (chatId: string): Message => {
- return generateMessageParams(chatId, "", "Optimism GovGPT");
+ return generateMessageParams(
+ chatId,
+ { answer: "", url_supporting: [] },
+ "Optimism GovGPT",
+ );
};
-const processApiResponse = (response: any): StructuredMessage["message"] => {
- if (
- typeof response.data === "object" &&
- "answer" in response.data &&
- "url_supporting" in response.data
- ) {
- return response.data;
+// TODO: remove later https://linear.app/bleu-builders/issue/OP-258/remove-migration-function-from-chat-state-store
+function migrateState(persistedState: any): ChatStoreState {
+ if (persistedState.version === 1) {
+ return persistedState as ChatStoreState;
}
+
+ const migratedChats = Object.fromEntries(
+ Object.entries(persistedState.chats || {}).map(
+ ([id, chat]: [string, any]) => [
+ id,
+ {
+ ...chat,
+ messages: chat.messages.map((message: any) => ({
+ ...message,
+ data: {
+ answer:
+ message.name === "Optimism GovGPT"
+ ? message.message.answer
+ : message.message,
+ url_supporting:
+ message.name === "Optimism GovGPT"
+ ? message.message.url_supporting
+ : [],
+ },
+ })),
+ },
+ ],
+ ),
+ );
+
return {
- answer: Array.isArray(response.data)
- ? response.data.join("\n")
- : response.data,
- url_supporting: [],
+ ...persistedState,
+ chats: migratedChats,
+ version: 1,
};
-};
+}
const useChatStoreBase = create()(
persist(
@@ -101,7 +122,8 @@ const useChatStoreBase = create()(
removeChat: (id) =>
set((state) => {
delete state.chats[id];
- state.selectedChatId = Object.keys(state.chats)[0] || null;
+ if (state.selectedChatId === id)
+ state.selectedChatId = Object.keys(state.chats)[0];
}),
addMessage: (chatId, message) =>
@@ -130,7 +152,7 @@ const useChatStoreBase = create()(
if (!chatId) return;
const isEditing = state.chats[chatId].messages.some(
- (m) => m.id === newMessage.id
+ (message) => message.id === newMessage.id,
);
set((state) => {
@@ -138,13 +160,13 @@ const useChatStoreBase = create()(
state.isTyping = true;
if (isEditing) {
const messageIndex = state.chats[chatId].messages.findIndex(
- (m) => m.id === newMessage.id
+ (m) => m.id === newMessage.id,
);
if (messageIndex !== -1) {
state.chats[chatId].messages[messageIndex] = newMessage;
state.chats[chatId].messages = state.chats[chatId].messages.slice(
0,
- messageIndex + 1
+ messageIndex + 1,
);
}
} else {
@@ -161,12 +183,9 @@ const useChatStoreBase = create()(
});
const response = await sendMessageApi(
- isStructuredMessage(newMessage)
- ? newMessage.message.answer
- : newMessage.message,
- generateMessagesMemory(get().chats[chatId].messages)
+ newMessage.data.answer,
+ generateMessagesMemory(state.chats[chatId].messages),
);
- const content = processApiResponse(response);
set((state) => {
const lastMessage =
@@ -174,10 +193,10 @@ const useChatStoreBase = create()(
state.chats[chatId].messages.length - 1
];
if (lastMessage.id === assistantMessage.id) {
- lastMessage.message = content;
+ lastMessage.data = response.data;
}
state.chats[chatId].name = getChatName(
- state.chats[chatId].messages
+ state.chats[chatId].messages,
);
});
} catch (error) {
@@ -188,7 +207,7 @@ const useChatStoreBase = create()(
state.chats[chatId].messages.length - 1
];
if (lastMessage.id === state.loadingMessageId) {
- lastMessage.message =
+ lastMessage.data.answer =
"Sorry, an error occurred while processing your request.";
}
});
@@ -204,8 +223,15 @@ const useChatStoreBase = create()(
{
name: "chat-storage",
getStorage: () => localStorage,
- }
- )
+ migrate: (persistedState: any, version: number) => {
+ if (version === 0) {
+ return migrateState(persistedState);
+ }
+ return persistedState as ChatStoreState;
+ },
+ version: 1,
+ },
+ ),
);
export const useChatStore = createSelectors(useChatStoreBase);
diff --git a/www/src/states/use-mobile-state.ts b/www/src/states/use-mobile-state.ts
new file mode 100644
index 0000000..91baa0f
--- /dev/null
+++ b/www/src/states/use-mobile-state.ts
@@ -0,0 +1,26 @@
+import { create } from "zustand";
+import { subscribeWithSelector } from "zustand/middleware";
+
+interface MobileState {
+ isMobile: boolean;
+ setIsMobile: (isMobile: boolean) => void;
+}
+
+const useMobileStore = create()(
+ subscribeWithSelector((set) => ({
+ isMobile: false,
+ setIsMobile: (isMobile: boolean) => set({ isMobile }),
+ })),
+);
+
+if (typeof window !== "undefined") {
+ const checkIfMobile = () => {
+ const width = window.innerWidth;
+ useMobileStore.getState().setIsMobile(width < 768);
+ };
+
+ checkIfMobile();
+ window.addEventListener("resize", checkIfMobile);
+}
+
+export default useMobileStore;
diff --git a/www/tailwind.config.ts b/www/tailwind.config.ts
index c35ab18..a259d96 100644
--- a/www/tailwind.config.ts
+++ b/www/tailwind.config.ts
@@ -20,6 +20,10 @@ const config = {
extend: {
colors: {
optimism: "#FF0420",
+ chat: {
+ primary: '#F6F6F6',
+ secondary: '#787878'
+ },
border: "hsl(var(--border))",
input: "hsl(var(--input))",
ring: "hsl(var(--ring))",
diff --git a/www/yarn.lock b/www/yarn.lock
index baf0388..60846c5 100644
--- a/www/yarn.lock
+++ b/www/yarn.lock
@@ -13,11 +13,11 @@ __metadata:
linkType: hard
"@babel/runtime@npm:^7.20.13, @babel/runtime@npm:^7.21.0":
- version: 7.25.4
- resolution: "@babel/runtime@npm:7.25.4"
+ version: 7.25.6
+ resolution: "@babel/runtime@npm:7.25.6"
dependencies:
regenerator-runtime: "npm:^0.14.0"
- checksum: 10c0/33e937e685f0bfc2d40c219261e2e50d0df7381a6e7cbf56b770e0c5d77cb0c21bf4d97da566cf0164317ed7508e992082c7b6cce7aaa3b17da5794f93fbfb46
+ checksum: 10c0/d6143adf5aa1ce79ed374e33fdfd74fa975055a80bc6e479672ab1eadc4e4bfd7484444e17dd063a1d180e051f3ec62b357c7a2b817e7657687b47313158c3d2
languageName: node
linkType: hard
@@ -1611,21 +1611,21 @@ __metadata:
languageName: node
linkType: hard
-"@tanstack/query-core@npm:5.52.2":
- version: 5.52.2
- resolution: "@tanstack/query-core@npm:5.52.2"
- checksum: 10c0/34bc28f492272642159e6eb41cc45d05669a91a7a9124dcfa4a9b721696b921c0909234373035c9f51159069d71ee449459f0d528de500cfb07e6eb8fdd8857c
+"@tanstack/query-core@npm:5.53.1":
+ version: 5.53.1
+ resolution: "@tanstack/query-core@npm:5.53.1"
+ checksum: 10c0/9014bdf5a21f9ba9830cdd1289deeb29e4b881872b86a2dc60cd2ca06a194284437f371b77ec210897c8500429b4f41371d959cecfddfcc73f067ef09fc77a20
languageName: node
linkType: hard
"@tanstack/react-query@npm:^5.51.23":
- version: 5.52.2
- resolution: "@tanstack/react-query@npm:5.52.2"
+ version: 5.53.1
+ resolution: "@tanstack/react-query@npm:5.53.1"
dependencies:
- "@tanstack/query-core": "npm:5.52.2"
+ "@tanstack/query-core": "npm:5.53.1"
peerDependencies:
react: ^18 || ^19
- checksum: 10c0/936ecc8d4fbd2f89b5569ae9a2fe6e3c0af6ea02561de5f882b910662f1db1b0d73d7a9cbd94fd4d569a2c0773b5e629da4752dc62d4f3ebcf165f5b56d80c0e
+ checksum: 10c0/2506360d2dc1b57fedaa42b1a01d2f561a672643bc728f36261ff16764c6f0159a0950be8190b52cfabb8911d96c09f2cd124dc41fd1fbca514a0482db3bd813
languageName: node
linkType: hard
@@ -1642,14 +1642,14 @@ __metadata:
linkType: hard
"@tanstack/react-virtual@npm:^3.8.6":
- version: 3.10.5
- resolution: "@tanstack/react-virtual@npm:3.10.5"
+ version: 3.10.6
+ resolution: "@tanstack/react-virtual@npm:3.10.6"
dependencies:
- "@tanstack/virtual-core": "npm:3.10.5"
+ "@tanstack/virtual-core": "npm:3.10.6"
peerDependencies:
react: ^16.8.0 || ^17.0.0 || ^18.0.0
react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0
- checksum: 10c0/e1407b6b53abed97376fb3b30fa706bbb5797da0ad34f7c13182f808ff63a04add7f4b5001e85e3a33302a12823752c1cb4f40d166b2ee808bcaa3329201c50e
+ checksum: 10c0/6a162bade4ec00780405abf160cd4046e3346afcbbe07f8a64e86453f13902028d35cca417708daaf92262e3335ba72e1ec85be19f91b064173dd83bfb324cad
languageName: node
linkType: hard
@@ -1660,10 +1660,10 @@ __metadata:
languageName: node
linkType: hard
-"@tanstack/virtual-core@npm:3.10.5":
- version: 3.10.5
- resolution: "@tanstack/virtual-core@npm:3.10.5"
- checksum: 10c0/844d0a30923636b8fd454688eaf4714375d6fa252baaf5494ec5fd6786183cae6267861b54ca693284c1ab935e2cc142d8f3684e89316dfe0472c5b8c3bf71c8
+"@tanstack/virtual-core@npm:3.10.6":
+ version: 3.10.6
+ resolution: "@tanstack/virtual-core@npm:3.10.6"
+ checksum: 10c0/841540cd1e616dbe8074486213ec1f2c3a20e2b0fc1b50bc704861d05a3603810e1505bbb432ef62b900e32f355d046759d22bf707d661a57d62177e5508f399
languageName: node
linkType: hard
@@ -1883,12 +1883,12 @@ __metadata:
linkType: hard
"@types/react@npm:*, @types/react@npm:^18":
- version: 18.3.4
- resolution: "@types/react@npm:18.3.4"
+ version: 18.3.5
+ resolution: "@types/react@npm:18.3.5"
dependencies:
"@types/prop-types": "npm:*"
csstype: "npm:^3.0.2"
- checksum: 10c0/5c52e1e6f540cff21e3c2a5212066d02e005f6fb21e4a536a29097fae878db9f407cd7a4b43778f51359349c5f692e08bc77ddb5f5cecbfca9ca4d4e3c91a48e
+ checksum: 10c0/548b1d3d7c2f0242fbfdbbd658731b4ce69a134be072fa83e6ab516f2840402a3f20e3e7f72e95133b23d4880ef24a6d864050dc8e1f7c68f39fa87ca8445917
languageName: node
linkType: hard
@@ -2414,9 +2414,9 @@ __metadata:
linkType: hard
"boring-avatars@npm:^1.10.2":
- version: 1.10.2
- resolution: "boring-avatars@npm:1.10.2"
- checksum: 10c0/3613beecc44de8192aed4e3ccdf9d0794ff1a49f6d77af9827c0c73f9a5624ea896d12a02022ce530045ea410c17e02b1a916174cd78adc7923111cf4fd0c1e3
+ version: 1.11.0
+ resolution: "boring-avatars@npm:1.11.0"
+ checksum: 10c0/cc4c548a70f08052b83291210306d27ffad3214c9c7174f2182f8edfdad1d06b0c251b5ee01f29df9b7c64f04c612420086c081f2460de88639234b6c10ee94f
languageName: node
linkType: hard
@@ -2526,9 +2526,9 @@ __metadata:
linkType: hard
"caniuse-lite@npm:^1.0.30001579, caniuse-lite@npm:^1.0.30001646":
- version: 1.0.30001653
- resolution: "caniuse-lite@npm:1.0.30001653"
- checksum: 10c0/7aedf037541c93744148f599daea93d46d1f93ab4347997189efa2d1f003af8eadd7e1e05347ef09261ac1dc635ce375b8c6c00796245fffb4120a124824a14f
+ version: 1.0.30001655
+ resolution: "caniuse-lite@npm:1.0.30001655"
+ checksum: 10c0/fff0c0c3ffcba89828bfa6b99f118e82c064f46f15bb8655b9f2a352a3f552ccac0b87a9fe9532f8c5a29e284aae5579791e196480ec717d11ef1d1a1c2e3ff9
languageName: node
linkType: hard
@@ -3351,9 +3351,9 @@ __metadata:
linkType: hard
"escalade@npm:^3.1.1, escalade@npm:^3.1.2":
- version: 3.1.2
- resolution: "escalade@npm:3.1.2"
- checksum: 10c0/6b4adafecd0682f3aa1cd1106b8fff30e492c7015b178bc81b2d2f75106dabea6c6d6e8508fc491bd58e597c74abb0e8e2368f943ecb9393d4162e3c2f3cf287
+ version: 3.2.0
+ resolution: "escalade@npm:3.2.0"
+ checksum: 10c0/ced4dd3a78e15897ed3be74e635110bbf3b08877b0a41be50dcb325ee0e0b5f65fc2d50e9845194d7c4633f327e2e1c6cce00a71b617c5673df0374201d67f65
languageName: node
linkType: hard
@@ -4034,11 +4034,11 @@ __metadata:
linkType: hard
"get-tsconfig@npm:^4.7.5":
- version: 4.7.6
- resolution: "get-tsconfig@npm:4.7.6"
+ version: 4.8.0
+ resolution: "get-tsconfig@npm:4.8.0"
dependencies:
resolve-pkg-maps: "npm:^1.0.0"
- checksum: 10c0/2240e1b13e996dfbb947d177f422f83d09d1f93c9ce16959ebb3c2bdf8bdf4f04f98eba043859172da1685f9c7071091f0acfa964ebbe4780394d83b7dc3f58a
+ checksum: 10c0/943721c996d9a77351aa7c07956de77baece97f997bd30f3247f46907e4b743f7b9da02c7b3692a36f0884d3724271faeb88ed1c3aca3aba2afe3f27d6c4aeb3
languageName: node
linkType: hard
@@ -4138,13 +4138,6 @@ __metadata:
languageName: node
linkType: hard
-"graphql@npm:^16.8.1":
- version: 16.9.0
- resolution: "graphql@npm:16.9.0"
- checksum: 10c0/a8850f077ff767377237d1f8b1da2ec70aeb7623cdf1dfc9e1c7ae93accc0c8149c85abe68923be9871a2934b1bce5a2496f846d4d56e1cfb03eaaa7ddba9b6a
- languageName: node
- linkType: hard
-
"has-bigints@npm:^1.0.1, has-bigints@npm:^1.0.2":
version: 1.0.2
resolution: "has-bigints@npm:1.0.2"
@@ -5719,8 +5712,8 @@ __metadata:
linkType: hard
"msw@npm:^2.3.5":
- version: 2.3.5
- resolution: "msw@npm:2.3.5"
+ version: 2.4.1
+ resolution: "msw@npm:2.4.1"
dependencies:
"@bundled-es-modules/cookie": "npm:^2.0.0"
"@bundled-es-modules/statuses": "npm:^1.0.1"
@@ -5731,7 +5724,6 @@ __metadata:
"@types/cookie": "npm:^0.6.0"
"@types/statuses": "npm:^2.0.4"
chalk: "npm:^4.1.2"
- graphql: "npm:^16.8.1"
headers-polyfill: "npm:^4.0.2"
is-node-process: "npm:^1.2.0"
outvariant: "npm:^1.4.2"
@@ -5740,13 +5732,16 @@ __metadata:
type-fest: "npm:^4.9.0"
yargs: "npm:^17.7.2"
peerDependencies:
+ graphql: ">= 16.8.x"
typescript: ">= 4.7.x"
peerDependenciesMeta:
+ graphql:
+ optional: true
typescript:
optional: true
bin:
msw: cli/index.js
- checksum: 10c0/f944d8eb67ccdcf74aba0ce433395a9616420b8b36d43f033635817ef7535553c7bf6854392a95b093546e3481ca99e9017525b6c0bd02f51528b669e672214d
+ checksum: 10c0/9952dd89c289ddb1f9eac36065364b7143d40535a28d1f8eb6b947dc54cdd0e9cb38d656551c886e413baaddcae3e4e1ca80f8613c55729c8fcd3dbc8488cbde
languageName: node
linkType: hard
@@ -6384,13 +6379,13 @@ __metadata:
linkType: hard
"posthog-js@npm:^1.155.0":
- version: 1.158.3
- resolution: "posthog-js@npm:1.158.3"
+ version: 1.160.0
+ resolution: "posthog-js@npm:1.160.0"
dependencies:
fflate: "npm:^0.4.8"
preact: "npm:^10.19.3"
web-vitals: "npm:^4.0.1"
- checksum: 10c0/9282b8dc314ca7eff4913aa61a834ffbdba379438fce2f93ac21fa3f44a2b0ae93287f4d90df63aa96d2a5a12f30e3b138b3b268fd165b393bc9a5b35fdbc63a
+ checksum: 10c0/ba2601cab0578a6cbed50b2fe600781abbbd60707621f37ee87e55f3453e0babe8a32890fcd8ba9994e10707f26fbe9c804c69b7a00f101810db6e59590bfc16
languageName: node
linkType: hard
@@ -6543,8 +6538,8 @@ __metadata:
linkType: hard
"reablocks@npm:^8.4.6":
- version: 8.5.2
- resolution: "reablocks@npm:8.5.2"
+ version: 8.5.3
+ resolution: "reablocks@npm:8.5.3"
dependencies:
"@floating-ui/react": "npm:^0.26.16"
"@marko19907/string-to-color": "npm:^1.0.0"
@@ -6570,7 +6565,7 @@ __metadata:
peerDependencies:
react: ">=16"
react-dom: ">=16"
- checksum: 10c0/d2f4ad269146e4b61ebd920e0079f0cf2ca81224c68672b5ae0ebdfe510b03a5a0eb346950d5e31fed6439dcdad0d904b29fae7bb82d9648cd61c1f20c73d500
+ checksum: 10c0/7bf1f65f28ee4bd55413c77616f684481c74aa6fe79d20c1dfdb1ad44c40e7a2aa4c7bdb12ea59f07714c75b5612662c8e9b81014426733d79238f38d007dbe7
languageName: node
linkType: hard
@@ -6703,12 +6698,12 @@ __metadata:
linkType: hard
"react-resizable-panels@npm:^2.0.23":
- version: 2.1.1
- resolution: "react-resizable-panels@npm:2.1.1"
+ version: 2.1.2
+ resolution: "react-resizable-panels@npm:2.1.2"
peerDependencies:
react: ^16.14.0 || ^17.0.0 || ^18.0.0
react-dom: ^16.14.0 || ^17.0.0 || ^18.0.0
- checksum: 10c0/142e8980d5d7e8e8528c9da1982c2ef71bab9fbb92e0116627cfcb203ebd0bceaea03eba4f54b980868ba7b1a595313eafacf0ef27f900eb983f3f3c595c143c
+ checksum: 10c0/f532915f45a45e1fcd524249d114ff56b8e3f6a4b0c21509c6635fd23b12a1d68a72dab7be22d2944e904b42ae6e026f7a46749d025b5bbd454be88bbb5319db
languageName: node
linkType: hard
@@ -7478,11 +7473,11 @@ __metadata:
linkType: hard
"style-to-object@npm:^1.0.0":
- version: 1.0.6
- resolution: "style-to-object@npm:1.0.6"
+ version: 1.0.7
+ resolution: "style-to-object@npm:1.0.7"
dependencies:
inline-style-parser: "npm:0.2.3"
- checksum: 10c0/be5e8e3f0e35c0338de4112b9d861db576a52ebbd97f2501f1fb2c900d05c8fc42c5114407fa3a7f8b39301146cd8ca03a661bf52212394125a9629d5b771aba
+ checksum: 10c0/61f393482fdaf3f88acb1a31087875073d952c22f7614de90d5ce4f7aa86714c2523f96ab6ebefbecb327cfb31b41c14151878cb5e1e7999e5ee006987a11e62
languageName: node
linkType: hard
@@ -7795,9 +7790,9 @@ __metadata:
linkType: hard
"type-fest@npm:^4.9.0":
- version: 4.25.0
- resolution: "type-fest@npm:4.25.0"
- checksum: 10c0/1187b30d74e72f4b0b44a3493d2c1c2a9dc46423961c8250bd1535e976c4b8afc3916f6b4b90d7f56ed5b2f36d1645b05c318b4915fe4909a8a66890bda1d68d
+ version: 4.26.0
+ resolution: "type-fest@npm:4.26.0"
+ checksum: 10c0/3819b65fedd4655ed90703dad9e14248fb61f0a232dce8385e59771bdeaeca08195fe0683d892d62fcd84c0f3bb18bd4b0c3c2ba29023187d267868e75c53076
languageName: node
linkType: hard