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 6832df0..d60e4b1 100644
--- a/www/src/app/forum/topic/[topicId]/page.tsx
+++ b/www/src/app/forum/topic/[topicId]/page.tsx
@@ -3,7 +3,6 @@ import type { Category, TopicContent } from "@/components/forum/Topic";
import prisma from "@/lib/prisma";
import type { Prisma } from "@prisma/client";
import { TopicPage } from "./(components)/topic-page";
-import { useUserAccessedTopicPosthogTracker } from "./(components)/useUserAccessedTopicPosthogTracker";
export type RelatedTopic = {
toTopic: TopicContent;
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 e615b57..f772096 100644
--- a/www/yarn.lock
+++ b/www/yarn.lock
@@ -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